/* ====== PERFORMANCE OPTIMIZATIONS ====== */

/* FAST popup animations */
.booking-popup-overlay {
    transition: opacity 0.2s ease !important;
    /* Faster transition */
}

.booking-popup-content {
    transition: transform 0.2s ease !important;
    /* Faster animation */
}

/* Faster button transitions */
.car-booking-btn,
.submit-btn {
    transition: all 0.2s ease !important;
    /* Faster hover effects */
}

/* Button Styles */
.car-booking-btn {
    width: 100%;
    background: #ff3726;
    color: white;
    padding: 15px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    margin: 10px 0;
    transition: all 0.3s ease;
}

.car-booking-btn:hover {
    background: #a3a3a3;
    transform: translateY(-2px);
}

/* Popup Styles */
.booking-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
}

.booking-popup-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    width: 95%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close-popup {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #ff4444;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.form-input,
.form-select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #007cba;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.form-col {
    flex: 1;
}

.readonly-field {
    background-color: #f5f5f5 !important;
    color: #333 !important;
    border: 1px solid #ccc !important;
    pointer-events: none;
}

/* Price Summary Styles */
.price-summary-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #e9ecef;
    margin: 20px 0;
}

.price-daily {
    background: #e3f2fd !important;
    color: #1976d2 !important;
    font-weight: bold;
    border-left: 4px solid #1976d2 !important;
}

.price-period {
    background: #fff3e0 !important;
    color: #f57c00 !important;
    font-weight: bold;
    border-left: 4px solid #f57c00 !important;
}

.price-total {
    background: #e8f5e8 !important;
    color: #2d5016 !important;
    font-weight: bold;
    font-size: 18px !important;
    border-left: 4px solid #28a745 !important;
    text-align: center;
}

.price-breakdown {
    margin-top: 15px;
    padding: 10px;
    background: #fff;
    border-radius: 5px;
    border: 1px solid #ddd;
}

/* Price highlight animation */
@keyframes priceUpdate {
    0% {
        background-color: #ffffcc;
    }

    100% {
        background-color: #e8f5e8;
    }
}

.price-update {
    animation: priceUpdate 1s ease-in-out;
}

/* Submit Button */
.submit-btn {
    background: #ff3726;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    transition: background 0.3s ease;
    margin-top: 10px;
}

.submit-btn:hover {
    background: #222222;
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Loading Animation */
@keyframes loading {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: loading 1s linear infinite;
    margin-left: 10px;
}

/* Messages */
.success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
    text-align: center;
    display: none;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
    text-align: center;
    display: none;
}

/* Form Validation Styles - FIXED (No red borders on load) */
.error-border {
    border-color: #ff4444 !important;
}

.form-input:invalid,
.form-select:invalid {
    border-color: #ddd;
    /* Default color instead of red */
}

.form-input:valid,
.form-select:valid {
    border-color: #28a745;
}

/* Responsive Design */
@media (max-width: 768px) {
    .booking-popup-content {
        padding: 20px;
        margin: 20px;
        width: calc(100% - 40px);
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-col {
        margin-bottom: 15px;
    }

    .price-summary-section {
        padding: 15px;
    }
}

/* Selected Car Field Specific Styles */
#selectedCarField {
    background: #f0f8ff !important;
    border-left: 4px solid #007cba !important;
    font-weight: bold;
    color: #007cba !important;
}

#selectedCarField::placeholder {
    color: #666;
    font-style: italic;
    font-weight: normal;
}