/*
 * Planning public des créneaux (/planning).
 *
 * Chaque jour se subdivise en une sous-colonne par gymnase : l'en-tête tient
 * donc sur deux lignes, et la table peut monter à une douzaine de colonnes —
 * d'où le conteneur à défilement horizontal.
 */

.planning-filtres {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.planning-filtres .filtre-label {
    font-size: 13px;
    font-weight: 600;
    color: #6c757d;
    margin-right: 4px;
}

.planning-filtres a {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    background: #ffffff;
    color: #495057;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.planning-filtres a:hover {
    border-color: var(--colorPrincipal);
    color: var(--colorPrincipal);
}

.planning-filtres a.is-actif {
    background: linear-gradient(45deg, var(--colorPrincipal), #000000);
    border-color: transparent;
    color: #ffffff;
}

.schedule-wrapper {
    width: 100%;
    overflow-x: auto;
}

.schedule-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    font-size: 14px;
}

.schedule-table th {
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
    color: #495057;
    font-weight: 600;
    padding: 15px 8px;
    text-align: center;
    border-bottom: 2px solid #dee2e6;
}

.schedule-table th.horaires {
    background: linear-gradient(45deg, rgb(234, 102, 102), rgb(0, 0, 0));
    color: white;
    width: 100px;
    font-size: 12px;
}

.schedule-table th.jour {
    border-bottom: 1px solid #dee2e6;
    padding: 12px 8px;
}

.schedule-table th.gymnase {
    background: #f1f3f5;
    color: #6c757d;
    font-size: 11px;
    font-weight: 500;
    padding: 8px 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.schedule-table td {
    border: 1px solid #e9ecef;
    height: 50px;
    vertical-align: middle;
    padding: 5px;
    position: relative;
    transition: all 0.2s ease;
}

.schedule-table td.horaire {
    background: linear-gradient(45deg, #f8f9fa, #ffffff);
    font-weight: 600;
    text-align: center;
    color: #6c757d;
    font-size: 11px;
    width: 100px;
}

.schedule-table td.vide:hover {
    background: linear-gradient(45deg, #e3f2fd, #f3e5f5);
    cursor: pointer;
}

/* Séparation nette entre deux jours, une fois les sous-colonnes en place. */
.schedule-table th.fin-jour,
.schedule-table td.fin-jour {
    border-right: 2px solid #adb5bd;
}

.occupied {
    background: linear-gradient(45deg, var(--colorPrincipal), #feca57);
    color: white !important;
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* Liseré de salle : la même couleur suit un gymnase d'un jour à l'autre. */
.occupied.gym-0 {
    border-left: 4px solid #4dabf7;
}

.occupied.gym-1 {
    border-left: 4px solid #ffd43b;
}

.occupied.gym-2 {
    border-left: 4px solid #69db7c;
}

.occupied.gym-3 {
    border-left: 4px solid #ff8787;
}

/*
 * Le blanc est répété sur les spans : le thème sportius pose une couleur
 * directement sur span, ce qui bat l'héritage depuis .occupied.
 */
.occupied .event-type {
    display: block;
    font-weight: 600;
    color: #ffffff;
}

.occupied .event-titre {
    display: block;
    font-size: 10px;
    opacity: 0.85;
    color: #ffffff;
}

.event-info {
    position: absolute;
    top: 2px;
    right: 2px;
    color: #000000;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    padding: 1px 4px;
    font-size: 9px;
}

.stats {
    background: #f8f9fa;
    padding: 15px;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    width: 100%;
}

.stat-item {
    text-align: center;
    margin: 5px;
}

.stat-number {
    font-size: 24px;
    font-weight: bold;
    color: var(--colorPrincipal);
}

.stat-label {
    font-size: 12px;
    color: #6c757d;
}

/* Styles pour la version mobile */
.mobile-schedule {
    display: none;
    width: 100%;
}

.day-schedule {
    margin-bottom: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.day-title {
    background: linear-gradient(45deg, var(--colorPrincipal), #000000);
    color: white;
    margin: 0;
    padding: 15px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
}

.gymnase-title {
    margin: 10px 10px 6px;
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.events-list {
    padding: 10px;
}

.event-card {
    background: linear-gradient(45deg, #000000, var(--colorPrincipal));
    color: white !important;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.event-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.event-card:last-child {
    margin-bottom: 0;
}

.event-time {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #ffffff;
}

.event-details {
    font-size: 13px;
    line-height: 1.4;
}

.no-events {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-style: italic;
    background: #ffffff;
    margin: 10px;
    border-radius: 4px;
    border: 1px dashed #dee2e6;
}

@media (max-width: 768px) {
    .desktop-schedule {
        display: none;
    }

    .mobile-schedule {
        display: block;
    }

    .day-schedule {
        margin-bottom: 15px;
    }

    .day-title {
        padding: 12px;
        font-size: 16px;
    }

    .event-card {
        padding: 10px;
        margin-bottom: 8px;
    }

    .event-time {
        font-size: 13px;
    }

    .event-details {
        font-size: 12px;
    }

    .stats {
        flex-direction: column;
        align-items: center;
    }

    .stat-item {
        margin: 3px 0;
    }
}

@media (max-width: 480px) {
    .day-title {
        font-size: 15px;
        padding: 10px;
    }

    .event-card {
        padding: 8px;
    }

    .event-time {
        font-size: 12px;
        margin-bottom: 3px;
    }

    .event-details {
        font-size: 11px;
    }
}
