/* ============================================
   STYLES CALENDRIER DE RÉSERVATION
   Calendrier dynamique avec disponibilités en temps réel
   ============================================ */

/* Container principal */
#video-calendar-dynamic {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #eee;
    min-height: 400px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Header du calendrier */
.calendar-header {
    margin-bottom: 20px;
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
}

.nav-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--accent-color, #C5A879);
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover:not(.disabled) {
    background-color: rgba(197, 168, 121, 0.1);
}

.nav-btn.disabled {
    color: #ccc;
    cursor: not-allowed;
}

.current-month-year {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color, #0A192F);
    min-width: 200px;
    text-align: center;
}

/* Grille des jours */
.calendar-days {
    display: grid;
    gap: 10px;
    margin-top: 20px;
    width: 100%;
    box-sizing: border-box;
}

.calendar-day {
    background-color: #fff;
    border: 2px solid #eee;
    border-radius: 10px;
    padding: 12px 8px;
    transition: all 0.3s ease;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: visible;
    width: 100%;
    box-sizing: border-box;
    }

.calendar-day .day-name,
.calendar-day .day-number {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

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

.calendar-day:not(.empty):not(.no-availability) {
    cursor: pointer;
}

.calendar-day:not(.empty):not(.no-availability):hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    border-color: var(--accent-color, #C5A879);
}

.calendar-day.today {
    background: linear-gradient(135deg, #0A192F 0%, #1a365d 100%);
    color: white;
    border-color: #0A192F;
}

.calendar-day.today .slots-indicator {
    color: #10B981;
    background: #D1FAE5;
}

.calendar-day.today .day-number {
    color: #10B981;
}

.calendar-day.today .day-name {
    color: #10B981;
}

.calendar-day.next-month {
    background-color: #f5f5f5;
    opacity: 0.7;
}

.calendar-day.no-availability {
    background-color: #f8f8f8;
    opacity: 0.6;
    cursor: not-allowed;
}

.day-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    width: 100%;
    overflow: hidden;
}

.day-name {
    font-size: 0.85rem;
    color: #6B7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    text-align: center;
}

.day-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color, #0A192F);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    text-align: center;
}

.slots-indicator {
    font-size: 9px;
    color: #10B981;
    font-weight: 600;
    background: #D1FAE5;
    padding: 4px 6px;
    border-radius: 4px;
    text-align: center;
    margin-top: 5px;
    overflow: visible;
    white-space: nowrap;
    width: 100%;
    box-sizing: border-box;
    line-height: 1.2;
    min-height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-slots {
    font-size: 0.6rem;
    color: #DC2626;
    font-weight: 600;
    background: #FEE2E2;
    padding: 3px 4px;
    border-radius: 4px;
    text-align: center;
    margin-top: 5px;
    overflow: visible;
    white-space: normal;
    width: 100%;
    box-sizing: border-box;
    line-height: 1.2;
    min-height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Vue des créneaux horaires */
.time-slots-header {
    margin-bottom: 20px;
}

.back-btn {
    background: transparent;
    border: 2px solid var(--primary-color, #0A192F);
    color: var(--primary-color, #0A192F);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.back-btn:hover {
    background: var(--primary-color, #0A192F);
    color: white;
}

.selected-day-header {
    text-align: center;
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--primary-color, #0A192F);
    padding: 20px;
    background: linear-gradient(135deg, rgba(197, 168, 121, 0.1) 0%, rgba(197, 168, 121, 0.05) 100%);
    border-radius: 10px;
    border: 2px solid var(--accent-color, #C5A879);
    text-transform: capitalize;
}

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

.time-slot {
    background-color: #fff;
    border: 2px solid #E5E7EB;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--primary-color, #0A192F);
    line-height: 1.3;
    }

.time-slot:hover {
    background: linear-gradient(135deg, var(--accent-color, #C5A879) 0%, #D4B896 100%);
    color: white;
    border-color: var(--accent-color, #C5A879);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(197, 168, 121, 0.3);
}

.time-slot.selected {
    background: linear-gradient(135deg, #0A192F 0%, #1a365d 100%);
    color: white;
    border-color: #0A192F;
    box-shadow: 0 4px 16px rgba(10, 25, 47, 0.4);
}

/* États de chargement et d'erreur */
.calendar-loading,
.calendar-error {
    text-align: center;
    padding: 60px 20px;
    color: #6B7280;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--accent-color, #C5A879);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.calendar-error {
    background: #FEE2E2;
    border-radius: 10px;
    border: 2px solid #DC2626;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.retry-btn {
    background: #DC2626;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background: #B91C1C;
    transform: translateY(-2px);
}

/* Message de succès amélioré */
.success-message {
    display: none;
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
    border: 2px solid #10B981;
    border-radius: 12px;
    padding: 30px;
    margin-top: 20px;
    text-align: center;
    animation: slideInUp 0.5s ease-out;
}

.success-message.show {
    display: block;
}

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

/* Responsive */
@media (max-width: 768px) {
    #video-calendar-dynamic {
        padding: 15px;
        min-height: 350px;
    }

    .calendar-days {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px;
    }

    .calendar-day {
        min-height: 70px;
        padding: 8px;
    }

    .day-number {
        font-size: 1.1rem;
    }

    .day-name {
        font-size: 0.7rem;
    }

    .slots-indicator,
    .no-slots {
        font-size: 9px;
        padding: 3px 6px;
    }

    .time-slots-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .time-slot {
        padding: 12px 6px;
        font-size: 0.85rem;
    }

    .current-month-year {
        font-size: 1rem;
        min-width: 150px;
    }

    .nav-btn {
        font-size: 1.2rem;
        min-width: 35px;
        height: 35px;
    }

    .selected-day-header {
        font-size: 1rem;
        padding: 15px;
    }

    .back-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
        width: 100%;
        text-align: center;
    }

    .calendar-nav {
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .slots-indicator,
    .no-slots {
        font-size: 9px;
        padding: 2px 3px;
        white-space: nowrap;
        overflow: visible;
    }

    .time-slots-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .time-slot {
        padding: 14px 8px;
        font-size: 0.8rem;
    }

    .current-month-year {
        font-size: 0.9rem;
        min-width: 120px;
    }

    .nav-btn {
        font-size: 1rem;
        min-width: 32px;
        height: 32px;
        padding: 4px 8px;
    }

    .selected-day-header {
        font-size: 0.95rem;
        padding: 12px;
    }

    .calendar-nav {
        gap: 10px;
        margin-bottom: 10px;
    }

    .calendar-header {
        margin-bottom: 15px;
    }

    .calendar-loading,
    .calendar-error {
        padding: 40px 15px;
        font-size: 0.9rem;
    }

    .spinner {
        width: 40px;
        height: 40px;
    }
}

/* Variables CSS personnalisables */
:root {
    --primary-color: #0A192F;
    --accent-color: #C5A879;
    --success-color: #10B981;
    --error-color: #DC2626;
    --bg-color: #f9f9f9;
}

/* iPhone SE et écrans très petits */

    
    .calendar-day {
        min-height: 48px;
        padding: 4px 2px;
    }
}

