/* =====================================================
   LEAFLET LAYERS CONTROL – SIMTARU PRO SCROLLBAR
===================================================== */

/* CONTAINER UTAMA */
.leaflet-control-layers {
  max-height: 75vh;
  overflow: hidden;
  border-radius: 10px;
  scroll-behavior: smooth;
}

/* AREA SCROLL UTAMA */
.leaflet-control-layers-expanded {
  max-height: 75vh;
  overflow-y: auto;
  padding-right: 12px;
  scroll-behavior: smooth;
}

/* GROUP */
.leaflet-control-layers-group {
  margin-bottom: 10px;
  max-height: 320px;
  overflow: hidden;
  background: #f9fafb;
  border-radius: 8px;
  padding: 6px;
}

/* JUDUL GROUP – STICKY */
.leaflet-control-layers-group-name {
  position: sticky;
  top: 0;
  z-index: 2;
  font-weight: 600;
  font-size: 13px;
  padding: 8px;
  background: #e5e7eb;
  color: #1f2937;
    display: flex;
  border-radius: 6px;
}

/* SCROLL DALAM GROUP */
.leaflet-control-layers-scrollbar {
  max-height: 260px;
  overflow-y: auto;
  padding-right: 8px;
  scroll-behavior: smooth;
}

/* ITEM */
.leaflet-control-layers label {
  display: flex;
  align-items: center;
  font-size: 12px;
  margin: 4px 0;
  line-height: 1.5;
}

/* =====================================================
   SCROLLBAR BESAR + AUTO-HIDE
===================================================== */

/* WebKit (Chrome, Edge, Safari) */
.leaflet-control-layers-expanded::-webkit-scrollbar,
.leaflet-control-layers-scrollbar::-webkit-scrollbar {
  width: 14px;
}

.leaflet-control-layers-expanded::-webkit-scrollbar-thumb,
.leaflet-control-layers-scrollbar::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.65);
  border-radius: 12px;
  border: 4px solid transparent;
  background-clip: content-box;
  opacity: 0;
  transition: opacity 0.3s;
}

.leaflet-control-layers-expanded:hover::-webkit-scrollbar-thumb,
.leaflet-control-layers-scrollbar:hover::-webkit-scrollbar-thumb {
  opacity: 1;
}

.leaflet-control-layers-expanded::-webkit-scrollbar-track,
.leaflet-control-layers-scrollbar::-webkit-scrollbar-track {
  background: #e5e7eb;
  border-radius: 12px;
}

/* Firefox */
.leaflet-control-layers-expanded,
.leaflet-control-layers-scrollbar {
  scrollbar-width: thick;
  scrollbar-color: rgba(0,0,0,0.65) #e5e7eb;
}

/* =====================================================
   DARK MODE
===================================================== */

.map-dark .leaflet-control-layers {
  background: #1f2937;
  color: #e5e7eb;
}

.map-dark .leaflet-control-layers-group {
  background: #111827;
}

.map-dark .leaflet-control-layers-group-name {
  background: #374151;
  color: #e5e7eb;
}

.map-dark .leaflet-control-layers-expanded::-webkit-scrollbar-track,
.map-dark .leaflet-control-layers-scrollbar::-webkit-scrollbar-track {
  background: #374151;
}

.map-dark .leaflet-control-layers-expanded::-webkit-scrollbar-thumb,
.map-dark .leaflet-control-layers-scrollbar::-webkit-scrollbar-thumb {
  background-color: rgba(255,255,255,0.65);
}

/* =====================================================
   RESPONSIVE (MOBILE / TABLET)
===================================================== */

@media (max-width: 768px) {
  .leaflet-control-layers {
    max-height: 65vh;
    max-width: 92vw;
  }

  .leaflet-control-layers-expanded {
    max-height: 65vh;
    padding-right: 10px;
  }

  .leaflet-control-layers-group {
    max-height: 240px;
  }

  .leaflet-control-layers-scrollbar {
    max-height: 200px;
  }

  .leaflet-control-layers-expanded::-webkit-scrollbar,
  .leaflet-control-layers-scrollbar::-webkit-scrollbar {
    width: 12px;
  }
}
