/**
 * Car Check - Namespaced Bootstrap CSS
 * 
 * This file contains Bootstrap styles scoped to our plugin container
 * to prevent conflicts with WordPress themes
 */

/* Basic Reset for our plugin container */
.car-check-container {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    text-align: left;
}

.car-check-container *,
.car-check-container *::before,
.car-check-container *::after {
    box-sizing: border-box;
}

/* Bootstrap Modal styles scoped to our plugin */
.car-check-container .modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    display: none;
    width: 100%;
    height: 100%;
    overflow: hidden;
    outline: 0;
    background-color: transparent;
}

.car-check-container .modal-dialog {
    position: relative;
    width: auto;
    margin: 0.5rem;
    pointer-events: none;
    max-width: 500px;
    margin: 1.75rem auto;
}

.car-check-container .modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - 3.5rem);
}

.car-check-container .modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 0.3rem;
    outline: 0;
}

.car-check-container .modal-header {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1rem;
    border-bottom: 1px solid #dee2e6;
    border-top-left-radius: calc(0.3rem - 1px);
    border-top-right-radius: calc(0.3rem - 1px);
    background-color: var(--car-check-primary-color, #0073aa);
    color: white;
}

.car-check-container .modal-title {
    margin-bottom: 0;
    line-height: 1.5;
    font-size: 1.25rem;
    color: white;
}

.car-check-container .btn-close {
    box-sizing: content-box;
    width: 1em;
    height: 1em;
    padding: 0.25em 0.25em;
    color: #fff;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
    border: 0;
    border-radius: 0.25rem;
    opacity: 0.8;
    cursor: pointer;
    z-index: 1060;
    filter: brightness(0) invert(1);
}

.car-check-container .btn-close:hover {
    opacity: 1;
}

.car-check-container .modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1rem;
}

/* Bootstrap table styles */
.car-check-container .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.car-check-container .table {
    width: 100%;
    margin-bottom: 1rem;
    color: #212529;
    border-collapse: collapse;
}

.car-check-container .table th,
.car-check-container .table td {
    padding: 0.75rem;
    vertical-align: top;
    border-top: 1px solid #dee2e6;
}

.car-check-container .table thead th {
    vertical-align: bottom;
    border-bottom: 2px solid #dee2e6;
}

.car-check-container .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.05);
}

.car-check-container .table-hover tbody tr:hover {
    color: #212529;
    background-color: rgba(0, 0, 0, 0.075);
}

/* Bootstrap Grid */
.car-check-container .row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.car-check-container .col-md-6 {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
}

@media (min-width: 768px) {
    .car-check-container .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .car-check-container .modal-dialog {
        max-width: 500px;
        margin: 1.75rem auto;
    }
}

/* Bootstrap Alert */
.car-check-container .alert {
    position: relative;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
}

.car-check-container .alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.car-check-container .alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* Bootstrap Utility Classes */
.car-check-container .text-center {
    text-align: center !important;
}

.car-check-container .p-4 {
    padding: 1.5rem !important;
}

.car-check-container .mt-3 {
    margin-top: 1rem !important;
}

.car-check-container .me-2 {
    margin-right: 0.5rem !important;
}

.car-check-container .img-fluid {
    max-width: 100%;
    height: auto;
}

/* Special Car Check Plugin Styles */
.car-check-container .car-check-form-simple {
    display: flex;
    background-color: #f9f9f9;
    border: 1px solid #e3e3e3;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 10px;
}

.car-check-container .car-check-form-simple input[type="text"] {
    flex: 1;
    padding: 10px 12px;
    font-size: inherit;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 10px;
}

.car-check-container .car-check-button {
    background-color: var(--car-check-primary-color, #0073aa);
    color: #fff;
    border: none;
    padding: 10px 20px;
    font-size: inherit;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    text-transform: uppercase;
}

.car-check-container .car-check-button:hover {
    opacity: 0.9;
}

.car-check-container .car-check-error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px 15px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin-bottom: 20px;
}

.car-check-container .car-check-sample {
    text-align: center;
    margin-bottom: 20px;
}

.car-check-container .car-check-sample a {
    color: var(--car-check-primary-color, #0073aa);
    text-decoration: none;
    font-size: 14px;
}

.car-check-container .car-check-sample a:hover {
    text-decoration: underline;
}

/* Modal Spinner */
.car-check-container .modal-spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    vertical-align: text-bottom;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: car-check-spinner-border .75s linear infinite;
    color: var(--car-check-primary-color, #0073aa);
}

@keyframes car-check-spinner-border {
    to { transform: rotate(360deg); }
}

/* Trust Logos Section */
.car-check-container .car-check-trust-logos {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eaeaea;
}

.car-check-container .logo-container {
    text-align: center;
    transition: transform 0.3s ease;
    padding: 15px;
}

.car-check-container .logo-container:hover {
    transform: translateY(-5px);
}

.car-check-container .logo-container img {
    max-height: 50px;
    margin-bottom: 10px;
    object-fit: contain;
}

.car-check-container .trust-text {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

/* Responsive styles */
@media (max-width: 767px) {
    .car-check-container .car-check-form-simple {
        flex-direction: column;
    }
    
    .car-check-container .car-check-form-simple input[type="text"] {
        margin-right: 0;
        margin-bottom: 10px;
        width: 100%;
    }
    
    .car-check-container .col-md-6 {
        width: 100%;
    }
}

/* Fix for Bootstrap Modal backdrop - completely remove it */
body.modal-open {
    overflow: hidden;
}

.modal-backdrop {
    display: none !important;
}

.modal-backdrop.fade {
    opacity: 0;
}

.modal-backdrop.show {
    opacity: 0;
}

/* Animation for Modal */
.car-check-container .fade {
    transition: opacity 0.15s linear;
}

.car-check-container .fade:not(.show) {
    opacity: 0;
}

/* Display prop when modal is shown */
.car-check-container .modal.show {
    display: block;
} 