/**
 * Calendrier Disponibilités - Frontend Styles
 */

.caldispo-calendar-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Header avec navigation */
.caldispo-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.caldispo-year-title {
    font-size: 28px;
    font-weight: 700;
    color: #1d2327;
    margin: 0;
    min-width: 120px;
    text-align: center;
}

.caldispo-nav-btn {
    background: #f0f0f1;
    border: 1px solid #ccd0d4;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #50575e;
}

.caldispo-nav-btn:hover {
    background: #e0e0e0;
    border-color: #999;
    color: #1d2327;
}

.caldispo-nav-btn:active {
    transform: scale(0.95);
}

/* Grille des mois */
.caldispo-calendar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

/* Chaque mois */
.caldispo-month {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.caldispo-month-title {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* Grille du mois (7 colonnes) */
.caldispo-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

/* En-têtes des jours */
.caldispo-day-header {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    padding: 5px 0;
    text-transform: uppercase;
}

/* Cellules des jours */
.caldispo-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    border-radius: 4px;
    position: relative;
    background: #fff;
    transition: background-color 0.2s;
}

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

/* Jour vide */
.caldispo-day-empty {
    background: transparent;
}

/* Jour passé (grisé) */
.caldispo-day-past {
    background: #f5f5f5;
    color: #aaa;
}

/* Jour indisponible - motif diagonal rouge */
.caldispo-day-unavailable {
    background: 
        linear-gradient(
            135deg,
            transparent 40%,
            #e53935 40%,
            #e53935 100%
        );
    color: #333;
}

.caldispo-day-unavailable .caldispo-day-number {
    color: #333;
    font-weight: 500;
}

/* Jour passé ET indisponible */
.caldispo-day-past.caldispo-day-unavailable {
    background: 
        linear-gradient(
            135deg,
            #f5f5f5 40%,
            #e57373 40%,
            #e57373 100%
        );
    color: #999;
}

.caldispo-day-past.caldispo-day-unavailable .caldispo-day-number {
    color: #999;
}

/* Aujourd'hui */
.caldispo-day-today {
    font-weight: 700;
}

.caldispo-day-today:not(.caldispo-day-unavailable) {
    background: #e3f2fd;
    border: 2px solid #1976d2;
}

/* Légende */
.caldispo-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.caldispo-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #555;
}

.caldispo-legend-box {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.caldispo-legend-unavailable {
    background: 
        linear-gradient(
            135deg,
            transparent 40%,
            #e53935 40%,
            #e53935 100%
        );
}

.caldispo-legend-past {
    background: #f5f5f5;
}

.caldispo-legend-available {
    background: #fff;
}

/* Loading state */
.caldispo-calendar-wrapper.caldispo-loading .caldispo-calendar-grid {
    opacity: 0.5;
    pointer-events: none;
}

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

/* Tablette paysage et desktop moyen */
@media screen and (max-width: 1200px) {
    .caldispo-calendar-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

/* Tablette portrait */
@media screen and (max-width: 900px) {
    .caldispo-calendar-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .caldispo-month {
        padding: 12px;
    }
    
    .caldispo-month-title {
        font-size: 15px;
    }
    
    .caldispo-day {
        font-size: 12px;
    }
    
    .caldispo-day-header {
        font-size: 10px;
    }
}

/* Mobile paysage */
@media screen and (max-width: 650px) {
    .caldispo-header {
        margin-bottom: 20px;
    }
    
    .caldispo-year-title {
        font-size: 24px;
    }
    
    .caldispo-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .caldispo-calendar-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .caldispo-month {
        padding: 10px;
    }
    
    .caldispo-month-title {
        font-size: 14px;
        margin-bottom: 10px;
        padding-bottom: 8px;
    }
    
    .caldispo-legend {
        flex-wrap: wrap;
        gap: 15px;
        padding: 15px;
    }
    
    .caldispo-legend-item {
        font-size: 13px;
    }
    
    .caldispo-legend-box {
        width: 24px;
        height: 24px;
    }
}

/* Mobile portrait */
@media screen and (max-width: 480px) {
    .caldispo-calendar-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .caldispo-month {
        padding: 15px;
    }
    
    .caldispo-month-title {
        font-size: 16px;
    }
    
    .caldispo-day {
        font-size: 14px;
    }
    
    .caldispo-day-header {
        font-size: 11px;
    }
    
    .caldispo-month-grid {
        gap: 3px;
    }
    
    .caldispo-legend {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* Très petit écran */
@media screen and (max-width: 360px) {
    .caldispo-header {
        gap: 10px;
    }
    
    .caldispo-year-title {
        font-size: 20px;
        min-width: 80px;
    }
    
    .caldispo-nav-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
}
