/**
 * DeMV Platform - Booking Modal CSS
 * Specific styles for the booking modal functionality
 */

/* Booking Modal */
.modal.booking-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    overflow: hidden !important; /* Prevent outer scrollbar */
}

.modal.booking-modal.show {
    display: flex;
}

.booking-content {
    background-color: var(--card-bg, rgba(30, 30, 30, 0.95));
    border-radius: 10px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    border: 1px solid var(--primary, #00ffcc);
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.2);
    transform: translateY(20px);
    scrollbar-width: thin; /* For Firefox */
    scrollbar-color: var(--primary, #00ffcc) rgba(0, 0, 0, 0.3); /* For Firefox */
}

/* Custom scrollbar for Webkit browsers */
.booking-content::-webkit-scrollbar {
    width: 8px;
}

.booking-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.booking-content::-webkit-scrollbar-thumb {
    background-color: var(--primary, #00ffcc);
    border-radius: 10px;
}

/* Fix for double scrollbar issue */
body.modal-open {
    overflow: hidden !important;
}

/* Ensure modal body doesn't create another scrollbar */
.modal-body {
    overflow: visible !important;
}

/* Ensure flatpickr calendars display properly */
.flatpickr-calendar {
    z-index: 1500 !important;
    background-color: rgba(20, 20, 20, 0.98) !important; /* Darker background for better contrast */
    border: 3px solid var(--primary, #00ffcc) !important;
    box-shadow: 0 0 40px rgba(0, 255, 204, 0.8) !important; /* Stronger glow */
    color: #fff !important;
    margin-top: 10px !important;
    border-radius: 8px !important;
    animation: glow-pulse 2s infinite alternate !important;
    width: auto !important; /* Let it size naturally */
    min-width: 300px !important; /* Ensure minimum width */
    max-width: 90% !important; /* Don't overflow the modal */
    overflow: visible !important; /* Ensure content isn't cut off */
    /* Remove fixed positioning that might cause issues */
    position: absolute !important;
    /* Ensure it's not cut off by parent containers */
    inset: auto !important;
}

@keyframes glow-pulse {
    from {
        box-shadow: 0 0 25px rgba(0, 255, 204, 0.6);
    }
    to {
        box-shadow: 0 0 40px rgba(0, 255, 204, 0.9);
    }
}

/* Add a highlight effect when the calendar opens */
@keyframes calendar-appear {
    0% { transform: scale(0.95); opacity: 0.5; }
    100% { transform: scale(1.05); opacity: 1; }
}

.flatpickr-calendar.open {
    animation: calendar-appear 0.3s ease forwards, glow-pulse 2s infinite alternate !important;
}

/* Style flatpickr calendar elements */
.flatpickr-day {
    color: #fff !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
    font-size: 16px !important; /* Larger font size */
    height: 40px !important; /* Taller day cells */
    line-height: 40px !important; /* Center text vertically */
    margin: 2px !important; /* Add spacing between days */
    width: 40px !important; /* Wider day cells */
}

.flatpickr-day:hover {
    background: rgba(0, 255, 204, 0.2) !important;
    border-color: rgba(0, 255, 204, 0.4) !important;
}

.flatpickr-day.selected, 
.flatpickr-day.startRange, 
.flatpickr-day.endRange, 
.flatpickr-day.selected.inRange, 
.flatpickr-day.startRange.inRange, 
.flatpickr-day.endRange.inRange, 
.flatpickr-day.selected:focus, 
.flatpickr-day.startRange:focus, 
.flatpickr-day.endRange:focus, 
.flatpickr-day.selected:hover, 
.flatpickr-day.startRange:hover, 
.flatpickr-day.endRange:hover {
    background: var(--primary, #00ffcc) !important;
    border-color: var(--primary, #00ffcc) !important;
    color: #000 !important;
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.7) !important;
    font-weight: bold !important;
    transform: scale(1.1) !important;
}

.flatpickr-day.today {
    border: 2px solid var(--primary, #00ffcc) !important;
    background-color: rgba(0, 255, 204, 0.15) !important;
    font-weight: bold !important;
}

.flatpickr-months {
    background-color: rgba(0, 0, 0, 0.4) !important;
    padding: 8px 0 !important;
    border-radius: 6px !important;
    margin-bottom: 10px !important;
    border-bottom: 1px solid var(--primary, #00ffcc) !important;
}

/* Fix calendar container sizing */
.flatpickr-calendar.open {
    display: inline-block !important;
    margin: 0 auto !important;
    transform: scale(1.05) !important;
}

.flatpickr-innerContainer,
.flatpickr-rContainer,
.flatpickr-days {
    width: 100% !important;
}

.dayContainer {
    width: 100% !important;
    min-width: 280px !important;
    max-width: 400px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-around !important;
    padding: 5px !important;
}

.flatpickr-months .flatpickr-month,
.flatpickr-weekdays,
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
    color: var(--primary, #00ffcc) !important;
    fill: var(--primary, #00ffcc) !important;
    font-weight: bold !important;
    font-size: 16px !important;
}

.flatpickr-weekdays {
    background-color: rgba(0, 0, 0, 0.3) !important;
    margin-bottom: 8px !important;
    padding: 5px 0 !important;
}

.flatpickr-weekday {
    color: var(--primary, #00ffcc) !important;
    font-weight: bold !important;
}

.flatpickr-day.flatpickr-disabled, 
.flatpickr-day.flatpickr-disabled:hover,
.flatpickr-day.prevMonthDay, 
.flatpickr-day.nextMonthDay, 
.flatpickr-day.notAllowed {
    color: rgba(255, 255, 255, 0.3) !important;
}

/* Style the arrows */
.flatpickr-prev-month,
.flatpickr-next-month {
    padding: 10px !important;
}

.flatpickr-prev-month svg,
.flatpickr-next-month svg {
    fill: var(--primary, #00ffcc) !important;
    width: 16px !important;
    height: 16px !important;
}

.flatpickr-prev-month:hover svg,
.flatpickr-next-month:hover svg {
    fill: #fff !important;
    transform: scale(1.2) !important;
}

/* Make the input fields glow when calendar is open */
.flatpickr-input.active {
    border-color: var(--primary, #00ffcc) !important;
    box-shadow: 0 0 15px rgba(0, 255, 204, 0.5) !important;
    background-color: rgba(0, 255, 204, 0.1) !important;
}

.modal.booking-modal.show .booking-content {
    transform: translateY(0);
}

/* Booking Vehicle Info */
.booking-vehicle-info {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.booking-vehicle-image-container {
    flex: 0 0 200px;
    height: 150px;
    border-radius: 8px;
    overflow: hidden;
}

.booking-vehicle-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.booking-vehicle-details {
    flex: 1;
}

.booking-vehicle-name {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    color: var(--primary, #00ffcc);
}

.booking-vehicle-price {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0.5rem 0;
}

/* Booking Form */
#booking-form {
    padding: 0 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 20px;
}

/* Enhance date input fields */
.booking-form input[type="text"]#booking-start-date,
.booking-form input[type="text"]#booking-end-date {
    background-color: rgba(0, 0, 0, 0.6) !important;
    border: 2px solid var(--primary, #00ffcc) !important;
    color: #fff !important;
    padding: 12px 15px !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    letter-spacing: 0.5px !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    position: relative !important;
}

.booking-form input[type="text"]#booking-start-date:hover,
.booking-form input[type="text"]#booking-end-date:hover {
    background-color: rgba(0, 255, 204, 0.1) !important;
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.3) !important;
}

/* Add calendar icon indicator */
.booking-form .date-input-container {
    position: relative;
}

.booking-form .date-input-container::after {
    content: '📅';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary, #00ffcc);
    font-size: 16px;
    pointer-events: none;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 5px;
    border: 1px solid rgba(0, 255, 204, 0.3);
    background: rgba(18, 18, 24, 0.6);
    color: #fff;
    font-size: 1rem;
}

/* Booking Options */
.booking-options {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.booking-options h4 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option-item {
    display: flex;
    align-items: center;
}

.option-checkbox {
    margin-right: 1rem;
    width: 20px;
    height: 20px;
}

.option-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    cursor: pointer;
}

.option-info {
    display: flex;
    flex-direction: column;
}

.option-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.option-description {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.option-price {
    font-weight: 600;
    color: var(--primary, #00ffcc);
}

/* Booking Summary */
.booking-summary {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 204, 0.15);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.booking-summary h4 {
    margin: 0 0 1rem 0;
    color: rgba(0, 255, 204, 0.9);
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(0, 255, 204, 0.2);
    padding-bottom: 0.5rem;
}

.booking-summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.booking-summary-item:last-of-type {
    border-bottom: none;
}

.booking-summary-item .label {
    color: rgba(255, 255, 255, 0.8);
}

.booking-summary-item .value {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.booking-summary-item.total {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 255, 204, 0.3);
    font-weight: 600;
    font-size: 1.2rem;
}

.booking-summary-item.total .label {
    color: rgba(255, 255, 255, 0.9);
}

.booking-summary-item.total .value {
    color: rgba(0, 255, 204, 1);
    font-weight: 700;
}

/* Options Cost Container */
#booking-options-cost-container {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    margin: 0.5rem 0;

    border-radius: 4px;
}

#booking-options-cost-container.has-options {
    background-color: rgba(0, 255, 204, 0.1);
    border: 1px solid rgba(0, 255, 204, 0.2);
    padding: 0.75rem 1rem;
    margin: 0.75rem 0;

}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.form-actions button {
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;

    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-actions .secondary-button {
    background-color: transparent;
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.form-actions .secondary-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.form-actions .primary-button {
    background-color: rgba(0, 255, 204, 0.9);
    color: rgba(0, 0, 0, 0.9);
    border: none;
    flex-grow: 1;
    max-width: 200px;
    position: relative;
    overflow: hidden;
}

.form-actions .primary-button:hover {
    background-color: rgba(0, 255, 204, 1);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 204, 0.3);
}

.form-actions .primary-button::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(90deg, rgba(0, 255, 204, 0.1), rgba(108, 99, 255, 0.1));
}

.form-actions .primary-button:hover::after {
    background: linear-gradient(90deg, rgba(0, 255, 204, 0.2), rgba(108, 99, 255, 0.2));
}



/* Location Display */
.location-display {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(18, 18, 24, 0.6);
    border: 1px solid rgba(0, 255, 204, 0.3);
    border-radius: 5px;
    color: #fff;
    margin-bottom: 0.5rem;
}

.location-display i {
    color: var(--primary, #00ffcc);
    margin-right: 0.75rem;
    font-size: 1.2rem;
}

.location-display span {
    font-weight: 500;
}

.location-note {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.25rem;
}

.location-note i {
    color: var(--primary, #00ffcc);
    margin-right: 0.5rem;
}

/* Booking Confirmation */
.booking-confirmation-modal {
    background-color: rgba(0, 0, 0, 0.9);
}

.booking-confirmation {
    max-width: 600px;
    padding: 0;
    border-radius: 10px;
    overflow: hidden;
}

.booking-confirmation-header {
    background-color: var(--primary, #00ffcc);
    color: var(--dark, #121212);
    padding: 2rem;
    text-align: center;
}

.success-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.booking-confirmation-header h2 {
    margin: 0;
    font-size: 1.8rem;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .booking-vehicle-info {
        flex-direction: column;
    }
    
    .booking-vehicle-image-container {
        width: 100%;
        flex: 0 0 auto;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}
