/* Style pour le conteneur de recherche */
.gcc-search-container {
    margin-bottom: 15px;
}

.gcc-filters-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

/* Style pour les filtres de saison */
.gcc-season-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

/* Labels pour les lignes de filtres */
.gcc-filter-label {
    font-size: 0.9em;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    gap: 5px;
}

.season-filter-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background-color: #fff;
    color: #555;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    border-radius: 20px;
    /* Style Pill */
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.season-filter-btn:hover {
    background-color: #f1f1f1;
    border-color: #ccc;
    transform: translateY(-1px);
}

/* Style de base pour le bouton actif */
.season-filter-btn.active {
    background-color: #333;
    color: #fff;
    border-color: #333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

/* --- Couleurs par saison pour les boutons actifs --- */
.season-filter-btn.season-color-0.active {
    background-color: #0073aa;
    border-color: #0073aa;
}

.season-filter-btn.season-color-1.active {
    background-color: #d54e21;
    border-color: #d54e21;
}

.season-filter-btn.season-color-2.active {
    background-color: #46b450;
    border-color: #46b450;
}

.season-filter-btn.season-color-3.active {
    background-color: #7e70af;
    border-color: #7e70af;
}

.season-filter-btn[data-season="all"].active {
    background-color: #333;
    border-color: #333;
}

.season-filter-btn.active:first-child {
    border-left-color: #ddd;
}

.season-filter-btn.active:last-child {
    border-right-color: #ddd;
}


/* Style pour le champ de recherche */
#gcc-chore-search {
    width: 100%;
    padding: 10px 12px;
    font-size: 1em;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    /* Assure que le padding n'augmente pas la largeur totale */
    transition: border-color 0.2s ease-in-out;
}

#gcc-chore-search:focus {
    border-color: #0073aa;
    /* On retire l'ombre pour un effet plus sobre */
    outline: none;
}

.gcc-chores-container {
    /* Assure une couleur de texte par défaut lisible pour tout le conteneur */
    color: #333;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    /* Suppression de la bordure et de l'overflow pour séparer les colonnes */
}

.gcc-chores-column {
    flex: 1;
    min-width: 280px;
    background-color: #f9f9f9;
    border-radius: 8px;
    padding-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* --- Couleurs de colonnes distinctes par niveau --- */
.gcc-chores-column[data-level-key="debutant"] {
    background-color: #f8faff;
}

.gcc-chores-column[data-level-key="novice"] {
    background-color: #fdf5ff;
}

.gcc-chores-column[data-level-key="intermediaire"] {
    background-color: #fffbf5;
}

.gcc-chores-column h2 {
    margin-top: 0;
    padding: 15px;
    margin-bottom: 10px;
    border-bottom: 2px solid #ccc;
    border-radius: 8px 8px 0 0;
    font-size: 1.4em;
    /* S'assure que les titres ont la bonne couleur */
    color: inherit;
    background-color: #f5f5f5;
    text-align: center;
}

/* En-têtes colorés par niveau (état par défaut, sans filtre de saison actif) */
.gcc-chores-column[data-level-key="debutant"] h2 {
    background-color: #e3f2fd;
    border-bottom-color: #90caf9;
}

.gcc-chores-column[data-level-key="novice"] h2 {
    background-color: #f3e5f5;
    border-bottom-color: #ce93d8;
}

.gcc-chores-column[data-level-key="intermediaire"] h2 {
    background-color: #fff3e0;
    border-bottom-color: #ffb74d;
}

/* Compteur dans les en-têtes */
.gcc-chore-count {
    font-weight: normal;
    font-size: 0.7em;
    opacity: 0.7;
}

/* Suppression de l'override de couleur des colonnes pour que chaque colonne garde sa couleur native */


.gcc-chores-column ul {
    list-style: none;
    padding: 0 15px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chore-item {
    padding: 12px;
    margin: 0;
    /* Margin géré par le gap du ul */
    background-color: #fff !important;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    /* On utilise flexbox pour centrer le contenu verticalement */
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.chore-item:hover {
    z-index: 99999;
}


/* --- Séparateurs alphabétiques --- */
.chore-alpha-divider {
    text-align: center;
    color: #aaa;
    font-size: 0.75em;
    font-weight: 600;
    padding: 4px 0;
    border-bottom: 1px dashed #ddd;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}


.chore-title {
    margin-bottom: 6px;
    /* On transforme le titre en conteneur flex pour aligner ses enfants */
    display: flex;
    justify-content: center;
    align-items: center;
    /* Aligne verticalement au centre pour un meilleur rendu */
    gap: 6px;
    /* Espace entre les éléments du titre */
    flex-wrap: wrap;
}

.chore-main-title {
    font-weight: bold;
    font-size: 1.1em;
}

.chore-seasons {
    /* On retire 'display: block' pour que le texte reste sur la même ligne. */
    /* On peut aussi l'alléger un peu visuellement. */
    font-size: 0.8em;
    font-weight: normal;
    color: #555;
}

/* Cache la mention de la saison quand un filtre de saison est actif */
#gcc-app-wrapper.hide-season-labels .chore-seasons {
    display: none;
}

.chore-pot-commun {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: bold;
    /* Style par défaut (quand aucune saison n'est sélectionnée) */
    background-color: transparent;
    color: #555;
    border: 1px solid #ccc;
}

/* --- Coloration du badge "Pot Commun" en fonction de sa saison (style sobre) --- */
/* La couleur est maintenant appliquée directement sur le badge, peu importe le filtre de saison */
.chore-pot-commun.pot-commun-color-0 {
    color: #005a9c;
    border-color: #99c5e3;
}

.chore-pot-commun.pot-commun-color-1 {
    color: #a93b19;
    border-color: #f2b5a1;
}

.chore-pot-commun.pot-commun-color-2 {
    color: #35873a;
    border-color: #a7d9ab;
}

.chore-pot-commun.pot-commun-color-3 {
    color: #5d5182;
    border-color: #c4bedb;
}

/* --- Boutons pills colorés (inspirés du plugin programme-cours) --- */
.chore-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
}

.chore-link-item {
    position: relative;
    z-index: 20;
}

.gc-media-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    padding: 0 8px !important;
    width: auto !important;
    min-width: 68px !important;
    height: 26px !important;
    border-radius: 5px !important;
    border: none !important;
    cursor: pointer !important;
    transition: opacity 0.15s ease, transform 0.15s ease !important;
    text-decoration: none !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15) !important;
    font-size: 11px !important;
    font-family: inherit !important;
    line-height: 1 !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.gc-media-btn:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

/* Cache de force les icônes de liens externes injectées par le thème Divi ou d'autres plugins */
.gc-media-btn:after,
.gc-media-btn::after,
.gc-media-btn::before,
.gc-media-btn> :not(.dashicons):not(img) {
    display: none !important;
}

.gc-media-btn .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    line-height: 14px;
    color: #fff !important;
}

