/**
 * Service Booking Calendar Styles
 * Interactive calendar for students to book sessions
 *
 * @package EduBooking_Pro
 * @version 2.4.0
 */

/* ==========================================================================
   Calendar Container
   ========================================================================== */

.ebp-booking-calendar {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
}

/* ==========================================================================
   Calendar Header
   ========================================================================== */

.ebp-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f1f5f9;
}

.ebp-calendar-month {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
}

.ebp-calendar-nav {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.ebp-calendar-nav:hover {
    background: #667eea;
    border-color: #667eea;
    color: #ffffff;
}

.ebp-calendar-nav .dashicons {
    width: 20px;
    height: 20px;
    font-size: 20px;
}

/* ==========================================================================
   Calendar Grid
   ========================================================================== */

.ebp-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

.ebp-weekday {
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    padding: 8px 0;
}

.ebp-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    position: relative;
}

.ebp-calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    position: relative;
    transition: all 0.2s ease;
}

.ebp-calendar-day.empty {
    visibility: hidden;
}

.ebp-calendar-day.past {
    color: #cbd5e1;
    cursor: not-allowed;
}

.ebp-calendar-day.no-availability {
    background: #f8fafc;
    color: #94a3b8;
    cursor: not-allowed;
}

.ebp-calendar-day.has-availability {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    color: #4f46e5;
    cursor: pointer;
    border: 2px solid transparent;
}

.ebp-calendar-day.has-availability:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.ebp-calendar-day.today {
    border: 2px solid #667eea;
}

.ebp-calendar-day.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.ebp-day-number {
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   Time Slots
   ========================================================================== */

.ebp-time-slots-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
    animation: slideDown 0.3s ease;
}

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

.ebp-time-slots-container h4 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.ebp-selected-date {
    color: #667eea;
}

.ebp-time-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.ebp-time-slot {
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #475569;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ebp-time-slot.available:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.ebp-time-slot.unavailable {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
    text-decoration: line-through;
    opacity: 0.6;
}

.ebp-time-slot.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: #ffffff;
}

/* ==========================================================================
   Booking Summary
   ========================================================================== */

.ebp-booking-summary {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border-radius: 12px;
    padding: 24px;
    border: 2px solid #c7d2fe;
    animation: slideDown 0.3s ease;
}

.ebp-booking-summary h4 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 700;
    color: #312e81;
}

.ebp-summary-details {
    margin-bottom: 20px;
}

.ebp-summary-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    color: #3730a3;
    font-size: 15px;
    font-weight: 600;
}

.ebp-summary-item .dashicons {
    color: #667eea;
    width: 20px;
    height: 20px;
    font-size: 20px;
}

.ebp-change-slot {
    background: #ffffff;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ebp-change-slot:hover {
    background: #667eea;
    color: #ffffff;
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.ebp-calendar-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 10;
}

.ebp-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.ebp-calendar-loading p {
    color: #64748b;
    font-size: 14px;
    margin: 0;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .ebp-booking-calendar {
        padding: 16px;
    }

    .ebp-calendar-month {
        font-size: 18px;
    }

    .ebp-calendar-nav {
        width: 36px;
        height: 36px;
    }

    .ebp-weekday {
        font-size: 12px;
        padding: 6px 0;
    }

    .ebp-calendar-days {
        gap: 4px;
    }

    .ebp-calendar-day {
        font-size: 13px;
    }

    .ebp-time-slots-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }

    .ebp-time-slot {
        padding: 12px 8px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .ebp-booking-calendar {
        padding: 12px;
    }

    .ebp-calendar-month {
        font-size: 16px;
    }

    .ebp-weekday {
        font-size: 11px;
    }

    .ebp-calendar-day {
        font-size: 12px;
    }

    .ebp-time-slots-grid {
        grid-template-columns: 1fr 1fr;
    }

    .ebp-booking-summary {
        padding: 16px;
    }
}

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .ebp-booking-calendar,
    .ebp-time-slots-container {
        background: #1e293b;
    }

    .ebp-calendar-header {
        border-bottom-color: #334155;
    }

    .ebp-calendar-month,
    .ebp-time-slots-container h4 {
        color: #f1f5f9;
    }

    .ebp-calendar-nav {
        background: #334155;
        border-color: #475569;
        color: #f1f5f9;
    }

    .ebp-calendar-nav:hover {
        background: #667eea;
        border-color: #667eea;
    }

    .ebp-weekday {
        color: #cbd5e1;
    }

    .ebp-calendar-day.no-availability {
        background: #334155;
        color: #64748b;
    }

    .ebp-calendar-day.has-availability {
        background: linear-gradient(135deg, #312e81 0%, #3730a3 100%);
        color: #dbeafe;
    }

    .ebp-time-slot {
        background: #334155;
        border-color: #475569;
        color: #cbd5e1;
    }

    .ebp-time-slot.unavailable {
        background: #1e293b;
        border-color: #334155;
        color: #64748b;
    }

    .ebp-booking-summary {
        background: linear-gradient(135deg, #312e81 0%, #3730a3 100%);
        border-color: #4f46e5;
    }

    .ebp-booking-summary h4 {
        color: #dbeafe;
    }

    .ebp-summary-item {
        color: #dbeafe;
    }

    .ebp-change-slot {
        background: #1e293b;
        color: #a5b4fc;
        border-color: #6366f1;
    }

    .ebp-change-slot:hover {
        background: #6366f1;
        color: #ffffff;
    }
}
