/* ============================================================
   selection-groupes.css — Pastilles de regroupement + barre niveau
   Emplacement cible : /styles/outils/selection-groupes.css
   Partagé par automatismes.html et quiz.html
   ============================================================ */

/* ===== Barre de regroupements (secteurs / filières) ===== */
.secteur-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.25rem 0 0.9rem;
}
.secteur-chip {
    border: 1.5px solid #cfd8e3;
    background: #f7f9fc;
    color: #2c3e50;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    font-family: inherit;
}
.secteur-chip:hover { border-color: #3498db; background: #eaf4fb; }
.secteur-chip.active {
    background: linear-gradient(135deg, #3498db, #2980b9);
    border-color: #2980b9;
    color: #fff;
}
.secteur-chip-all { background: #eafaf1; border-color: #a9dfbf; }
.secteur-chip-all.active {
    background: linear-gradient(135deg, #27ae60, #229954);
    border-color: #229954;
    color: #fff;
}

/* Volet détaillé rétrogradé (secondaire) */
.all-chapters-summary { font-size: 1rem; padding: 0.7rem 1.2rem; }

/* ===== Sélecteur de niveau (haut de page) ===== */
.niveau-switch {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    position: relative;
    margin-bottom: 0.6rem;
    font-size: 0.92rem;
}
.niveau-switch-txt { color: #555; }
.niveau-switch-txt strong { color: #2c3e50; }
.niveau-change-btn {
    border: 1.5px solid #3498db;
    background: #fff;
    color: #2980b9;
    padding: 0.3rem 0.7rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: inherit;
}
.niveau-change-btn:hover { background: #eaf4fb; }
/* Respecter l'attribut hidden malgré le display:flex ci-dessous */
.niveau-menu[hidden] { display: none; }

.niveau-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 50;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #d5dde5;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    padding: 6px;
    display: flex;
    flex-direction: column;
    min-width: 140px;
}
.niveau-menu a {
    padding: 0.45rem 0.8rem;
    border-radius: 6px;
    color: #2c3e50;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}
.niveau-menu a:hover { background: #eaf4fb; }
.niveau-menu a.current { background: #3498db; color: #fff; }

@media (max-width: 600px) {
    .secteur-chip { font-size: 0.82rem; padding: 0.35rem 0.65rem; }
    .niveau-switch { flex-wrap: wrap; }
}

/* ===== En-tête compact des outils (titre + niveau / sous-titre + retour) ===== */
.tool-header { margin-bottom: 12px; }
.tool-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.tool-header-row h1 { margin: 0; }
.tool-subrow {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 4px;
}
.tool-subrow .subtitle { margin: 0; }
.tool-subrow .back-link { margin: 0; white-space: nowrap; }
/* dans l'en-tête, la barre de niveau ne prend plus de ligne à elle seule */
.tool-header-row .niveau-switch { margin: 0; }
