/* Modern VIN Check System - Complete CSS
 * Enhanced with better UI/UX, RTL support, and responsive design
 */

/* ========== Core Container Styles ========== */
.vin-container {
    max-width: 600px;
    margin: 40px auto;
    padding: 25px 30px 35px;
    background: linear-gradient(to bottom right, #ffffff, #f9f9f9);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #333;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.vin-container h2 {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 22px;
    text-align: center;
    font-weight: 600;
    position: relative;
    padding-bottom: 12px;
}

.vin-container h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(to right, #3498db, #2c3e50);
    border-radius: 3px;
}

.vin-container h3 {
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 18px;
    font-weight: 600;
}

/* ========== VIN Input Section ========== */
.vin-input-wrapper {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    position: relative;
}

.vin-input {
    flex: 1;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    letter-spacing: 1px;
}

.vin-input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
    outline: none;
}

.vin-check-button {
    padding: 14px 28px;
    background: linear-gradient(to right, #3498db, #2980b9);
    color: white;
    font-size: 16px;
    font-weight: 500;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 3px 6px rgba(41, 128, 185, 0.2);
}

.vin-check-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(41, 128, 185, 0.25);
}

.vin-check-button:active {
    transform: translateY(0);
    box-shadow: 0 3px 6px rgba(41, 128, 185, 0.2);
}

.vin-check-button.loading {
    background: linear-gradient(to right, #95a5a6, #7f8c8d);
    cursor: not-allowed;
    transform: none;
}

/* ========== Report Results Section ========== */
.vin-box {
    background: #ffffff;
    padding: 22px;
    border-radius: 12px;
    margin-top: 20px;
    border-left: 5px solid #3498db;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.vin-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.vin-box p {
    margin: 8px 0;
    line-height: 1.6;
}

.vin-box h3.section-title {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
    color: #2c3e50;
}

.vin-box.carfax {
    border-left-color: #2980b9;
}

/* Vehicle information rows */
.vehicle-info-row {
    display: flex;
    margin-bottom: 12px;
    border-bottom: 1px dashed #e0e0e0;
    padding-bottom: 10px;
}

.vehicle-info-label {
    flex: 0 0 30%;
    font-weight: 500;
    color: #2c3e50;
}

.vehicle-info-value {
    flex: 0 0 70%;
    color: #34495e;
}

/* Records container */
.records-container {
    text-align: center;
}

.records-row {
    margin: 12px 0;
    font-size: 15px;
    color: #34495e;
}

/* Loading message */
.loading-message {
    text-align: center;
    padding: 20px;
    font-size: 16px;
    color: #3498db;
    font-weight: 500;
}

/* ========== Order Form Styles ========== */
#orderForm {
    background: linear-gradient(to bottom right, #f8f9fa, #f5f7f9);
    padding: 30px;
    border-radius: 14px;
    margin-top: 35px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#orderForm.fadeIn {
    animation: fadeIn 0.5s ease forwards;
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 15px;
    text-align: center;
}

.form-control {
    width: 100%;
    padding: 13px 16px;
    font-size: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    transition: all 0.3s;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.form-control:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
    outline: none;
}

/* ========== Phone Input Styling ========== */
.phone-input {
    display: flex;
    gap: 12px;
}

.country-code {
    width: 35%;
    font-size: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    padding: 13px;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a0aec0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
}

.country-code:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
    outline: none;
}

.phone-number {
    width: 65%;
}

/* ========== OTP Verification Section ========== */
.otp-container {
    background: #ffffff;
    padding: 25px;
    border-radius: 12px;
    margin: 25px 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border-left: 4px solid #3498db;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.otp-form-group {
    margin-bottom: 18px;
    position: relative;
}

.otp-form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 15px;
    text-align: center;
}

.otp-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    transition: all 0.3s;
    margin-bottom: 12px;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.otp-input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
    outline: none;
}

.otp-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.otp-send-btn {
    background: linear-gradient(to right, #3498db, #2980b9);
    color: white;
}

.otp-send-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(52, 152, 219, 0.25);
}

