/**************************************************************************************************
* 										LAYER PANEL
****************************************************************************************************/
.leaflet-verticaltop2 {
    z-index: 1;
}

.leaflet-verticaltop2 .leaflet-control {
    width: 50px;
    display: flex;
    align-items: flex-start;
}

.leaflet-control-layers-toggle {
    background-image: url(/assets/IMAGES/GUI/BUTTONS/layers-w.svg);
    background-position: center center;
    background-size: 30px 30px;
    background-repeat: no-repeat;
}

/* Le bouton de filtre risque réutilise les styles communs des boutons du layertree.
   On ne garde qu'un modificateur pour l'état actif si nécessaire. */
.risk-filter-btn.active {
    background: var(--primary-color);
}


.leaflet-control-layers-toggle-clicked {
    margin-right: -40px;
}

.leaflet-control-layers-toggle:hover {
    background-image: url(/assets/IMAGES/GUI/BUTTONS/layers-b.svg);
}

.leaflet-control-layers-toggle-clicked {
    background-image: url(/assets/IMAGES/GUI/BUTTONS/layers-blue.svg);
}

.global-hidden-counter {
    position: absolute;
    top: 27px;
    right: 6px;
    background-color: var(--rc-color-red);
    color: white;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 10;
    transition: transform 0.2s ease, opacity 0.2s ease;
    cursor: default;
}

.global-hidden-counter.updated {
    animation: pulse 0.3s ease;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.25);
    }

    100% {
        transform: scale(1);
    }
}


.leaflet-layerstree-children {
    font-family: var(--font-title);
    font-size: calc(var(--header-height)/6);
    vertical-align: middle;
    /*line-height: calc(var(--header-height)/6);*/
}

/* Annuler le padding pour les groupes principaux GEOMETRIES et SYNTHESIS */
.leaflet-layerstree-children[data-group-key="T_GEOMETRIES"],
.leaflet-layerstree-children[data-group-key="T_SYNTHESIS"] {
    padding-left: 0px !important;
    margin-left: -20px;
}

.leaflet-control-layers-overlays > .leaflet-layerstree-children > .leaflet-layerstree-node > .leaflet-layerstree-header {
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
}


.leaflet-layerstree-header.force-open,
.leaflet-layerstree-header-pointer {
    position: relative;
    color: white;
    background-color: var(--primary-color);
    font-family: var(--font-title);
    font-size: calc(var(--header-height)/6);
    padding: 5px 1rem 5px 0.5rem;
    margin: 0.5rem 0 0.2rem 0;
}

.leaflet-layerstree-header-pointer:hover {
    background-color: var(--secondary-color);
}


.leaflet-layerstree-header.force-open .leaflet-layerstree-header-pointer {
    cursor: default;
}

.leaflet-control-layers-base>.leaflet-layerstree-header-pointer,
.leaflet-control-layers-overlays>.leaflet-layerstree-header-pointer {
    font-size: calc(var(--header-height)/6);
    background-color: var(--tertiary-color);
}

.leaflet-control-layers-overlays>.leaflet-layerstree-header.force-open:first-of-type {
    font-size: calc(var(--header-height)/6) !important;
    background-color: var(--tertiary-color) !important;

}

.leaflet-control-layers-selector {
    top: -2px;
}

/* Style pour la barre supérieure du layertree */
.layertree-topbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.1);
    border: 0;
    min-height: 30px;
    margin-top: -5px;
    justify-content: center;
    position: relative;
}

.layertree-topbar button:first-of-type {
    border-bottom-left-radius: 50%;
}

.layertree-topbar button:last-of-type {
    border-bottom-right-radius: 50%;
}


/* Style général pour les boutons d'action du layertree */
.leaflet-control-opacity-reset,
.leaflet-control-layers-front,
.leaflet-control-layers-back,
.leaflet-control-layers-extend,
.layertree-forceopenlock-btn,
.layertree-autosync-btn,
.layertree-labels-btn,
.layertree-filter-btn,
.layertree-permanent-labels-btn,
.reset-order-btn {
    align-items: center;
    justify-content: center;
    width: 2em;
    height: 2em;
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    vertical-align: middle;
    font-size: 0.8em !important;
    color: var(--accent-color);
    border: none;
    outline: none;
    text-align: center;
    line-height: 21px;
    display: inline-flex;
    margin: 0;
    float: none;
}


