/**
 * CARTE INTERACTIVE - ONGLETS STATISTIQUES
 * Styles pour l'interface des statistiques géographiques
 */

/* === PANNEAU OVERLAY === */
.carte-stats-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 350px;
    height: 100%;
    background: white;
    border-left: 2px solid #dee2e6;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: visible; /* Changé de hidden à visible pour permettre au bouton de dépasser */
    transition: width 0.4s ease;
}

/* Bouton de repliement horizontal moderne sur le côté */
.carte-stats-toggle {
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: 2px solid white;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.carte-stats-toggle:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.4);
}

.carte-stats-toggle:active {
    transform: translateY(-50%) scale(1.02);
    box-shadow: 0 3px 8px rgba(0, 123, 255, 0.5);
}

/* Animation des flèches SVG */
.carte-stats-toggle svg {
    transition: all 0.3s ease;
}

.carte-stats-toggle.collapsed .arrow-right {
    display: none;
}

.carte-stats-toggle.collapsed .arrow-left {
    display: block !important;
}

.carte-stats-toggle:not(.collapsed) .arrow-right {
    display: block;
}

.carte-stats-toggle:not(.collapsed) .arrow-left {
    display: none;
}

.carte-stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #007bff;
    color: white;
    border-bottom: 1px solid #0056b3;
}

.carte-stats-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.carte-stats-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.carte-stats-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: 3px;
    transition: background-color 0.3s ease;
}

.carte-stats-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* === CONTENEUR PRINCIPAL === */
.carte-statistiques-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #f8f9fa;
    flex: 1;
    overflow: hidden;
}

/* === SYSTÈME D'ONGLETS === */
.carte-tabs-container {
    background: white;
    border-bottom: 2px solid #e9ecef;
    padding: 0;
}

.carte-tabs-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-x: auto;
}

.carte-tab-item {
    flex-shrink: 0;
}

.carte-tab-link {
    display: block;
    padding: 12px 20px;
    color: #6c757d;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.carte-tab-link:hover {
    color: #495057;
    background-color: #f8f9fa;
}

.carte-tab-link.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background-color: white;
}

/* === SOUS-ONGLETS === */
.carte-subtabs-container {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 0;
}

.carte-subtabs-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0 20px;
    overflow-x: auto;
}

.carte-subtab-link {
    display: block;
    padding: 8px 15px;
    color: #6c757d;
    text-decoration: none;
    font-size: 14px;
    border-radius: 4px 4px 0 0;
    transition: all 0.3s ease;
    margin-right: 5px;
    white-space: nowrap;
}

.carte-subtab-link:hover {
    color: #495057;
    background-color: #e9ecef;
}

.carte-subtab-link.active {
    color: #007bff;
    background-color: white;
    border: 1px solid #dee2e6;
    border-bottom: none;
}

/* === SOUS-SOUS-ONGLETS === */
.carte-subsubtabs-container {
    background: white;
    border-bottom: 1px solid #dee2e6;
    padding: 8px 20px;
}

.carte-subsubtabs-nav {
    display: flex;
    gap: 10px;
    align-items: center;
}