.otp-send-btn:disabled {
    background: linear-gradient(to right, #95a5a6, #7f8c8d);
    cursor: not-allowed;
}

.otp-verify-btn {
    background: linear-gradient(to right, #2ecc71, #27ae60);
    color: white;
}

.otp-verify-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(46, 204, 113, 0.25);
}

.otp-submit-btn {
    background: linear-gradient(to right, #95a5a6, #7f8c8d);
    color: white;
    margin-top: 25px;
}

.otp-submit-btn.otp-enabled {
    background: linear-gradient(to right, #2ecc71, #27ae60);
    cursor: pointer;
}

.otp-submit-btn.otp-enabled:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(46, 204, 113, 0.25);
}

.otp-submit-btn.otp-disabled {
    background: linear-gradient(to right, #95a5a6, #7f8c8d);
    cursor: not-allowed;
}

.otp-info-text {
    display: block;
    margin-top: 10px;
    font-size: 13px;
    color: #7f8c8d;
    line-height: 1.5;
    text-align: center;
}

.otp-success-message {
    color: #27ae60;
    font-weight: 500;
    margin: 20px 0;
    padding: 14px;
    background: rgba(46, 204, 113, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(46, 204, 113, 0.2);
}

.otp-hidden {
    display: none;
}

/* ========== Toggle Options for Report Type ========== */
.toggle-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.toggle-option {
    flex: 1;
    min-width: calc(33% - 15px);
    display: inline-block;
    cursor: pointer;
}

.toggle-option input {
    display: none;
}

.toggle-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
    padding: 20px 15px;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    height: 100%;
    position: relative;
}

.toggle-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right, #3498db, #2980b9);
    opacity: 0;
    border-radius: 10px 10px 0 0;
    transition: opacity 0.3s;
}

.toggle-option input:checked + .toggle-card::before {
    opacity: 1;
}

.toggle-title {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.toggle-price {
    display: block;
    font-size: 16px;
    color: #3498db;
    font-weight: 500;
    margin-bottom: 2px;
}

.toggle-price-usd {
    display: block;
    font-size: 13px;
    color: #95a5a6;
    font-weight: normal;
}

.toggle-option input:checked + .toggle-card {
    border-color: #3498db;
    background: #f8f9fa;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.toggle-option:hover .toggle-card {
    border-color: #bdc3c7;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
}

/* ========== Best Deal Badge ========== */
.best-deal-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: linear-gradient(135deg, #f39c12, #e74c3c);
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 20px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
    transform: rotate(5deg);
    z-index: 2;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: rotate(5deg) scale(1); }
    50% { transform: rotate(5deg) scale(1.05); }
    100% { transform: rotate(5deg) scale(1); }
}

/* ========== reCAPTCHA Container ========== */
.recaptcha-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 25px 0;
}

.recaptcha-error {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 10px;
    text-align: center;
    background-color: rgba(231, 76, 60, 0.1);
    padding: 8px 12px;
    border-radius: 5px;
    border: 1px solid rgba(231, 76, 60, 0.2);
    display: none;
}

/* ========== Animation and States ========== */
.hidden {
    display: none;
}

.loading-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========== Error Message Styles ========== */
.error-message {
    color: #e74c3c;
    font-weight: 500;
    padding: 15px;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 10px;
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(231, 76, 60, 0.2);
}

.success-message {
    color: #27ae60;
    font-weight: 500;
    padding: 15px;
    background: rgba(46, 204, 113, 0.1);
    border-radius: 10px;
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(46, 204, 113, 0.2);
}

/* ========== Toast Notifications ========== */
.vin-toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

.vin-toast {
    min-width: 250px;
    margin: 10px;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.vin-toast-error {
    background-color: #fff;
    border-left: 4px solid #e74c3c;
    color: #e74c3c;
}

.vin-toast-success {
    background-color: #fff;
    border-left: 4px solid #2ecc71;
    color: #2ecc71;
}

.vin-toast-info {
    background-color: #fff;
    border-left: 4px solid #3498db;
    color: #3498db;
}

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
    .vin-container {
        margin: 20px auto;
        padding: 20px;
        border-radius: 12px;
    }
    
    .vin-input-wrapper {
        flex-direction: column;
    }
    
    .vin-check-button {
        margin-top: 10px;
    }
    
    .toggle-options {
        flex-direction: column;
    }
    
    .toggle-option {
        min-width: 100%;
    }
    
    .toggle-card {
        padding: 15px 10px;
    }
    
    .phone-input {
        flex-direction: column;
    }
    
    .country-code, .phone-number {
        width: 100%;
    }
    
    #orderForm {
        padding: 20px;
    }
    
    .otp-container {
        padding: 20px;
    }
}