.leaflet-control-layers-front,
.leaflet-control-layers-back {
    height: 1em !important;
}


.layertree-permanent-labels-btn:not(.active),
.layertree-forceopenlock-btn:not(.active),
.layertree-labels-btn:not(.active),
.layertree-autosync-btn:not(.active) {
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.8);
}

.layertree-permanent-labels-btn:not(.active):hover,
.layertree-forceopenlock-btn:not(.active):hover,
.layertree-labels-btn:not(.active):hover,
.layertree-autosync-btn:not(.active):hover {
    background: var(--tertiary-color);
    color: var(--secondary-color);
}

/* Agrandissement pour écrans haute résolution (QHD, 4K, etc.) */
@media (min-height: 1200px) {
    .layertree-forceopenlock-btn,
    .layertree-autosync-btn,
    .layertree-labels-btn,
    .layertree-permanent-labels-btn,
    .reset-order-btn {
        width: 2.5em;
        height: 2.5em;
        font-size: 1em !important;
        line-height: 28px;
    }
}

/* Agrandissement pour écrans très haute résolution (4K+) */
@media (min-height: 1800px) {
    .layertree-forceopenlock-btn,
    .layertree-autosync-btn,
    .layertree-labels-btn,
    .layertree-permanent-labels-btn,
    .reset-order-btn {
        width: 3em;
        height: 3em;
        font-size: 1.2em !important;
        line-height: 32px;
    }
}

/* Agrandissement pour écrans ultra haute résolution */
@media (min-height: 2400px) {
    .layertree-forceopenlock-btn,
    .layertree-autosync-btn,
    .layertree-labels-btn,
    .layertree-permanent-labels-btn,
    .reset-order-btn {
        width: 3.5em;
        height: 3.5em;
        font-size: 1.4em !important;
        line-height: 36px;
    }
}


.leaflet-control-opacity-reset i,
.leaflet-control-layers-front i,
.leaflet-control-layers-back i,
.leaflet-control-layers-extend i,
.layertree-forceopenlock-btn i,
.layertree-autosync-btn i,
.layertree-labels-btn i,
.layertree-filter-btn i {
    pointer-events: none;
    /* Pour éviter de bloquer le clic sur le span */
}

.leaflet-control-opacity-reset:hover,
.leaflet-control-layers-front:hover,
.leaflet-control-layers-back:hover,
.leaflet-control-layers-extend:hover,
.layertree-forceopenlock-btn:hover,
.layertree-autosync-btn:hover,
.layertree-labels-btn:hover,
.layertree-permanent-labels-btn:hover,
.layertree-filter-btn:hover {
    background: var(--secondary-color);
    color: var(--tertiary-color);
}

.leaflet-control-opacity-reset:active,
.leaflet-control-layers-front:active,
.leaflet-control-layers-back:active,
.leaflet-control-layers-extend:active,
.layertree-forceopenlock-btn:active,
.layertree-autosync-btn:active,
.layertree-labels-btn:active,
.layertree-permanent-labels-btn:active,
.layertree-filter-btn:active {
    background: var(--primary-color);
    color: var(--tertiary-color);
}

/* Optionnel : pour un effet focus accessible */
.leaflet-control-opacity-reset:focus,
.leaflet-control-layers-front:focus,
.leaflet-control-layers-back:focus,
.leaflet-control-layers-extend:focus,
.layertree-forceopenlock-btn:focus,
.layertree-autosync-btn:focus,
.layertree-labels-btn:focus,
.layertree-permanent-labels-btn:focus,
.layertree-filter-btn:focus {
    box-shadow: 0 0 0 2px var(--primary-color);
}

/* Style pour les boutons actifs */
.layertree-forceopenlock-btn.active,
.layertree-autosync-btn.active,
.layertree-labels-btn.active,
.layertree-permanent-labels-btn.active,
.layertree-filter-btn.active {
    background: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color);
}

.layertree-forceopenlock-btn.active:hover,
.layertree-autosync-btn.active:hover,
.layertree-labels-btn.active:hover,
.layertree-permanent-labels-btn.active:hover,
.layertree-filter-btn.active:hover {
    background: var(--secondary-color);
    color: var(--tertiary-color);
}