.carte-subsubtab-btn {
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    background: #f8f9fa;
    color: #6c757d;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.carte-subsubtab-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.carte-subsubtab-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* === CONTRÔLES === */
.carte-stats-controls {
    background: white;
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.carte-control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.carte-control-label {
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    white-space: nowrap;
}

.carte-control-select {
    padding: 6px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    color: #495057;
    min-width: 120px;
    cursor: pointer;
}

.carte-control-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* === ZONE DE CONTENU === */
.carte-stats-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.carte-stats-map-container {
    flex: 1;
    position: relative;
    background: white;
    min-height: 300px;
}

.carte-stats-map {
    width: 100%;
    height: 100%;
    min-height: 300px;
}

/* === LÉGENDE === */
.carte-legend {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 6px;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 150px;
    max-width: 250px;
    font-size: 12px;
}

.carte-legend-title {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.carte-legend-scale {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 8px;
}

.carte-legend-gradient {
    width: 180px;
    height: 15px;
    border-radius: 3px;
    background: linear-gradient(to right, #e3f2fd, #1976d2);
    border: 1px solid #dee2e6;
}

.carte-legend-bottom {
    display: flex;
    align-items: center;
    width: 100%;
    position: relative;
}

.carte-legend-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #6c757d;
    width: 100%;
    padding-right: 50px; /* Espace pour les boutons */
    margin: 0;
}

.carte-legend-buttons {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 10px;
    z-index: 1001;
}

.carte-legend-labels-btn,
.carte-legend-info-btn {
    background: transparent;
    color: #007cba;
    border: none;
    width: 18px;
    height: 18px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 2px;
}

.carte-legend-labels-btn:hover,
.carte-legend-info-btn:hover {
    color: #ffffff;
    background: #007cba;
    transform: scale(1.1);
}

.carte-legend-labels-btn:active,
.carte-legend-info-btn:active {
    transform: scale(0.95);
}

.carte-legend-labels-btn.labels-hidden {
    opacity: 0.6;
    background: #dc3545;
}

.carte-legend-labels-btn.labels-hidden:hover {
    background: #c82333;
    color: #ffffff;
}

.carte-legend-stats {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #dee2e6;
    font-size: 12px;
    color: #6c757d;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    max-width: 100%;
}

/* === POPUP PERSONNALISÉE === */
.carte-choropleth-popup {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.carte-choropleth-popup-header {
    background: #007bff;
    color: white;
    padding: 10px 15px;
    margin: -10px -15px 10px -15px;
    border-radius: 3px 3px 0 0;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.carte-choropleth-popup-title {
    flex: 1;
    margin: 0;
}

.carte-choropleth-popup-close {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: 10px;
}

.carte-choropleth-popup-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.carte-choropleth-popup-content {
    margin: 0;
}

.carte-choropleth-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 5px 0;
    padding: 5px 0;
    border-bottom: 1px solid #f1f3f4;
}

.carte-choropleth-stat:last-child {
    border-bottom: none;
}

.carte-choropleth-stat-label {
    font-weight: 500;
    color: #495057;
}

.carte-choropleth-stat-value {
    font-weight: 600;
    color: #007bff;
}

/* === INDICATEUR DE CHARGEMENT === */
.carte-stats-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    text-align: center;
}

.carte-stats-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e9ecef;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

.carte-stats-loading-text {
    font-size: 14px;
    color: #6c757d;
}

/* === ANIMATIONS === */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === MESSAGE D'ERREUR === */
.carte-stats-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    max-width: 300px;
    z-index: 2000;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .carte-stats-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .carte-control-group {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }
    
    .carte-control-select {
        min-width: auto;
    }
    
    .carte-legend {
        position: relative;
        bottom: auto;
        left: auto;
        margin: 10px;
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}

/* === TOOLTIPS POUR LES VILLES === */
.carte-city-tooltip {
    background: rgba(0, 0, 0, 0.8) !important;
    color: white !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    padding: 6px 10px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    backdrop-filter: blur(10px) !important;
}

.carte-city-tooltip::before {
    border-top-color: rgba(0, 0, 0, 0.8) !important;
}


/* === STYLE POUR LES COUCHES CHOROPLETH === */
.leaflet-interactive {
    cursor: pointer;
}

.leaflet-interactive:hover {
    opacity: 0.8;
}

/* Styles pour les zones sans données */
.leaflet-interactive.no-data {
    cursor: default !important;
}

.leaflet-interactive.no-data:hover {
    opacity: 1 !important;
}

/* === LABELS NUMÉRIQUES SUR LES ZONES === */
.carte-numeric-label {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    pointer-events: none !important; /* Rendre les labels transparents aux clics */
}

.carte-label-content {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-weight: bold;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 12px;
    text-align: center;
    line-height: 1;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    pointer-events: none !important; /* Éviter toute interférence avec les clics */
}

/* Style pour les différents niveaux de zoom */
@media screen and (max-width: 768px) {
    .carte-label-content {
        font-size: 12px;
        padding: 3px 6px;
    }
}

/* === BOUTONS ICÔNES SIMPLIFIÉS === */
.carte-btn-icon {
    min-width: 40px !important;
    padding: 8px !important;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
}

.carte-btn-icon:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #007bff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
}

.carte-btn-icon:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 123, 255, 0.3);
}

