
#map {
  height: 100vh;
  width: 100%;
}
.leaflet-container {
  background: #282424;
} /* samarkan grid tile kosong */

/* =============== JUDUL & INFO KANAN ATAS =============== */
.map-title {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 28px;
  font-weight: bold;
  color: #fff;
  z-index: 1000;
}
.info-container {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 15px 20px;
  border-radius: 8px;
}
.column-left {
  font-size: 14px;
}
.column-left span {
  color: #00ff00;
  font-size: 9px;
  font-weight: bold;
}
.column-right {
  text-align: right;
  font-size: 14px;
}
.highlight {
  font-size: 18px;
  font-weight: bold;
  color: #fff;
}
.separator {
  width: 2px;
  height: 30px;
  background: rgba(255, 255, 255, 0.2);
}

/* =============== ANCHOR KONTROL KIRI =============== */
.map-controls {
  position: absolute;
  inset: 0;
  z-index: 1100;
  pointer-events: none; /* kontainer transparan */
}
.map-controls .btn,
.map-controls .dropdown,
.map-controls .dropdown-menu {
  pointer-events: auto;
}

/* ==== POSISI tombol Basemap & Layers ==== */
.basemap-gallery-control {
  position: absolute;
  top: 180px;
  left: 12px;
}
.layers-control {
  position: absolute;
  top: 268px;
  left: 12px;
}

/* ==== TOMBOL kecil (ikon+label) ==== */
.basemap-toggle-btn,
.layers-toggle-btn {
  background: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
  border-radius: 12px;
  width: 70px;
  height: 78px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.basemap-toggle-btn::after,
.layers-toggle-btn::after {
  display: none !important;
}
.basemap-btn-content,
.layers-btn-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.basemap-icon,
.layers-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 6px;
  object-fit: contain;
}
.basemap-label,
.layers-label {
  font-size: 0.7rem;
  line-height: 1;
  color: #333;
}

/* ==== DROPDOWN (dropend) ==== */
.basemap-gallery-control .dropdown-menu,
.layers-control .dropdown-menu {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  min-width: 255px;
  margin-left: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

/* ==== Galeri basemap ==== */
.basemap-card {
  max-height: 320px;
  overflow-y: auto;
}
.basemap-item {
  cursor: pointer;
  border: 1px solid #e9ecef;
  border-radius: 10px;
  padding: 8px;
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 8px;
  align-items: center;
}
.basemap-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: #ddd center/cover;
  border: 1px solid #ccc;
}
.basemap-name {
  font-size: 0.92rem;
  margin: 0;
  font-weight: 600;
}
.basemap-desc {
  font-size: 0.75rem;
  margin: 0;
  color: #6c757d;
}

/* ==== Daftar Layers ==== */
.layers-menu {
  padding: 10px 12px;
}
.layer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 6px;
  border-radius: 10px;
}
.layer-item:hover {
  background: rgba(0, 0, 0, 0.04);
}
.form-check-input {
  cursor: pointer;
}
.form-check-label {
  cursor: pointer;
  user-select: none;
  font-size: 0.95rem;
}
.layer-item.form-switch .form-check-input {
    margin-left: 0.1rem !important;
}

/* Responsive kecil */
@media (max-width: 480px) {
  .basemap-gallery-control {
    top: 86px;
    left: 8px;
  }
  .layers-control {
    top: 168px;
    left: 8px;
  }
  .basemap-toggle-btn,
  .layers-toggle-btn {
    width: 62px;
    height: 72px;
  }
  .basemap-gallery-control .dropdown-menu,
  .layers-control .dropdown-menu {
    min-width: 210px;
  }
}

/* =============== CLUSTER BADGE =============== */
.prov-cluster {
  /* background: rgba(52, 124, 255, 0.9); */
  /* background: transparent url(../../map-perizinan/img/water.png) no-repeat; */
  background: #090979;
  background: radial-gradient(circle, rgba(9, 9, 121, 1) 0%, rgba(0, 212, 255, 1) 100%);
  color: #fff;
  /* border: 4px solid #fff; */
  border-radius: 999px;
  font: 600 12px/34px system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  width: 34px;
  height: 34px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

/* =============== PANES & POINTER EVENTS =============== */
#choroplethPane,
#interpPane,
#labelPane {
  pointer-events: none !important;
}
#markerPane {
  pointer-events: auto !important;
}
.leaflet-control-container {
  z-index: 1400 !important;
} /* pastikan +/– bisa diklik */
.leaflet-control-zoom {
  z-index: 1500 !important;
}
.leaflet-left {
    left: 0;
}
.leaflet-top {
    top: 95px;
}


