/* Booking System Styles */

/* CSS Variables for consistent sizing */
:root {
    --calendar-min-width: 340px;
    --calendar-max-width: 400px;
}

.itron-booking-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.itron-booking-container h2 {
    margin-top: 0;
    margin-bottom: 30px;
    color: #333;
    font-size: 28px;
    text-align: center;
}

.booking-form {
    display: block;
}

.booking-form-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* Date selection section - two columns: calendar on left, time slots on right */
.booking-datetime-section {
    grid-template-columns: 1fr;
}

/* Date and time selection wrapper */
.booking-datetime-wrapper {
    display: grid;
    grid-template-columns: minmax(var(--calendar-min-width), var(--calendar-max-width)) 1fr;
    gap: 20px;
    min-height: 400px;
}

/* Calendar Month Navigation - combines month name and nav buttons */
.booking-calendar-month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 8px;
}

.dates-nav-btn {
    background: transparent;
    color: #3498db;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    transition: color 0.2s, background 0.2s;
    flex: 0 0 auto;
}

.dates-nav-btn:hover {
    color: #2980b9;
    background: rgba(52, 152, 219, 0.1);
}

/* Calendar Container - Left Side */
.booking-calendar-container {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    min-width: var(--calendar-min-width);
    max-width: var(--calendar-max-width);
}

/* Calendar Month/Year Display */
.booking-calendar-month {
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    flex: 1;
}

/* Calendar Day Headers (Mon, Tue, Wed, etc.) */
.booking-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.booking-calendar-weekday {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #7f8c8d;
    padding: 4px 0;
}

/* Date Cards Container - Calendar grid 7 columns */
.booking-dates-container {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    max-height: 320px;
    overflow-y: auto;
    overflow-x: hidden;
}

.dates-loading,
.dates-empty,
.dates-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

/* Date Card - Calendar cell */
.date-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 6px 4px;
    transition: all 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    aspect-ratio: 1;
}

.date-card.date-card-available {
    background: #e8f4f8;
    border-color: #3498db;
    font-weight: 600;
}

.date-card.date-card-unavailable {
    background: #f5f5f5;
    color: #bdc3c7;
    cursor: not-allowed;
    opacity: 0.5;
}

.date-card.date-card-placeholder {
    background: transparent;
    border: none;
    cursor: default;
    opacity: 0;
    pointer-events: none;
}

.date-card.date-card-available:hover {
    background: #d4ebf7;
    border-color: #2980b9;
}

.date-card.date-card-unavailable:hover {
    transform: none;
}

.date-card-selected {
    border-color: #27ae60 !important;
    background: #d5f4e6 !important;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3) !important;
}

/* Date Card Content */
.date-number {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1;
}

.date-card.date-card-unavailable .date-number {
    color: #bdc3c7;
}

/* Time Slots Container - Right Side */
.booking-timeslots-container {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.booking-timeslots-header {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #dee2e6;
}

.booking-timeslots-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.booking-timeslots-date {
    font-size: 14px;
    color: #7f8c8d;
}

.booking-timeslots-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 5px;
}

.booking-timeslot {
    background: #fff;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    padding: 12px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #495057;
    transition: all 0.2s;
    cursor: pointer;
    user-select: none;
}

.booking-timeslot:hover {
    background: #e3f2fd;
    border-color: #3498db;
    color: #2980b9;
}

.booking-timeslot.slot-selected {
    background: #27ae60;
    border-color: #229954;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.4);
}

.booking-timeslot.slot-inactive {
    background: #f5f5f5;
    border-color: #dee2e6;
    color: #bdc3c7;
    cursor: not-allowed;
    opacity: 0.6;
}

.booking-timeslot.slot-inactive:hover {
    background: #f5f5f5;
    border-color: #dee2e6;
    color: #bdc3c7;
    transform: none;
    box-shadow: none;
}

.booking-timeslots-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
    font-size: 14px;
}

/* Vehicle Category Buttons - small squares in a row */
.vehicle-category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.vehicle-category-btn {
    background: #fff;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    padding: 5px;
    min-width: 30px;
    min-height: 30px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    transition: all 0.2s;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vehicle-category-btn:hover {
    background: #e3f2fd;
    border-color: #3498db;
    color: #2980b9;
}

.vehicle-category-btn.category-selected {
    background: #27ae60;
    border-color: #229954;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.4);
}

.booking-form-group {
    display: flex;
    flex-direction: column;
}

.booking-form-group label {
    margin-bottom: 8px;
    color: #555;
    font-weight: 600;
    font-size: 14px;
}

.booking-form-group .required {
    color: #e74c3c;
}

.booking-form-group input,
.booking-form-group select {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.booking-form-group input:focus,
.booking-form-group select:focus {
    outline: none;
    border-color: #3498db;
}

.booking-form-group input:disabled,
.booking-form-group select:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.booking-form-actions {
    text-align: center;
    margin-top: 30px;
}

.booking-submit-btn {
    padding: 15px 40px;
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.booking-submit-btn:hover {
    background: #2980b9;
}

.booking-submit-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

.booking-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
    font-size: 16px;
}

.booking-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.booking-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive */
@media (max-width: 768px) {
    .itron-booking-container {
        padding: 15px;
    }
    
    .booking-form-section {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .itron-booking-container h2 {
        font-size: 24px;
    }
    
    /* Stack calendar and time slots vertically on mobile */
    .booking-datetime-wrapper {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .booking-calendar-container {
        max-width: 100%;
    }
    
    .booking-dates-container {
        max-height: 280px;
    }
    
    .date-number {
        font-size: 12px;
    }
    
    .date-card {
        min-height: 35px;
        padding: 4px 2px;
    }
    
    .booking-calendar-weekday {
        font-size: 10px;
    }
    
    .booking-timeslots-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
        max-height: 250px;
    }
    
    .booking-timeslot {
        font-size: 14px;
        padding: 10px;
    }
}