/* ========== WooCommerce Checkout Styling ========== */
/* Fix RTL spacing issues by making all fields full width */
html[dir="rtl"] .woocommerce-billing-fields .form-row,
html[lang="ar"] .woocommerce-billing-fields .form-row {
    width: 100% !important;
    float: none !important;
    clear: both !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Make all fields and labels same width regardless of language */
.woocommerce-billing-fields .form-row {
    width: 100% !important;
    float: none !important;
    clear: both !important;
}

/* Fix field sizes to be consistent */
.woocommerce-billing-fields input {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Make readonly fields look disabled */
.woocommerce-billing-fields input[readonly] {
    background-color: #f5f5f5 !important;
    border-color: #ddd !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    color: #666666 !important;
}

/* Override WooCommerce styles for columns */
.woocommerce-checkout .col2-set .col-1,
.woocommerce-checkout .col2-set .col-2 {
    float: none !important;
    width: 100% !important;
}

/* Fix VIN field to stand out */
#vin_number {
    background-color: #f5f5f5 !important;
    font-weight: bold !important;
    letter-spacing: 1px !important;
    text-align: center !important;
    border: 2px solid #ddd !important;
    font-family: monospace !important;
    color: #333 !important;
}

/* General fixes for RTL mode */
.woocommerce .rtl,
.woocommerce-page .rtl,
html[dir="rtl"] .woocommerce,
html[lang="ar"] .woocommerce {
    /* Fix form layout */
    --form-row-space: 0 !important;
    --form-row-margin: 0 !important;
}

/* Force full width for better layout */
body.rtl .woocommerce form .form-row,
html[dir="rtl"] .woocommerce form .form-row,
html[lang="ar"] .woocommerce form .form-row {
    width: 100% !important;
    padding: 0 !important;
    margin: 0 0 10px 0 !important;
}

/* Fix padding and margins */
body.rtl .woocommerce-checkout .shop_table,
html[dir="rtl"] .woocommerce-checkout .shop_table,
html[lang="ar"] .woocommerce-checkout .shop_table {
    direction: rtl !important;
    text-align: right !important;
}

/* Fix field width issues */
html[dir="rtl"] .form-row-first, 
html[dir="rtl"] .form-row-last,
html[lang="ar"] .form-row-first, 
html[lang="ar"] .form-row-last {
    width: 100% !important;
    float: none !important;
}

/* WooCommerce labels */
.woocommerce-billing-fields label {
    display: block;
    font-weight: 500;
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 15px;
    text-align: center;
}

.woocommerce-billing-fields input {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 2px solid #e0e0e0 !important;
    border-radius: 10px;
    background-color: #f8f9fa !important;
}

.woocommerce-billing-fields input:focus {
    border-color: #3498db !important;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15) !important;
    outline: none;
}

.woocommerce-additional-fields {
    display: none !important;
}

/* RTL Support */
html[dir="rtl"] .woocommerce-billing-fields label,
html[lang="ar"] .woocommerce-billing-fields label {
    text-align: right !important;
}

html[dir="rtl"] .woocommerce-billing-fields .form-row,
html[lang="ar"] .woocommerce-billing-fields .form-row {
    float: right !important;
    text-align: right !important;
    direction: rtl !important;
}

html[dir="rtl"] .woocommerce-billing-fields input,
html[lang="ar"] .woocommerce-billing-fields input {
    text-align: right !important;
}

/* Specifically for TranslatePress */
html[dir="rtl"] .trp-language-switcher,
html[lang="ar"] .trp-language-switcher {
    z-index: 999 !important;
}