/**
 * Recital Calendar Styles
 * Design cohérent avec la charte graphique du site
 */

.recital-calendar {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    max-width: 400px;
    margin: 0 auto;
}

/* Header avec navigation */
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.calendar-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.35rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    border-radius: 8px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s ease;
}

.calendar-nav:hover {
    background: #722F37; /* burgundy */
    color: white;
}

.calendar-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Jours de la semaine */
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 0.5rem;
}

.calendar-weekdays span {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.5rem 0;
}

/* Grille des jours */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    transition: opacity 0.2s ease;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    background: transparent;
}

.calendar-day.empty {
    background: transparent;
    cursor: default;
}

/* États des jours */
.calendar-day.status-available {
    background: #E8F5E9;
    color: #2E7D32;
}

.calendar-day.status-available:hover:not(.disabled) {
    background: #4CAF50;
    color: white;
    transform: scale(1.05);
}

.calendar-day.status-option {
    background: #FFF3E0;
    color: #E65100;
}

.calendar-day.status-option:hover:not(.disabled) {
    background: #FF9800;
    color: white;
    transform: scale(1.05);
}

/* Confirmed: jour avec événement confirmé mais encore réservable */
.calendar-day.status-confirmed {
    background: #E8F5E9;
    color: #1B5E20;
    border: 2px solid #4CAF50;
}

.calendar-day.status-confirmed:hover:not(.disabled) {
    background: #C8E6C9;
    transform: scale(1.05);
}

.calendar-day.status-confirmed::before {
    content: '✓';
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 0.6rem;
    color: #4CAF50;
    font-weight: bold;
}

.calendar-day.status-full,
.calendar-day.status-blocked {
    background: #F5F5F5;
    color: #9E9E9E;
    cursor: not-allowed;
}

.calendar-day.status-blocked {
    background: repeating-linear-gradient(
        45deg,
        #f5f5f5,
        #f5f5f5 4px,
        #e8e8e8 4px,
        #e8e8e8 8px
    );
}

/* Buffer: J-1 / J+1 d'un concert étranger */
.calendar-day.status-buffer {
    background: #E3F2FD;
    color: #1565C0;
    border: 2px dashed #64B5F6;
}

.calendar-day.status-buffer:hover:not(.disabled) {
    background: #BBDEFB;
    transform: scale(1.05);
}

.calendar-day.status-buffer::after {
    content: '✈';
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 0.6rem;
    opacity: 0.7;
}

/* Jour passé */
.calendar-day.past {
    background: #fafafa;
    color: #ccc;
    cursor: not-allowed;
}

/* Aujourd'hui */
.calendar-day.today {
    box-shadow: inset 0 0 0 2px #C9A227; /* gold */
}

/* Sélectionné */
.calendar-day.selected {
    background: #722F37 !important; /* burgundy */
    color: white !important;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(114, 47, 55, 0.3);
}

/* Disabled */
.calendar-day.disabled {
    pointer-events: none;
}

/* Loading */
.calendar-loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    color: #666;
    font-size: 0.875rem;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #f0f0f0;
    border-top-color: #722F37;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Légende */
.calendar-legend {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: #666;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 4px;
}

.legend-dot.available {
    background: #4CAF50;
}

.legend-dot.confirmed {
    background: #E8F5E9;
    border: 2px solid #4CAF50;
}

.legend-dot.option {
    background: #FF9800;
}

.legend-dot.full {
    background: #9E9E9E;
}

.legend-dot.buffer {
    background: #64B5F6;
    border: 1px dashed #1565C0;
}

/* Message contextuel */
.calendar-message {
    display: none;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
}

.calendar-message.info {
    background: #E3F2FD;
    color: #1565C0;
    border-left: 3px solid #1565C0;
}

.calendar-message.warning {
    background: #FFF3E0;
    color: #E65100;
    border-left: 3px solid #FF9800;
}

.calendar-message.error {
    background: #FFEBEE;
    color: #C62828;
    border-left: 3px solid #C62828;
}

.calendar-message.success {
    background: #E8F5E9;
    color: #2E7D32;
    border-left: 3px solid #2E7D32;
}

/* Responsive */
@media (max-width: 480px) {
    .recital-calendar {
        padding: 1rem;
        border-radius: 8px;
    }
    
    .calendar-title {
        font-size: 1.1rem;
    }
    
    .calendar-day {
        font-size: 0.8rem;
    }
    
    .calendar-legend {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .recital-calendar {
        background: #1e1e1e;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
    
    .calendar-title {
        color: #f0f0f0;
    }
    
    .calendar-header {
        border-bottom-color: #333;
    }
    
    .calendar-nav {
        background: #333;
        color: #ccc;
    }
    
    .calendar-weekdays span {
        color: #888;
    }
    
    .calendar-legend {
        border-top-color: #333;
    }
    
    .legend-item {
        color: #aaa;
    }
}
