@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

html, body, #map {
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
}
#sidebar {
    position: absolute;
    top: 0; 
    left: 0; 
    width: 256px !important;
    height: 100vh;
    padding: 20px;
    background-color: rgba(252, 252, 252); 
    overflow-y: auto;
    z-index: 800; 
    box-shadow: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: translateX(-100%); 
    pointer-events: none;
    scrollbar-width: none;
}
#sidebar.visible {
    transform: translateX(0); 
    display: block;
    opacity: 1;
    pointer-events: auto;
    box-shadow: 6px 0 20px rgba(0,0,0,0.5);
}
.opacity-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 256px !important;
    height: 100vh;
    padding: 20px;
    background-color: rgba(252, 252, 252);
    overflow-y: auto;
    z-index: 800;
    box-shadow: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: translateX(-100%);
    pointer-events: none;
    font-weight: normal;
    scrollbar-width: none;
}
.opacity-slider.visible {
    transform: translateX(0px);
    display: block;
    opacity: 1;
    pointer-events: auto;
    box-shadow: 6px 0 20px rgba(0,0,0,0.5);
}
.filter-group {
    margin-bottom: 20px;
}
.filter-group label {
    display: block;
    margin-bottom: 5px;
}
.filter-group ul {
    list-style-type: none;
    padding: 0;
    max-height: 150px; 
    overflow-y: auto; 
}
.filter-group button {
    margin-top: 5px;
    padding: 5px;
    width: 100%;
    cursor: pointer;
}
.radio-option {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}
.radio-option input[type="radio"] {
    margin-right: 10px;
    vertical-align: middle;
    margin: 0;
}
.radio-option label {
    margin: 0; 
    margin-left: 5px;
    vertical-align: middle; 
    line-height: 1.2;
}
.filter-button {
    position: absolute;
    top: 100px;
    right: 10px;
    border-radius: 3px;
    z-index: 950;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    padding: 3px;
    background-color: rgba(252, 252, 252, 0.96);
    border: 3px solid rgba(0, 0, 0, 0.3);
    cursor: pointer;
    max-height: 24px;
}
.opacity-slider input[type=range] {
    width: 100%;
    margin-bottom: 20px;
}
.layer-label {
    font-size: 12px;
    margin-bottom: 5px;
}
.toggle-opacity-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    border-radius: 3px;
    z-index: 950;
    padding: 3px;
    max-width: 24px;
    max-height: 24px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    border: 3px solid rgba(0, 0, 0, 0.3);
    background-color: rgba(252, 252, 252, 0.96);
    cursor: pointer;
}
.leaflet-bottom.leaflet-right {
    display: none !important;
}
.layer-item {
    margin-bottom: 20px; 
}
.leaflet-control-measure .js-toggle {
    position: fixed; !important;  
    right: 10px !important;
}
.collapsible-group {
    border-bottom: 1px solid #d9d9d9;
    margin-top: 10px;
}
.collapsible-content {
    display: none;
    transition: max-height 0.2s ease-out;
}
.collapsible {
    cursor: pointer;
    position: relative;
    left: 12px;
    display: flex;
    align-items: center;
    font-family: 'Roboto';
}
.collapsible::before {
    content: "▶"; 
    margin-right: 12px;
    font-size: 12px;
    transition: transform 0.2s ease;
}
.collapsible.active::before {
    transform: rotate(90deg); /* triangle vers le bas quand ouvert */
}
.leaflet-control-locate {
    display: none !important;
}
#customLocateBtn {
    position: absolute;
    top: 145px; 
    right: 10px;
    border-radius: 3px;
    z-index: 950;
    padding: 3px;
    max-width: 24px;
    max-height: 24px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    border: 3px solid rgba(0, 0, 0, 0.3);
    background-color: rgba(252, 252, 252, 0.96);
    cursor: pointer;
}
#openSearchBar {
    position: absolute;
    top: 190px;
    right: 10px;
    border-radius: 3px;
    z-index: 950;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    padding: 3px;
    background-color: rgba(252, 252, 252, 0.96);
    border: 3px solid rgba(0, 0, 0, 0.3);
    cursor: pointer;
    max-height: 24px;
}
.search-bar {
    position: absolute;
    top: 190px; /* Ajuste selon la position du bouton */
    right: 50px;
    z-index: 1000;
    background: rgba(252,252,252,0.96);
    border: 3px solid rgba(0,0,0,0.3);
    border-radius: 3px;
    padding: 5px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    display: none;
    height: 20px;
}
.search-wrapper {
    position: relative;
    height: 100%;
    background-color: white;
}
.search-wrapper input {
    height: 100%;
    width: 180px;
    padding: 0 30px 0 6px;
    border: none;
    border-radius: 3px;
    font-size: 14px;
}
.search-wrapper button {
    position: absolute;
    right: 2px;
    top: 0px;
    height: 20px;
    width: 24px;
    border: none;
    background: none;
    font-size: 14px;
    cursor: pointer;
    color: #333;
}
#searchInput:focus {
    outline: none;
    box-shadow: none;
    border-color: transparent;
}
.checkbox-group label {
    cursor: pointer;
    color: #333;
    font-weight: 300;
    font-family: 'Roboto';
    transition: color 0.2s ease, font-weight 0.2s ease;
}
.checkbox-group input[type="checkbox"] {
    display: none;
}
.checkbox-group input[type="checkbox"]:checked + span,
.checkbox-group input[type="checkbox"]:checked ~ label,
.checkbox-group input[type="checkbox"]:checked:parent {
    color: #0078d7;
    font-weight: 450;
    text-shadow: 0 0 6px rgba(0, 120, 215, 0.6);
}
.checkbox-group label:has(input[type="checkbox"]:checked) {
    color: #0078d7;
    font-weight: 450;
    text-shadow: 0 0 6px rgba(0, 120, 215, 0.6);
}

#coord-toast {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 14px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1000;
  font-family: 'Roboto', sans-serif;
}
#coord-toast.show {
  opacity: 1;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, #ABC7DE, #0078d7);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

/* Curseur */
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    border: 2px solid #0078d7;
    transition: transform 0.2s ease;
}
input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    border: 2px solid #0078d7;
    transition: transform 0.2s ease;
}
input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
}
#blackOpacity {
    background: linear-gradient(90deg, #D1D1D1, #000000);
}
#blackOpacity::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    border: 2px solid #000000; /* bordure noire */
    transition: transform 0.2s ease;
}
#blackOpacity::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

#blackOpacity::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    border: 2px solid #000000; /* bordure noire */
    transition: transform 0.2s ease;
}
#blackOpacity::-moz-range-thumb:hover {
    transform: scale(1.2);
}