/* ==========================================================================
   DKI JAKARTA COMMERCIAL FUNDING & TRANSACTION INTELLIGENCE
   css/style.css

   Styling pendukung di luar utility Tailwind: dark mode Leaflet controls,
   custom scrollbar, filter widget, dan micro-interactions (pulse, hover,
   transisi state).
   ========================================================================== */

html, body {
  height: 100%;
}

#map {
  background: #020617; /* slate-950 */
}

/* ==========================================================================
   LEAFLET DARK MODE OVERRIDES
   ========================================================================== */

.leaflet-container {
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  background: #020617;
  outline: none;
}

.leaflet-control-zoom {
  border: 1px solid rgba(51, 65, 85, 0.8) !important;
  border-radius: 10px !important;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
}

.leaflet-control-zoom a {
  background-color: rgba(15, 23, 42, 0.92) !important;
  color: #e2e8f0 !important;
  border-color: rgba(51, 65, 85, 0.8) !important;
}

.leaflet-control-zoom a:hover {
  background-color: rgba(16, 185, 129, 0.18) !important;
  color: #34d399 !important;
}

.leaflet-control-attribution {
  background: rgba(2, 6, 23, 0.75) !important;
  color: #64748b !important;
  font-size: 10px !important;
  padding: 2px 8px !important;
  border-radius: 8px 0 0 0 !important;
}

.leaflet-control-attribution a {
  color: #38bdf8 !important;
}

/* Tooltip kecamatan */
.jakarta-tooltip {
  background: rgba(15, 23, 42, 0.95) !important;
  color: #e2e8f0 !important;
  border: 1px solid rgba(51, 65, 85, 0.9) !important;
  border-radius: 10px !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
  padding: 8px 12px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}

.jakarta-tooltip::before {
  display: none !important;
}

/* Dark dimmed mask di luar kontur DKI Jakarta */
.jakarta-dark-mask {
  pointer-events: none;
}

/* ==========================================================================
   PRIORITY PULSE MARKER (kecamatan dengan skor CASA tertinggi)
   ========================================================================== */

.priority-pulse-wrapper {
  position: relative;
}

.priority-pulse-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 999px;
  background: #fbbf24;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.9);
  z-index: 2;
}

.priority-pulse-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.55);
  animation: priorityPulse 2.2s ease-out infinite;
}

@keyframes priorityPulse {
  0% {
    transform: scale(1);
    opacity: 0.75;
  }
  100% {
    transform: scale(4.2);
    opacity: 0;
  }
}

/* ==========================================================================
   CLUSTER FILTER WIDGET
   ========================================================================== */

.cluster-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  border: 1px solid rgba(51, 65, 85, 0.8);
  background: rgba(2, 6, 23, 0.82);
  backdrop-filter: blur(8px);
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.18s ease;
}

.cluster-filter-btn:hover {
  color: #e2e8f0;
  border-color: rgba(16, 185, 129, 0.5);
}

.cluster-filter-btn.is-active-filter {
  background: linear-gradient(120deg, #10b981, #0d9488);
  border-color: transparent;
  color: #022c22;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

/* ==========================================================================
   CUSTOM SCROLLBAR — Panel Analitik
   ========================================================================== */

.custom-scrollbar::-webkit-scrollbar {
  width: 7px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(16, 185, 129, 0.28);
  border-radius: 999px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(16, 185, 129, 0.5);
}

.custom-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: rgba(16, 185, 129, 0.35) transparent;
}

/* ==========================================================================
   MICRO-INTERACTIONS
   ========================================================================== */

#analytics-panel > div {
  animation: panelFadeIn 0.35s ease;
}

@keyframes panelFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.action-check.is-done i[data-lucide="check"] {
  stroke: #022c22;
}

/* ==========================================================================
   ACCESSIBILITY — Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .priority-pulse-ring {
    animation: none;
    opacity: 0;
  }
  #analytics-panel > div {
    animation: none;
  }
  .cluster-filter-btn,
  .action-check {
    transition: none;
  }
}