/* Bouton Reset Order dans le layer tree */
.leaflet-control-layers-list .reset-order-btn {
    /* Positionnement absolu du bouton reset, isolé des autres icônes */
    position: absolute;
    right: 0;
    top: 0;
    width: 2.5em;
    height: 2.5em;
    cursor: pointer;
    z-index: 1000;
    color: var(--secondary-color);
    transition: all 0.2s ease;
    font-family: inherit;
    box-shadow: -2px -2px 4px rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border-bottom-left-radius: 50%; 
    border: none;
    margin-top: -5px;
    
    background: var(--primary-color);
    color: var(--accent-color);
}

.reset-order-btn:hover {
    background: var(--secondary-color);
    color: white;
    box-shadow: 0 0 0 1px white;
    
}

.reset-order-btn:active {
    box-shadow: 0 0 0 1px var(--primary-color);
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.8);
}

.reset-order-btn i {
    font-size: 12px;
}


/* Le bouton n'est visible que quand le layer tree est ouvert */
.leaflet-control-layers:not(.leaflet-control-layers-expanded) .reset-order-btn {
    display: none;
}


.leaflet-control-layers-extend.disabled {
    color: #999;
    opacity: 0;
    width: 0;
    cursor: unset;
    background-color: transparent;
    box-shadow: none;
    border: none;
    outline: none;
}

.leaflet-control-layers-front {
    margin: 0;
}

.leaflet-control-layers-back {
    margin: 0;
}

/* Optionnel : masquer les anciens boutons front/back si on utilise la poignée divisée */

.leaflet-control-layers-front,
.leaflet-control-layers-back {
    display: none;
}

/* Conteneur pour les boutons d'ordre */
.leaflet-control-layers-order-container {
    display: flex;
    align-items: center;
    gap: 0px;
    margin: 0px 0px;
    flex-direction: column;
}

.risk-filter-btn {
    margin-left: -5px;
    margin-right: 5px;
}

.leaflet-control-layers-selector {
    top: 0;
}

.leaflet-control-layers span {
    font-size: .7rem;
}


.leaflet-control-layers span.checkbox-wrapper {
    position: absolute;
    left: -5px;
    top: 2px;
}

/* Checkboxes responsives dans le drawer */
.lim-drawer-content .checkbox-wrapper {
    position: relative !important;
    display: inline-block !important;
}

.lim-drawer-content .checkbox-wrapper input[type="checkbox"] {
    width: 1.1rem !important;
    height: 1.1rem !important;
    transform: translateY(-0.1rem) !important;
    position: relative !important;
    z-index: 3 !important;
    opacity: 0 !important;
    cursor: pointer !important;
}

.lim-drawer-content .checkbox-wrapper .custom-checkbox {
    width: 1.1rem !important;
    height: 1.1rem !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    z-index: 2 !important;
    pointer-events: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 2px solid var(--accent-color-focus) !important;
    border-radius: 3px !important;
    background: var(--dark-color-1) !important;
    box-sizing: border-box !important;
}


