/**
 * Styles pour la vue mensuelle du calendrier
 */

/* ==========================================================================
   VUE MENSUELLE - CONTAINER
   ========================================================================== */

.calendrier-month-view {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ==========================================================================
   GRILLE DU MOIS
   ========================================================================== */

.calendrier-month-grid {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* En-têtes des jours de la semaine */
.month-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--wp--preset--color--bleu-sombre);
    color: white;
    font-weight: normal;
    text-align: center;
}


.month-header-day {
    padding: 15px 10px;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.month-header-day:last-child {
    border-right: none;
}

/* Grille des jours */
.month-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    min-height: 600px;
}

/* ==========================================================================
   CELLULE JOUR
   ========================================================================== */

.month-day {
    min-height: 120px;
    padding: 8px;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-left: none;
    background: #fff;
    position: relative;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.month-day:nth-child(7n) {
    border-right: none;
}

.month-day:hover {
    background: #f9fafb;
    box-shadow: inset 0 0 0 2px #667eea;
    z-index: 1;
}

/* Jour du mois actuel */
.month-day:not(.other-month) {
    background: #fff;
}

/* Jours d'autres mois */
.month-day.other-month {
    background: #f9fafb;
    opacity: 0.5;
}

.month-day.other-month .month-day-number {
    color: #9ca3af;
}

/* Aujourd'hui */
.month-day.is-today {
    background: #eff6ff;
    border-color: #3b82f6;
}

.month-day.is-today .month-day-number {
    background: #3b82f6;
    color: white;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
}

/* Jours passés */
.month-day.is-past:not(.is-today) {
    opacity: 0.7;
}

/* Jours avec événements */
.month-day.has-events {
background: #f5f5f5;
}

.month-day.has-events:hover {
    background: #fef9c3;
}

/* ==========================================================================
   NUMÉRO DU JOUR
   ========================================================================== */

.month-day-number {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 6px;
    line-height: 1;
}

/* ==========================================================================
   ÉVÉNEMENTS DANS LA CELLULE
   ========================================================================== */

.month-day-events {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.month-event-item {
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 11px;
    line-height: 1.3;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid;
    display: flex;
    gap: 4px;
    align-items: flex-start;
}

.month-event-item:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Types d'événements */
.month-event-item.atelier-event {
    background: #dbeafe;
    border-left-color: #3b82f6;
    color: #1e40af;
}

.event-card {
    margin-bottom: 10px;
    padding: 12px 6px;
    background: #f9f9f9;
    border: 4px solid transparent;
    border-left-color: #667eea;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
}

/* Variables de couleurs par âge */
.age-adultes {
    --color-primary: rgba(128, 125, 208, 1);
    --color-bg: rgba(219, 218, 241, 1);
}

.age-0-6-ans {
    --color-primary: rgba(0, 155, 206, 1);
    --color-bg: rgba(204, 242, 255, 1);
}

.age-6-12-ans {
    --color-primary: rgba(60, 177, 125, 1);
    --color-bg: rgba(192, 233, 212, 1);
}

.age-12-18-ans {
    --color-primary: rgba(251, 162, 185, 1);
    --color-bg: rgba(255, 226, 224, 1);
}

.age-en-duo-en-famille {
    --color-primary: rgba(119, 160, 238, 1);
    --color-bg: rgba(191, 211, 247, 1);
}

/* Application des styles avec les variables */
.month-event-item[class*="age-"] {
    border-left-color: var(--color-primary);
    background-color: var(--color-bg);
}






.month-event-item.evenement-event {
    background: #FFEABB;
    border-left-color: #FAAB00;
    color: #000;
}

/* Heure de l'événement */
.month-event-time {
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Titre de l'événement */
.month-event-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.month-event-title a {
    color: inherit;
    text-decoration: none;
}

.month-event-title a:hover {
    text-decoration: underline;
}

/* Indicateur "X autres événements" */
.month-event-more {
    padding: 4px 6px;
    text-align: center;
    font-size: 10px;
    color: #6b7280;
    font-weight: 600;
    background: #f3f4f6;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.month-event-more:hover {
    background: #e5e7eb;
    color: #374151;
}

/* ==========================================================================
   TOOLTIP ÉVÉNEMENT
   ========================================================================== */

.month-event-tooltip {
    position: absolute;
    background: #1f2937;
    color: white;
    padding: 12px 16px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    min-width: 200px;
    max-width: 300px;
    pointer-events: none;
}

.month-event-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #1f2937;
}

.tooltip-time {
    font-size: 12px;
    font-weight: 700;
    color: #fbbf24;
    margin-bottom: 4px;
}

.tooltip-title {
    font-size: 14px;
    line-height: 1.4;
}

/* ==========================================================================
   LÉGENDE
   ========================================================================== */

.calendrier-legend {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 6px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #4b5563;
}

.legend-color {
    width: 20px;
    height: 12px;
    border-radius: 3px;
}

.legend-label {
    color:var(--wp--preset--color--bg-creme-pale);
    padding: 2px 6px;
    border-radius: 2px;
    font-size: 11px;
    font-family: var(--wp--preset--font-family--sora);
}

.legend-color.atelier-event {
    background: #dbeafe;
}

.legend-label[class*="age-"] {
    background-color: var(--color-primary);
}

.legend-label.evenement {
    background-color: #FAAB00;
}



/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

/* Tablettes */
@media (max-width: 1024px) {
    .month-header-day {
        font-size: 12px;
        padding: 12px 5px;
    }
    
    .month-day {
        min-height: 100px;
        padding: 6px;
    }
    
    .month-event-item {
        font-size: 10px;
        padding: 3px 5px;
    }
}

/* Mobiles */
@media (max-width: 768px) {
    .calendrier-month-view {
        padding: 10px;
    }
    
    .month-header-day {
        font-size: 11px;
        padding: 10px 3px;
    }
    
    /* Afficher seulement les 3 premières lettres sur mobile */
    .month-header-day::after {
        content: attr(data-short);
    }
    
    .month-day {
        min-height: 80px;
        padding: 4px;
    }
    
    .month-day-number {
        font-size: 14px;
    }
    
    .month-event-item {
        font-size: 9px;
        padding: 2px 4px;
        gap: 2px;
    }
    
    .month-event-time {
        display: none; /* Cacher l'heure sur mobile pour gagner de l'espace */
    }
    
    .month-days-grid {
        min-height: 400px;
    }
    
    .calendrier-legend {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
}

/* Très petits écrans */
@media (max-width: 480px) {
    .month-day {
        min-height: 60px;
    }
    
    .month-event-item {
        font-size: 8px;
        border-left-width: 2px;
    }
    
    .month-event-more {
        font-size: 8px;
        padding: 2px 4px;
    }
}

/* ==========================================================================
   PRINT
   ========================================================================== */

@media print {
    .calendrier-navigation,
    .calendrier-legend {
        display: none;
    }
    
    .month-day {
        page-break-inside: avoid;
    }
    
    .calendrier-month-grid {
        box-shadow: none;
    }
}