/* === BOUTON FLOTTANT POUR SORTIR DU PLEIN ÉCRAN === */
.carte-exit-fullscreen {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10000;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.carte-exit-fullscreen:hover {
    background: rgba(220, 53, 69, 0.9);
    border-color: white;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.4);
}

.carte-exit-fullscreen:active {
    transform: scale(1.05);
}

/* === SÉLECTEUR DE FOND DE CARTE DANS LA TOOLBAR === */
.carte-toolbar-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.carte-toolbar-label {
    font-size: 13px;
    font-weight: 500;
    color: #495057;
    white-space: nowrap;
}

.carte-toolbar-select {
    padding: 6px 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 160px;
}

.carte-toolbar-select:hover {
    border-color: #007bff;
}

.carte-toolbar-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Responsive pour la toolbar */
@media (max-width: 1024px) {
    .carte-toolbar-label {
        display: none;
    }
    
    .carte-toolbar-select {
        font-size: 12px;
        padding: 5px 8px;
        min-width: 140px;
    }
}

@media (max-width: 768px) {
    .carte-toolbar-control {
        gap: 4px;
    }
    
    .carte-toolbar-select {
        font-size: 11px;
        padding: 4px 6px;
        min-width: 120px;
    }
}

/* === PANNEAU DES STATISTIQUES === */
.carte-stats-panel {
    background: white;
    border-bottom: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.carte-stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 15px;
}

.carte-stats-title {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}


.carte-stats-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* État réduit du panneau - repliement horizontal */
.carte-stats-panel.collapsed {
    width: 60px; /* Largeur réduite pour ne montrer que le bouton */
    overflow: visible;
}

.carte-stats-panel.collapsed .carte-stats-header {
    display: none;
}

.carte-stats-panel.collapsed .carte-stats-content {
    display: none;
}

.carte-stats-panel.collapsed .carte-stats-toggle {
    left: -20px; /* Garder la même position */
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.carte-stats-panel.collapsed .carte-stats-toggle:hover {
    background: linear-gradient(135deg, #1e7e34 0%, #155724 100%);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}

/* S'assurer que le conteneur de la carte ne masque pas le bouton */
.carte-container {
    position: relative;
    overflow: visible;
}

#carte-leaflet {
    position: relative;
    z-index: 999; /* Plus bas que le bouton de réduction */
}

.carte-stats-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 8px;
    padding: 0 20px;
}

.carte-stats-row:last-child {
    margin-bottom: 15px;
}

.carte-stats-label {
    min-width: 80px;
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}


.carte-stats-controls {
    display: flex;
    gap: 10px;
}

.carte-stats-select {
    padding: 6px 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 160px;
    flex: 1;
}

.carte-stats-select:hover {
    border-color: #007bff;
}

.carte-stats-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* === SECTION TEMPORELLE RÉORGANISÉE === */
.carte-temporal-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.carte-temporal-header {
    display: flex;
    align-items: center;
}

.carte-temporal-all-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: 15px; /* Indentation pour aligner sous le label */
    margin-top: 2px;
}

.carte-temporal-all-checkbox label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #495057;
    cursor: pointer;
    font-weight: 500;
}

.carte-temporal-all-checkbox input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.carte-temporal-slider-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 15px; /* Indentation pour aligner sous le label */
    max-width: 280px; /* Limiter la largeur du slider */
}

/* Styles pour le slider et ses labels dans le panneau */
.carte-temporal-centuries-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #6c757d;
    margin-bottom: 4px;
}

.carte-temporal-slider {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #e9ecef;
    border-radius: 2px;
    outline: none;
}

.carte-temporal-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.carte-temporal-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* === STYLES POUR LE FILTRAGE PAR SEUIL === */
.carte-threshold-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.carte-threshold-header {
    display: flex;
    align-items: center;
}

.carte-threshold-all-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: 15px; /* Indentation pour aligner sous le label */
    margin-top: 2px;
}