/* Très petits écrans (mobile) */
@media (max-width: 480px) {
    .lim-drawer-content .checkbox-wrapper input[type="checkbox"] {
        width: .9rem !important;
        height: .9rem !important;
    }
    
    .lim-drawer-content .checkbox-wrapper .custom-checkbox {
        width: .9rem !important;
        height: .9rem !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* Petits écrans (tablettes) */
@media (min-width: 481px) and (max-width: 768px) {
    .lim-drawer-content .checkbox-wrapper input[type="checkbox"] {
        width: 1rem !important;
        height: 1rem !important;
    }
    
    .lim-drawer-content .checkbox-wrapper .custom-checkbox {
        width: 1rem !important;
        height: 1rem !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* Écrans moyens (laptops) */
@media (min-width: 769px) and (max-width: 1200px) {
    .lim-drawer-content .checkbox-wrapper input[type="checkbox"] {
        width: 1.1rem !important;
        height: 1.1rem !important;
    }
    
    .lim-drawer-content .checkbox-wrapper .custom-checkbox {
        width: 1.1rem !important;
        height: 1.1rem !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* Grands écrans (desktop) */
@media (min-width: 1201px) and (max-width: 1920px) {
    .lim-drawer-content .checkbox-wrapper input[type="checkbox"] {
        width: 1.2rem !important;
        height: 1.2rem !important;
    }
    
    .lim-drawer-content .checkbox-wrapper .custom-checkbox {
        width: 1.2rem !important;
        height: 1.2rem !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* Très grands écrans (4K et plus) */
@media (min-width: 1921px) {
    .lim-drawer-content .checkbox-wrapper input[type="checkbox"] {
        width: 1.3rem !important;
        height: 1.3rem !important;
    }
    
    .lim-drawer-content .checkbox-wrapper .custom-checkbox {
        width: 1.3rem !important;
        height: 1.3rem !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* S'assurer que les custom checkboxes sont bien positionnées et cliquables */
.lim-drawer-content .checkbox-wrapper input[type="checkbox"]:checked + .custom-checkbox {
    background: var(--accent-color-focus) !important;
    border-color: var(--primary-color) !important;
}

.lim-drawer-content .checkbox-wrapper input[type="checkbox"]:checked + .custom-checkbox::after {
    content: '✓' !important;
    color: var(--primary-color) !important;
    font-size: 0.8em !important;
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    pointer-events: none !important;
    font-weight: bold !important;
}

.lim-drawer-content .checkbox-wrapper input[type="checkbox"]:hover + .custom-checkbox {
    border-color: rgb(188, 225, 255) !important;
    outline: 1px solid rgb(188, 225, 255) !important;
    background-color: var(--secondary-color) !important;
}

.lim-drawer-content .checkbox-wrapper input[type="checkbox"]:checked:hover + .custom-checkbox {
    background-color: var(--accent-color-clear) !important;
    outline-color: white !important;
    border-color: var(--secondary-color) !important;
}

.leaflet-layerstree-header-pointer>.leaflet-layerstree-children {
    cursor: pointer;
}

.drag-handle {
    align-items: center;
    cursor: ns-resize !important;
    opacity: 0.7;
    transition: opacity 0.2s;
    position: absolute;
    left: 0px;
    top: 0;
    bottom: 0;
    min-width: 10px;
    color: var(--primary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 20px;
    background: #0003;
    padding-bottom: 3px;
    margin-right: 10px;
}

/* Cibler le premier drag-handle dans les groupes principaux seulement */
.leaflet-layerstree-children[data-group-key="T_GEOMETRIES"] .leaflet-layerstree-node:first-of-type .drag-handle,
.leaflet-layerstree-children[data-group-key="T_SYNTHESIS"] .leaflet-layerstree-node:first-of-type .drag-handle {
    border-top-right-radius: 10px;
}

/* Cibler le dernier drag-handle dans les groupes principaux seulement */
.leaflet-layerstree-children[data-group-key="T_GEOMETRIES"] .leaflet-layerstree-node:last-of-type .drag-handle,
.leaflet-layerstree-children[data-group-key="T_SYNTHESIS"] .leaflet-layerstree-node:last-of-type .drag-handle {
    border-bottom-right-radius: 10px;
}

.drag-handle i {
    font-size: 10px;
    line-height: 1;
}

.drag-handle-group {
    color: var(--primary-color);
    font-weight: bold;
    cursor: grab;
    position: absolute;
    top: 0px;
    left: -15px;
    margin: 0px;
    height: 26px;
    background: rgba(0, 0, 0, 0.3);
    width: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-bottom: 3px;
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
    transition: all .2s ease;
}

.drag-handle-group:hover {
    color: var(--accent-color-focus);
    background: rgba(255, 255, 255, 0.3);
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    width: 16px;
    left: -14px;
}

.drag-handle-group i {
    font-size: 10px;
    line-height: 1;
}

.drag-handle:hover {
    background: var(--primary-color);
    color: var(--accent-color-focus);
    /* couleur du SVG au hover */
    opacity: 0.7;
}
/* Styles spécifiques pour les compteurs dans le drawer */
.hidden-count {
    display: flex;
    padding: 1px 7px;
    font-weight: bold;
    color: #fff;
    background: var(--SITE-color);
    border-radius: 12px;
    vertical-align: middle;
    opacity: 1;
    line-height: 19px;
    text-align: center;
    cursor: pointer;
    position: relative;
    right: -40px;
    height: 20px;
    top: -1px;
    overflow: hidden;
    justify-content: space-evenly;
    align-items: center;
    gap: 10px;
    flex-direction: row-reverse;
    width: 65px;
    padding-right: 5px;
    outline-offset: -1px;
    border-color: var(--primary-color);
    outline: 2px solid var(--primary-color);
    box-shadow: 1px 3px 0 var(--primary-color);
    max-width: 70px;
    transition: all .3s ease;
}

.hidden-count:hover {
    right: -10px;
    border-right: 3px solid black;
    outline: 2px solid black;
    box-shadow: 1px 3px 0 #000;
}

/* .hidden-count * {
    transform: translateX(0px);
    transition: all .3s ease;
} */

/* .hidden-count:hover * {
    transform: translateX(22px);
} */

.hidden-count[hidden],
.hidden-count.hide {
    opacity: 0;
    transform: scale(0.7);
    pointer-events: none;
}

.leaflet-control-layers span.hidden-x {
    font-size: .6rem;
}


.group-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    transition: background 0.2s;
    background: transparent;
}

.group-switch:hover {
    background: rgba(0, 0, 0, 0.2);
}

.group-switch i {
    font-size: 0.8em;
    transition: color 0.2s;
}

.group-switch-off {
    background: transparent;
}

.group-switch-off i {
    color: #111;
}

.group-switch-on {
    border: 1px solid transparent;
}

.group-switch-on i {
    color: #fff;
}

.group-switch-mixed {
    border: 1px solid transparent;
}

.group-switch-mixed i {
    color: #808080;
}


.group-switch-right {
    position: absolute;
    right: 5px;
    cursor: pointer;
    top: 4px;
    bottom: 4px;
}



/*******************************************************************************************************************
* 										LAYER SLIDER
********************************************************************************************************************/

/* Styles pour le slider HTML5 natif */
.leaflet-native-slider {
    -webkit-appearance: none;
    appearance: none;
    /* width: 100px; */
    height: 4px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.3);
    outline: none;
    margin: 0 5px;
    vertical-align: middle;
}


.leaflet-native-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    outline: 1px solid var(--secondary-color);
    border: 0;
    outline-offset: -3px;
    box-shadow: 0 2px 0 rgba(114, 175, 210, 0.3);
    transition: all 0.2s ease;
}

.leaflet-native-slider::-moz-range-thumb {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    outline: 1px solid var(--secondary-color);
    border: 0;
    outline-offset: -3px;
    box-shadow: 0 2px 0 var(--tertiary-color);
    transition: all 0.2s ease;
}

.leaflet-native-slider:hover::-webkit-slider-thumb {
    outline: 2px solid var(--secondary-color);
    transform: scale(1.2);
    box-shadow: 0 2px 0 var(--primary-color);
}

.leaflet-native-slider:hover::-moz-range-thumb {
    outline: 2px solid var(--secondary-color);
    transform: scale(1.2);
    box-shadow: 0 2px 0 var(--primary-color);
}

.leaflet-native-slider:active::-webkit-slider-thumb {
    outline: 3px solid var(--tertiary-color);
    transform: scale(1.3);
    box-shadow: 0 1px 0 var(--secondary-color);
}

.leaflet-native-slider:active::-moz-range-thumb {
    outline: 3px solid var(--tertiary-color);
    transform: scale(1.3);
    box-shadow: 0 1px 0 var(--secondary-color);
}

/**/

.leaflet-layerstree-node>.leaflet-layerstree-header>span>.leaflet-layerstree-layer-span {
    width: 100%;
    min-height: 40px;
}

.leaflet-layerstree-layer-span {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.1);
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    padding: 4px 8px;
    margin: 0;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    background: var(--panel-bg-alt);
}

.leaflet-layerstree-layer-span:hover {
    background: var(--panel-hover-bg);
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.leaflet-layerstree-layer-span>img {
    top: 2px;
}

/* Règles pour le checkbox-wrapper du layertree */
/* S'assurer que les checkboxes restent cliquables */
span.leaflet-layerstree-layer-span .checkbox-wrapper {
    position: relative;
    z-index: 2;
    pointer-events: auto;
    margin-left: 20px;
    margin-right: 5px;
}

.leaflet-layerstree-layer-span .checkbox-wrapper input[type="checkbox"] {
    position: relative;
    z-index: 3;
    pointer-events: auto;
    cursor: pointer;
}

.leaflet-layerstree-layer-span .leaflet-control-layers-extend,
.leaflet-layerstree-layer-span .leaflet-control-layers-front,
.leaflet-layerstree-layer-span .leaflet-control-layers-back {
    margin: 0 2px;
    border-radius: 0px;
    transition: all 0.2s ease;
}

.leaflet-layerstree-layer-span .leaflet-control-layers-extend:hover,
.leaflet-layerstree-layer-span .leaflet-control-layers-front:hover,
.leaflet-layerstree-layer-span .leaflet-control-layers-back:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

/* Style pour le nom du layer */
.leaflet-layerstree-layer-span>span:last-of-type {
    flex: 1;
    padding: 2px 10px;

}

/* Styles pour la poignée de drag divisée */
.drag-handle-container {
    display: flex;
    flex-direction: column;
    width: 1.5em;
    height: 2em;
    cursor: ns-resize !important;
    opacity: 0.7;
    margin-right: 10px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100%;
}

.drag-handle-container:hover {
    background: var(--primary-color);
    color: var(--accent-color-focus);
    border-color: var(--primary-color);
    transform: scale(1.05);
    opacity: 1;
}

.drag-handle-container:active {
    cursor: grabbing !important; /* ✅ Curseur de drag actif */
    transform: scale(0.95);
}

.drag-handle-top,
.drag-handle-bottom {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    width: 100%;
}

.drag-handle-top {
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    align-items: flex-end;
}

.drag-handle-bottom {
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    align-items: flex-start;
}

.drag-handle-top:hover,
.drag-handle-bottom:hover {
    background: var(--secondary-color);
    color: white;
}

.drag-handle-top i,
.drag-handle-bottom i {
    font-size: 10px;
    line-height: 1;
    pointer-events: none;
}

/* Animation pour indiquer l'action */
.drag-handle-top:active {
    background: var(--primary-color);
    color: white;
    transform: translateY(1px);
}

.drag-handle-bottom:active {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-1px);
}

/* Cibler le premier drag-handle-container dans les groupes principaux seulement */
.leaflet-layerstree-children[data-group-key="T_GEOMETRIES"] .leaflet-layerstree-node:first-of-type .drag-handle-container,
.leaflet-layerstree-children[data-group-key="T_SYNTHESIS"] .leaflet-layerstree-node:first-of-type .drag-handle-container {
    border-top-right-radius: 10px;
}

/* Cibler le dernier drag-handle-container dans les groupes principaux seulement */
.leaflet-layerstree-children[data-group-key="T_GEOMETRIES"] .leaflet-layerstree-node:last-of-type .drag-handle-container,
.leaflet-layerstree-children[data-group-key="T_SYNTHESIS"] .leaflet-layerstree-node:last-of-type .drag-handle-container {
    border-bottom-right-radius: 10px;
}

/* État actif/sélectionné du layer */
.leaflet-layerstree-layer-span:has(input:checked) {
    background: rgba(var(--primary-color-rgb, 0, 123, 255), 0.2);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color);
}

/* .leaflet-layerstree-layer-span:has(input:checked) .drag-handle {
    background: var(--primary-color);
    color: white;
} */

.leaflet-layerstree-layer-span:has(input:checked)>span:last-of-type {
    color: var(--primary-color);
    font-weight: 600;
    overflow: hidden;
}

.div-slider {
    display: flex;
    align-items: center;
    width: 98%;
    margin-left: 30px;
    padding-left: 30px;
    transition: all .2s ease-in-out;
    max-height: 0px;
    opacity: 0;
    user-select: none;
    pointer-events: none;
}

/* Afficher le slider quand la couche est cochée */
.div-slider.enabled {
    max-height: 50px;
    opacity: 1;
    user-select: all;
    pointer-events: all;
}

.leaflet-native-slider {
    width: 100%;
}

/* Container du slider */

.leaflet-layerstree-slider {
    width: 90%;
    position: relative;
    float: left;
    transition: all .3s ease;
    display: flex;
    align-items: center;
}

.leaflet-layerstree-slider span.irs {
    height: 15px;
}

.leaflet-layerstree-slider span.irs-bar-edge,
.leaflet-layerstree-slider span.irs-bar,
.leaflet-layerstree-slider span.irs-line,
.leaflet-layerstree-slider span.irs-line span.irs-line-mid,
.leaflet-layerstree-slider span.irs-line span.irs-line-right,
.leaflet-layerstree-slider span.irs-line span.irs-line-left {
    background: none;
    background-color: rgb(70, 95, 115);
    top: 4px;
    height: 5px;
}

.leaflet-layerstree-slider span.irs-bar-edge {
    width: 5px;
    background-color: rgb(120, 160, 195);
}

.leaflet-layerstree-slider span.irs-bar {
    background-color: rgb(120, 160, 195);
}

.leaflet-layerstree-slider span.irs-slider.single {
    width: 10px;
    height: 10px;
    background: none;
    background-color: rgb(135, 190, 230);
    border: 1px solid white;
    top: 1px;
}


.leaflet-layerstree-slider:hover .leaflet-native-slider,
.leaflet-layerstree-slider:focus .leaflet-native-slider,
.leaflet-layerstree-slider:focus-visible .leaflet-native-slider {
    height: 5px;
    background: rgba(114, 175, 210, 0.7);
}




.leaflet-layerstree-slider .slider-value-label {
    position: absolute;
    left: -30px;
    text-align: center;
    font-size: 0.4rem;
    top: -2px;
    opacity: 0;
    transition: all 0.3s ease;
    color: var(--tertiary-color);
}

.leaflet-layerstree-slider:hover .slider-value-label {
    opacity: 1;
    color: var(--secondary-color);
}

/* Styles pour .leaflet-control-layers-list - Optimisé pour le drawer */
.leaflet-control-layers-list {
    /* Styles de base (hérités de Leaflet) */
    margin: 0;
    padding: 0;
    
    /* Styles optimisés pour le drawer */
    position: relative;
    max-height: none !important;
    overflow: visible !important;
    background-color: transparent;
    
    /* Layout optimisé */
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    width: 100%;
    height: 100%;
}


/******************************************************************************************************************************/
/*                                                                                                                            */
/*                                                              RESIZER                                                      */
/*                                                                                                                            */
/******************************************************************************************************************************/

.resizer-container {
    display: flex;
    border: 1px solid var(--primary-color);
    width: 100%;
    border-radius: 25px;
    height: 100%;
    background-color: #ffffffab;
}

.container__left {
    /* Initially, the left takes 3/4 width */
    width: 50%;
    align-items: center;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-width: 300px;
    position: relative;
    overflow: hidden;
    border-top-left-radius: 20px;
    border-bottom-left-radius: 20px;
}

.resizer {
    background-color: var(--primary-color);
    cursor: ew-resize;
    width: 8px;
    min-width: 8px;
    position: relative;
    transition: all 0.2s ease;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(1, 42, 83, 0.1);
    opacity: 0.8;
    transition: width 0.2s ease;
}

.resizer:hover {
    background-color: var(--accent-color);
    opacity: 0.6;
    width: 10px;
}


.resizer::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 1px;
    opacity: 1;
}

.resizer:hover::before {
    opacity: 0.6;
    height: 24px;
}

/* État actif pendant le redimensionnement */
.resizer.resizing {
    background-color: var(--accent-color-focus);
    width: 12px;
    opacity: 1;
}

.resizer.resizing::before {
    opacity: 1;
    height: 28px;
    background-color: rgba(255, 255, 255, 1);
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
}

.floating-inner {
    flex: 1;
    display: flex;
    justify-content: center;
    width: 100%;
    height: auto;
    position: relative;
    transition: top 0.2s ease;
    min-width: 300px;
    /* animation douce */
}

#id__right.container__right {
    flex: 1;
    height: auto;
    max-height: calc(100vh - 210px);
    align-items: center;
    display: flex;
    justify-content: center;
    padding: 10px;
    transform: translateY(0);
    overflow-y: auto;
    direction: rtl;
    min-width: 300px;
    padding-left: 10px;
    margin-left: 0;
    border-radius: 30px;
}

#id__right.container__right>* {
    direction: ltr;
}

/* Styles pour les icônes des drag handles */
.drag-handle-icon {
    font-size: 10px;
    line-height: 1;
}

.drag-handle-group-icon {
    font-size: 10px;
    line-height: 1;
}

.leaflet-layerstree-header label {
    cursor: pointer;
    justify-content: flex-start;
    align-items: center;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    background: rgba(0, 0, 0, 0.1);
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    padding: 2px 8px;
    margin: 0;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    background: var(--panel-bg-alt);
}

.leaflet-layerstree-node:last-of-type>.leaflet-layerstree-header label {
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
}