/*
===============================================================================
STYLES SÉLECTEUR DE PÉRIMÈTRE GÉOGRAPHIQUE
Fichier: /static/css/atoms/site.css
Dépendances: variables.css, common.css
===============================================================================
*/

/* =====================================================
   ÉLÉMENTS DE BASE DU SÉLECTEUR
   ===================================================== */

/* Labels des sections */
.structure-label,
.site-label {
    font-size: 1.2rem;
    font-weight: 500;
    color: #333;
}

/* Valeurs affichées */
.structure-value,
.site-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--edf-blue);
}

/* Conteneur principal */
.main-container {
    max-width: 1000px;
    margin: 0 auto;
}

/* =====================================================
   BOUTON ACCORDÉON ET HEADER
   ===================================================== */

/* Style du bouton accordéon */
.accordion-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: white;
}

.accordion-button:not(.collapsed) {
    background-color: white;
    color: inherit;
    box-shadow: none;
}

.accordion-button:focus-visible {
    border: 2px solid var(--bs-primary) !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.25) !important;
    z-index: 2 !important;
    /* ✅ SUPPRESSION : Pas de changement de background */
    background-color: white !important;
}

.accordion-button:focus {
    box-shadow: none;
    border-color: rgba(0,0,0,.125);
}

/* Labels dans le bouton */
.selector-label {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

/* Icônes et textes dans le header */
.title-icon {
    color: #ff7900;
    margin-right: 10px;
    font-size: 1.2rem;
}

.title-text {
    margin-right: 5px;
    font-weight: 500;
}

.title-value {
    color: #0d6efd;
    font-weight: 500;
}

/* Section séparatrice */
.site-section {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 89px;
}

/* =====================================================
   CONTENU DE L'ACCORDÉON
   ===================================================== */

/* Corps du sélecteur */
.selector-body {
    display: flex;
    background-color: white;
    border-top: 1px solid rgba(0,0,0,.125);
    gap: 0;
}

/* Sections principales */
.structure-section,
.sites-section {
    flex: 0 0 50%;
    display: flex;
    flex-direction: column;
}

/* Séparateur entre sections */
.structure-section {
    border-right: 1px solid #dee2e6;
}

/* Colonnes de sélection */
.selector-column {
    width: 100%;
    border-right: 1px solid #dee2e6;
    padding: 0;
    flex: 1;
}

.structure-section .selector-column,
.sites-section .selector-column {
    border-right: none;
}

/* =====================================================
   OPTIONS DE SÉLECTION
   ===================================================== */

/* Options individuelles */
.selector-option {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #dee2e6;
}

.selector-option:last-child {
    border-bottom: none;
}

/* Checkboxes */
.form-check-input {
    flex-shrink: 0;
}

/* Statistiques des colonnes */
.column-stats {
    background-color: #f8f9fa;
    color: #6c757d;
    font-size: 0.85rem;
    padding: 5px 15px;
    border-bottom: 1px solid #dee2e6;
}

/* États des options */
.selected-option {
    background-color: #e7f1ff;
}

/* Icônes indicatrices */
.arrow-icon {
    margin-left: auto;
    color: #6c757d;
}

.check-icon {
    margin-left: auto;
    color: #0d6efd;
}

/* =====================================================
   GROUPEMENT DES ÉLÉMENTS (FIELDSET)
   ===================================================== */

/* Reset des styles par défaut */
.checkbox-group {
    border: none;
    margin: 0;
    padding: 0;
    min-width: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.checkbox-group legend {
    border: none;
    margin: 0;
    padding: 0;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    line-height: inherit;
}

/* Options dans les groupes */
.checkbox-group .selector-option {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #dee2e6;
}

.checkbox-group .selector-option:last-child {
    border-bottom: none;
}

/* Statistiques dans les groupes */
.checkbox-group .column-stats {
    background-color: #f8f9fa;
    color: #6c757d;
    font-size: 0.85rem;
    padding: 5px 15px;
    border-bottom: 1px solid #dee2e6;
}

/* =====================================================
   TITRES DE SECTIONS
   ===================================================== */

/* Style des titres */
.selector-section-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e9ecef;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    background-color: #f8f9fa;
    border-radius: 0.25rem 0.25rem 0 0;
    border: 1px solid #e9ecef;
    border-bottom: 2px solid #dee2e6;
}

/* États interactifs des titres */
.selector-section-header:hover {
    color: #2c3e50;
    background-color: #e9ecef;
    transition: all 0.15s ease;
}

.selector-section-header:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
    border-radius: 0.25rem;
    background-color: #e7f0ff;
}

/* =====================================================
   BOUTONS D'ACTION
   ===================================================== */

/* Footer avec boutons */
.selector-footer {
    display: flex;
    justify-content: flex-end;
    padding: 10px 15px;
    border-top: 1px solid #dee2e6;
    background-color: white;
}

/* Bouton d'application */
.apply-btn {
    background-color: #0d6efd;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    display: flex;
    align-items: center;
}

/* Bouton d'annulation */
.cancel-btn {
    background-color: white;
    color: #0d6efd;
    border: 1px solid #dee2e6;
    padding: 6px 12px;
    border-radius: 4px;
    margin-right: 10px;
}

/* =====================================================
   ÉTATS ET INDICATEURS VISUELS
   ===================================================== */

/* Éléments masqués */
.site-option.hidden {
    opacity: 0.5;
    pointer-events: none;
}

/* Amélioration du contraste */
.structure-value,
.site-value {
    color: var(--bs-primary);
    font-weight: 600;
}

.column-stats {
    color: var(--bs-gray-700);
    font-weight: 500;
}

/* =====================================================
   COMPOSANT ACCORDÉON
   ===================================================== */

/* Override des styles Bootstrap */
.accordion-item {
    border: 1px solid rgba(0,0,0,.125);
    border-radius: 6px !important;
    overflow: hidden;
    margin-bottom: 15px;
}

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

@media (max-width: 768px) {
    /* Layout en colonne sur mobile */
    .selector-body {
        flex-direction: column;
    }
    
    .structure-section,
    .sites-section {
        flex: 0 0 100%;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
    }
    
    .sites-section {
        border-bottom: none;
    }
    
    /* Titres adaptés */
    .selector-section-header {
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
        padding: 0.375rem 0.5rem;
    }
}