/* =============== LEGEND =============== */
/* Legend statis (choropleth) */
.legend-container {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 1;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  padding: 10px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.legend-container h3 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: bold;
  text-align: left;
}
.legend-container h4 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: bold;
  text-align: left;
}
.legend {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.legend-color {
  width: 20px;
  height: 20px;
  border-radius: 3px;
  border: 1px solid #ddd;
}
.legend-label {
  font-size: 12px;
  color: #fff;
}

/* Legend dinamis (IDW) – dibuat via JS, class: .legend-container.gradient */
.legend-container.gradient {
  width: 220px;
}
.legend-container .legend-title {
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 13px;
}
.legend-container .legend-gradient {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(
    to right,
    #440154,
    #3b528b,
    #21918c,
    #5ec962,
    #fde725
  );
  margin: 6px 0 4px;
}
.legend-container .legend-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  opacity: 0.95;
}

/* =============== TOOLS (kiri, stack rapat) =============== */
.tools-control {
  position: absolute;
    right: 11px;
    bottom: 90px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}
.tool-btn {
  width: 48px;
  height: 48px;
  border: 0;
  outline: 0;
  display: grid;
  place-items: center;
  background: #ffffffee;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.tool-btn + .tool-btn {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.tool-btn:hover {
  background: #fff;
}
.tool-btn.active {
  background: #e8f0ff;
}
.tool-icn {
  font-size: 18px;
  line-height: 1;
}

/* =============== INFO BUTTON + MODAL =============== */
.info-control {
  position: absolute;
  /* left: 12px;
  top: 0; */
  z-index: 1100;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}
.info-control .tool-btn {
  width: 48px;
  height: 48px;
  background: #ffffffee;
}
.info-control .tool-btn:hover {
  background: #fff;
}

.info-modal[hidden] {
  display: none;
}
.info-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
}
.info-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
}
.info-modal__card {
  position: absolute;
  left: 50%;
  top: 60px;
  transform: translateX(-50%);
  width: min(680px, calc(100vw - 40px));
  background: #fff;
  color: #212121;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}
.info-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  font-weight: 700;
  font-size: 18px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.info-modal__close {
  border: 0;
  background: #f3f4f6;
  border-radius: 10px;
  width: 32px;
  height: 32px;
  cursor: pointer;
}
.info-modal__body {
  padding: 16px;
  line-height: 1.55;
}
.info-modal__footer {
  padding: 10px 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: #fafafa;
  color: #555;
}

/* =============== TEKS & TOOLTIP =============== */
.map-text-label {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 10px;
  padding: 4px 10px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.12);
  user-select: none;
}
.leaflet-tooltip.custom-label {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #fff;
  font-weight: bold;
  font-size: 20px;
  text-shadow: 0 0 3px #000;
  padding: 0 !important;
  margin: 0 !important;
  pointer-events: none;

}
.leaflet-tooltip.measure-label {
  padding: 2px 6px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 6px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
}

/* =============== PRINT =============== */
@page {
  size: landscape;
  margin: 10mm;
}
.legend-container,
.legend-color,
.legend-gradient {
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
@media print {
  html,
  body {
    background: #fff !important;
  }
  #map {
    position: fixed !important;
    inset: 0 !important;
    height: 100vh !important;
    width: 100vw !important;
  }
  /* biarkan UI penting tercetak */
  .legend-container,
  .map-controls,
  .tools-control,
  .leaflet-control-container {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
  .dropdown-menu,
  .info-modal {
    display: none !important;
  } /* jangan ikut tercetak */
}

/* ==== PETA TEMATIK: posisi & tumpukan ==== */
.thematic-control {
  position: absolute;
  top: 256px;
  left: 12px;
  z-index: 1301;
}

/* tombol mini bergaya sama seperti Base Map & Layers */
.thematic-toggle-btn {
  background: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
  border-radius: 12px;
  width: 70px;
  height: 78px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.thematic-toggle-btn::after {
  display: none !important;
}
.thematic-btn-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.thematic-icon {
  width: 22px;
  height: 22px;
  margin-bottom: 6px;
  object-fit: contain;
}
.thematic-label {
  font-size: 0.7rem;
  line-height: 1;
  color: #333;
}

/* dropdown menu tematik */
.thematic-control .dropdown-menu {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  min-width: 260px;
  margin-left: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.map-controls {
  z-index: 1300;
}
.tools-control {
  top: 344px;
  z-index: 1200;
}

/* Tooltip hover Konservasi AT */
.leaflet-tooltip.kat-hover,
.leaflet-tooltip.thematic-hover {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.15);
  color: #222;
  font-size: 12.5px;
  padding: 6px 8px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* ===== Legend Tematik (pojok kanan bawah) ===== */
.thematic-legend {
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
  font-size: 0.85rem;
  color: #ffffff;
}
.thematic-legend .title {
  font-weight: 700;
  margin-bottom: 6px;
}
.thematic-legend .section {
  margin-top: 8px;
}
.thematic-legend .item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
}
.thematic-legend .swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.2);
}