.carte-threshold-all-checkbox label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #495057;
    cursor: pointer;
    font-weight: 500;
}

.carte-threshold-all-checkbox input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.carte-threshold-slider-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 15px; /* Indentation pour aligner sous le label */
    max-width: 280px; /* Limiter la largeur du slider */
}

.carte-threshold-info {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 4px;
}

.carte-threshold-info span {
    font-weight: 600;
    color: #495057;
}

.carte-threshold-slider {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #e9ecef;
    border-radius: 2px;
    outline: none;
}

.carte-threshold-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #28a745;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.carte-threshold-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #28a745;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.carte-threshold-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #6c757d;
    margin-top: 4px;
}

/* Contrôle threshold compact pour mortalité */
.carte-threshold-control {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.carte-threshold-control input[type="range"] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #e9ecef;
    border-radius: 2px;
    outline: none;
}

.carte-threshold-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #dc3545;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.carte-threshold-control input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #dc3545;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.carte-threshold-value {
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    min-width: 40px;
    text-align: right;
}

/* === RESPONSIVE POUR LE PANNEAU === */
@media (max-width: 1024px) {
    .carte-stats-header {
        padding: 10px 15px;
        margin-bottom: 12px;
    }
    
    .carte-stats-title {
        font-size: 13px;
    }
    
    .carte-stats-row {
        gap: 10px;
        margin-bottom: 10px;
        padding: 0 15px;
    }
    
    .carte-stats-label {
        min-width: 120px;
        font-size: 13px;
    }
    
    
    .carte-stats-select {
        padding: 6px 10px;
        font-size: 12px;
        min-width: 100px;
    }
}

@media (max-width: 768px) {
    .carte-stats-header {
        padding: 8px 12px;
        margin-bottom: 10px;
    }
    
    .carte-stats-title {
        font-size: 12px;
    }
    
    .carte-stats-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 15px;
        padding: 0 12px;
    }
    
    .carte-stats-label {
        min-width: auto;
        font-size: 12px;
        font-weight: 600;
    }
    
    
    .carte-stats-controls {
        width: 100%;
    }
    
    .carte-stats-select {
        width: 100%;
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* === SECTION D'INFORMATION SUR LE CALCUL === */
.carte-stats-info {
    margin-top: 15px;
    padding: 12px 20px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 6px 6px;
}

.carte-stats-info-content {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 12px;
}

.carte-stats-info-title {
    font-weight: 600;
    color: #495057;
    font-size: 13px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.carte-stats-info-text {
    font-size: 12px;
    color: #6c757d;
    line-height: 1.4;
}

.carte-stats-info-text strong {
    color: #495057;
    font-weight: 600;
}

.carte-stats-info-text .criteria {
    font-style: italic;
    color: #868e96;
    margin-top: 4px;
}

/* Responsive pour la section d'information */
@media (max-width: 768px) {
    .carte-stats-info {
        padding: 10px 12px;
        margin-top: 12px;
    }
    
    .carte-stats-info-content {
        padding: 10px;
    }
    
    .carte-stats-info-title {
        font-size: 12px;
    }
    
    .carte-stats-info-text {
        font-size: 11px;
    }
}

/* === MODAL D'INFORMATIONS === */
.carte-info-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.carte-info-modal.carte-info-modal-visible {
    opacity: 1;
    visibility: visible;
}

.carte-info-modal.carte-info-modal-closing {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.carte-info-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.carte-info-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
}

.carte-info-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #eee;
}

.carte-info-modal-title {
    margin: 0;
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
}

.carte-info-modal-close {
    background: none;
    border: none;
    font-size: 1.4em;
    cursor: pointer;
    padding: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: #666;
    transition: all 0.2s ease;
}

.carte-info-modal-close:hover {
    background: #f8f9fa;
    color: #333;
}

.carte-info-modal-body {
    padding: 20px 24px 24px;
    color: #333;
    line-height: 1.6;
}

.carte-info-modal-body strong {
    color: #007cba;
    font-weight: 600;
}

.carte-info-modal-body .criteria {
    margin-top: 8px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.9em;
    color: #666;
    border-left: 3px solid #007cba;
}