/* Couleurs des boutons */
.chore-link-item a.gc-pdf-btn {
    background-color: #2563eb;
}

.chore-link-item a.gc-demo-btn {
    background-color: #dc2626;
}

.chore-link-item a.gc-cours-btn {
    background-color: #d97706;
}

/* --- Tooltip miniature au survol --- */
.chore-preview-tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 9999;
    padding: 4px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    pointer-events: none;
    width: max-content;
}

.chore-link-item:hover .chore-preview-tooltip {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.chore-preview-tooltip img {
    width: 200px !important;
    max-width: none !important;
    height: auto !important;
    min-height: 112px !important;
    background-color: #f5f5f5;
    border-radius: 4px;
    display: block;
}

/* Flèche du tooltip */
.chore-preview-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #fff;
}

.chore-preview-tooltip::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 7px solid transparent;
    border-top-color: #ddd;
}



.no-chores-message {
    font-style: italic;
    color: #888;
    justify-content: center;
}

/* Force la suppression des puces de liste qui pourraient apparaître sur certains navigateurs */
.gcc-chores-column li::marker {
    content: none;
}

/* Style pour la légende */
.gcc-chores-legend {
    margin-bottom: 20px;
    margin-top: 20px;
    padding: 10px 15px;
    font-size: 0.85em;
    color: #777;
    text-align: center;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.gcc-chores-legend p {
    margin: 0;
}

/* --- Onglets mobile : affichage par niveaux --- */
.gcc-mobile-tabs {
    display: none;
}

@media screen and (max-width: 768px) {

    /* Afficher les onglets mobile */
    .gcc-mobile-tabs {
        display: flex;
        border-bottom: 2px solid #ddd;
        margin-top: 20px;
        margin-bottom: 20px;
    }

    .gcc-mobile-tab {
        flex: 1;
        text-align: center;
        padding: 14px 5px;
        font-size: 1em;
        font-weight: 600;
        cursor: pointer;
        border: none;
        background: #f5f5f5;
        color: #888;
        transition: all 0.2s ease;
        border-bottom: 3px solid transparent;
    }

    .gcc-mobile-tab.active {
        color: #333;
        background: #fff;
        border-bottom-color: #0073aa;
    }

    .gcc-mobile-tab[data-level="debutant"].active {
        border-bottom-color: #2563eb;
    }

    .gcc-mobile-tab[data-level="novice"].active {
        border-bottom-color: #9333ea;
    }

    .gcc-mobile-tab[data-level="intermediaire"].active {
        border-bottom-color: #d97706;
    }

    /* Masquer les colonnes par défaut sur mobile */
    .gcc-chores-column {
        display: none;
    }

    /* Afficher uniquement la colonne active */
    .gcc-chores-column.gcc-mobile-active {
        display: block;
        width: 100%;
    }

    /* Cacher les h2 sur mobile (remplacés par les onglets) */
    .gcc-chores-column h2 {
        display: none;
    }

    /* Tooltip au survol : désactivé sur mobile */
    .chore-preview-tooltip {
        display: none !important;
        visibility: hidden !important;
    }

    /* Grossir les boutons d'action (PDF, Démo, Cours) sur mobile */
    .gc-media-btn {
        width: auto !important;
        min-width: 75px !important;
        height: 32px !important;
        font-size: 12px !important;
        padding: 0 10px !important;
        border-radius: 6px !important;
        gap: 5px !important;
    }

    .gc-media-btn .dashicons {
        font-size: 16px !important;
        width: 16px !important;
        height: 16px !important;
        line-height: 16px !important;
    }
}

.fancybox__slide.is-iframe .fancybox__content {
    padding: 0;
}

.f-button.is-close-btn {
    position: fixed !important;
    top: 5px !important;
    right: 10px !important;
    z-index: 9999 !important;
}

.fancybox__container:not(.is-compact) .fancybox__slide.has-close-btn {
    padding-top: 0px;
}

.fancybox__content {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    height: 100% !important;
    width: 800px !important;
    z-index: 1 !important;
}

.fancybox__container {
    --fancybox-bg: rgba(24, 24, 27, 0.83) !important;
    /* On force FancyBox à être au-dessus de tous les autres éléments (comme un header "sticky") */
    z-index: 99999 !important;
}

/*
 * Correction pour les appareils mobiles :
 * Décale la fenêtre FancyBox vers le bas pour qu'elle ne soit pas cachée par l'en-tête du site.
 * La valeur de 'top' et 'height' doit correspondre à la hauteur de votre en-tête.
 */
@media screen and (max-width: 782px) {
    .fancybox__container {
        top: 3% !important;
        height: 95% !important;
    }

    .fancybox__html5video,
    .fancybox__iframe {
        height: 87% !important;
        width: 100% !important;
    }
}

/* ==========================================================================
   PHASE 2 : Améliorations UI/UX (Animations, Sticky Headers, Highlight)
   ========================================================================== */

/* 10. Sticky Headers */
.gcc-chores-column h2 {
    position: sticky;
    top: 0;
    z-index: 10;
    /* On s'assure qu'il y a un fond sinon le texte passe au travers au scroll */
}

/* Déjà géré par la couleur de colonne (ex: .gcc-chores-column[data-level-key="debutant"] h2 a son fond) */

/* 11. Animations d'entrée (Fade In Up) */
.chore-item {
    animation: gcc-fade-in-up 0.4s ease forwards;
    /* On met une opacité initiale à 0 pour éviter le scintillement */
    opacity: 0;
    transform: translateY(10px);
}

/* On utilise nth-child pour créer un effet de cascade sur les premiers éléments */
.chore-item:nth-child(1) {
    animation-delay: 0.05s;
}

.chore-item:nth-child(2) {
    animation-delay: 0.1s;
}

.chore-item:nth-child(3) {
    animation-delay: 0.15s;
}

.chore-item:nth-child(4) {
    animation-delay: 0.2s;
}

.chore-item:nth-child(5) {
    animation-delay: 0.25s;
}

.chore-item:nth-child(6) {
    animation-delay: 0.3s;
}

.chore-item:nth-child(7) {
    animation-delay: 0.35s;
}

.chore-item:nth-child(8) {
    animation-delay: 0.4s;
}

.chore-item:nth-child(9) {
    animation-delay: 0.45s;
}

.chore-item:nth-child(n+10) {
    animation-delay: 0.5s;
}

/* Le reste apparaît en même temps */

@keyframes gcc-fade-in-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 9. Feedback recherche + Highlight */
.gcc-search-feedback {
    display: block;
    margin-top: 8px;
    font-size: 0.9em;
    color: #666;
    text-align: center;
}

.gcc-search-highlight {
    background-color: rgba(255, 235, 59, 0.6);
    /* Jaune translucide */
    padding: 0 2px;
    border-radius: 2px;
}

/* ==========================================================================
   PHASE 3 : Accessibilité & UI (Scroll, Indicateur récent)
   ========================================================================== */

/* 24. Bouton Scroll-to-top */
.gcc-scroll-to-top {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 45px;
    height: 45px;
    background-color: #333;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    line-height: 45px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    /* Inactif quand caché */
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.2s ease;
    z-index: 1000;
}

.gcc-scroll-to-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.gcc-scroll-to-top:hover {
    background-color: #555;
}

/* 18. Compteur Global (Légende) */
.gcc-global-counter {
    background: #fff;
    border: 1px solid #ddd;
    border-left: 4px solid #0073aa;
    border-radius: 6px;
    padding: 12px 15px;
    margin: 10px auto 25px auto;
    font-size: 0.95em;
    color: #444;
    max-width: 850px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 12px;
}

/* 14. Indicateur "Récemment ajoutée" */
.chore-item.is-recent {
    border-left: 4px solid #46b450;
}

.chore-new-badge {
    display: inline-block;
    background-color: #46b450;
    color: white;
    font-size: 0.6rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 12px;
    margin-left: 8px;
    vertical-align: middle;
    position: relative;
    top: -2px;
    animation: gcc-pulse-badge 2s infinite;
}

@keyframes gcc-pulse-badge {
    0% {
        box-shadow: 0 0 0 0 rgba(70, 180, 80, 0.7);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(70, 180, 80, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(70, 180, 80, 0);
    }
}