/* ==========================================================================
   PEMANTAUAN TITIK API - MENCEGAH KEBAKARAN HUTAN
   ========================================================================== */

:root {
  /* Color Palette - Deep Space & Magma Fire Accent */
  --bg-dark: #0b0f19;
  --bg-card: rgba(18, 24, 41, 0.78);
  --bg-card-hover: rgba(28, 37, 61, 0.85);
  --border-glass: rgba(255, 255, 255, 0.09);
  --border-glass-bright: rgba(255, 255, 255, 0.18);
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;

  /* Fire Status Colors */
  --fire-orange: #ff5722;
  --fire-red: #ef4444;
  --fire-amber: #f59e0b;
  --fire-yellow: #eab308;
  --cyan-neon: #06b6d4;
  --green-online: #10b981;
  --purple-aqi: #8b5cf6;

  /* Fonts */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* UI Dimensions */
  --nav-height: 64px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-glow-red: 0 0 20px rgba(239, 68, 68, 0.35);
  --shadow-glow-orange: 0 0 20px rgba(249, 115, 22, 0.35);
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Background Animated Glow Mesh */
.bg-glow-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.22;
  animation: floatGlow 18s ease-in-out infinite alternate;
}

.glow-1 {
  top: -10%;
  left: 10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, #ff4500, #b91c1c);
}

.glow-2 {
  bottom: -15%;
  right: 5%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, #0284c7, #4f46e5);
  animation-delay: -9s;
}

@keyframes floatGlow {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 30px) scale(1.1); }
  100% { transform: translate(-30px, -20px) scale(0.95); }
}

/* Glassmorphism Common Utilities */
.glass-nav {
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
}

.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: var(--transition-fast);
}

.glass-card:hover {
  border-color: var(--border-glass-bright);
}

/* Header Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-height);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon-wrapper {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(249, 115, 22, 0.3));
  border: 1px solid rgba(249, 115, 22, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--fire-orange);
  box-shadow: var(--shadow-glow-orange);
}

.fire-svg-logo {
  width: 26px;
  height: 26px;
  filter: drop-shadow(0 0 8px rgba(255, 85, 0, 0.7));
  animation: pulseFireSvg 2s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

@keyframes pulseFireSvg {
  0% { transform: scale(0.96); filter: drop-shadow(0 0 6px rgba(255, 85, 0, 0.6)); }
  100% { transform: scale(1.12); filter: drop-shadow(0 0 16px rgba(255, 0, 85, 0.9)); }
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.1;
}

.text-gradient-fire {
  background: linear-gradient(135deg, #ff7b00, #ff0055);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

/* Nav Search */
.nav-search {
  position: relative;
  flex: 1;
  max-width: 380px;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-dim);
  font-size: 14px;
}

.nav-search input {
  width: 100%;
  padding: 9px 36px 9px 38px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  border-radius: 99px;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13px;
  outline: none;
  transition: var(--transition-fast);
}

.nav-search input:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--cyan-neon);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.25);
}

.search-clear-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
}

/* Nav Actions Buttons */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.system-status-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
}

.status-dot.online {
  background: var(--green-online);
  box-shadow: 0 0 8px var(--green-online);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-glass-bright);
}

.btn-primary-glow {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  border: none;
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.btn-primary-glow:hover {
  background: linear-gradient(135deg, #0369a1, #1d4ed8);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.6);
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  border: none;
  color: #fff;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #b91c1c, #991b1b);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
}

/* Error Banner */
.error-banner {
  margin: 10px 20px 0;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  font-weight: 500;
}

.error-banner button {
  background: none;
  border: none;
  color: #fca5a5;
  font-size: 16px;
  cursor: pointer;
}

/* Main Container */
.main-container {
  position: relative;
  z-index: 10;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.kpi-card {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
}

.kpi-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.kpi-info {
  display: flex;
  flex-direction: column;
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
}

.kpi-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-top: 3px;
}

.kpi-subtext {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 2px;
}

.border-left-danger { border-left: 4px solid var(--fire-red); }
.border-left-warning { border-left: 4px solid var(--fire-orange); }
.border-left-info { border-left: 4px solid var(--fire-yellow); }
.border-left-aqi { border-left: 4px solid var(--cyan-neon); }

.text-fire { color: var(--fire-orange); }
.text-danger { color: var(--fire-red); }
.text-warning { color: var(--fire-orange); }
.text-yellow { color: var(--fire-yellow); }
.text-cyan { color: var(--cyan-neon); }
.text-accent { color: #38bdf8; }

/* Split Content Layout */
.content-split-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 16px;
  min-height: calc(100vh - 240px);
}

/* Map Wrapper */
.map-wrapper {
  position: relative;
  min-height: 520px;
  overflow: hidden;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 520px;
  border-radius: var(--radius-md);
  z-index: 1;
}

/* Custom Floating Map Controls */
.map-floating-controls {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 500;
}

.map-control-group {
  padding: 6px;
  display: flex;
  gap: 6px;
  background: rgba(11, 15, 25, 0.85);
}

.map-btn {
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.map-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--cyan-neon);
}

.map-btn.active {
  background: var(--cyan-neon);
  color: #000;
  border-color: var(--cyan-neon);
}

/* Map Legend */
.map-legend {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 500;
  padding: 12px 14px;
  background: rgba(11, 15, 25, 0.88);
  max-width: 220px;
}

.legend-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.legend-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.dot-danger { background: var(--fire-red); box-shadow: 0 0 6px var(--fire-red); }
.dot-warning { background: var(--fire-orange); }
.dot-info { background: var(--fire-yellow); }
.dot-user { background: #3b82f6; box-shadow: 0 0 8px #3b82f6; }

.legend-divider {
  border: 0;
  border-top: 1px solid var(--border-glass);
  margin: 4px 0;
}

.legend-subtitle {
  font-size: 10px;
  color: var(--text-dim);
}

.aqi-color-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}

.aqi-color-bar span {
  flex: 1;
}

/* Command Drawer / Sidebar Panel */
.command-drawer {
  display: flex;
  flex-direction: column;
  padding: 16px;
  overflow: hidden;
}

.drawer-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}

.tab-btn {
  flex: 1;
  padding: 8px 6px;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: var(--transition-fast);
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid var(--border-glass-bright);
}

/* Tab Panes */
.tab-pane {
  display: none;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  max-height: calc(100vh - 300px);
  padding-right: 4px;
}

.tab-pane.active {
  display: flex;
}

.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pane-header h4 {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  padding: 3px 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
}

/* User Location Box */
.location-status-box {
  padding: 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(2, 132, 199, 0.12);
  border-color: rgba(2, 132, 199, 0.3);
}

.loc-icon {
  color: #38bdf8;
  font-size: 16px;
  margin-top: 2px;
}

.loc-title {
  font-size: 12px;
  font-weight: 700;
}

.loc-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Hotspot List Items */
.hotspot-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hotspot-card-item {
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}

.hotspot-card-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--fire-orange);
}

.hotspot-item-info {
  display: flex;
  flex-direction: column;
}

.hotspot-item-title {
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hotspot-item-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.hotspot-dist-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 99px;
  white-space: nowrap;
}

.dist-danger { background: rgba(239, 68, 68, 0.2); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.4); }
.dist-warning { background: rgba(249, 115, 22, 0.2); color: #fdba74; border: 1px solid rgba(249, 115, 22, 0.4); }
.dist-info { background: rgba(234, 179, 8, 0.2); color: #fef08a; border: 1px solid rgba(234, 179, 8, 0.4); }

.empty-state {
  padding: 30px;
  text-align: center;
  color: var(--text-dim);
}

.empty-state i {
  font-size: 28px;
  margin-bottom: 8px;
}

/* AQI Panel Layout */
.aqi-hero-card {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(139, 92, 246, 0.15));
}

.aqi-score-badge {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--cyan-neon);
  color: #000;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
  flex-shrink: 0;
}

.aqi-status-group h3 {
  font-size: 16px;
  font-weight: 700;
}

.aqi-status-group p {
  font-size: 11px;
  color: var(--text-muted);
}

.pollutant-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.pollutant-card {
  padding: 10px 12px;
  text-align: center;
}

.pol-name {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
}

.pol-val {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  margin: 2px 0;
}

.pol-unit {
  font-size: 9px;
  color: var(--text-dim);
}

.health-advice-card {
  padding: 14px;
  font-size: 12px;
}

.health-advice-card h5 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #38bdf8;
}

/* Filter Controls */
.filter-controls-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group select,
.form-group input[type="range"] {
  width: 100%;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 12px;
  outline: none;
}

.form-group select option {
  background: #111827;
  color: #fff;
}

.sensor-info-card {
  padding: 12px;
  background: rgba(6, 182, 212, 0.08);
  border-left: 3px solid var(--cyan-neon);
  border-radius: var(--radius-sm);
  margin-top: 4px;
}

.sensor-info-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan-neon);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.sensor-info-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.export-actions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-glass);
}

.export-actions h5 {
  font-size: 12px;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.btn-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

/* Analytics Chart Container */
.chart-container {
  padding: 12px;
  max-height: 220px;
}

/* Alert Modal */
.alert-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.alert-modal.active {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.alert-content {
  max-width: 480px;
  width: 100%;
  padding: 20px;
  background: #111827;
  border-color: rgba(239, 68, 68, 0.6);
  box-shadow: 0 0 40px rgba(239, 68, 68, 0.4);
}

.alert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.alert-badge {
  padding: 4px 12px;
  border-radius: 99px;
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  font-weight: 700;
  font-size: 11px;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
}

.alert-body h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--fire-red);
}

.alert-details-grid {
  margin: 12px 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  font-size: 12px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.alert-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
}

/* Footer Bar */
.footer-bar {
  padding: 12px 20px;
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  gap: 16px;
}

.footer-left {
  flex: 1;
  text-align: left;
}

.footer-center {
  flex: 1;
  text-align: center;
  font-weight: 600;
  color: var(--text-main);
}

.footer-right {
  flex: 1;
  text-align: right;
}

/* Custom Leaflet Dark Override & Popup Styling */
.leaflet-popup-content-wrapper {
  background: rgba(15, 23, 42, 0.94) !important;
  backdrop-filter: blur(12px) !important;
  border: 1px solid var(--border-glass-bright) !important;
  color: var(--text-main) !important;
  border-radius: 14px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6) !important;
}

.leaflet-popup-tip {
  background: rgba(15, 23, 42, 0.94) !important;
}

.leaflet-popup-content {
  margin: 12px 14px !important;
  line-height: 1.5 !important;
  font-family: var(--font-sans) !important;
}

.popup-title {
  font-weight: 800;
  font-size: 15px;
  color: var(--fire-orange);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.popup-location-box {
  padding: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  font-size: 12px;
  margin-bottom: 8px;
  color: #e2e8f0;
}

.popup-table {
  width: 100%;
  font-size: 11px;
  border-collapse: collapse;
}

.popup-table td {
  padding: 3px 0;
}

.popup-table td:first-child {
  color: var(--text-muted);
  width: 90px;
}

.popup-table td:last-child {
  font-weight: 600;
  text-align: right;
}

.popup-actions {
  margin-top: 10px;
  display: flex;
  gap: 6px;
}

.popup-btn {
  flex: 1;
  padding: 6px 10px;
  font-size: 11px;
  border-radius: 6px;
}

/* Pulsing Custom Marker */
.fire-marker-pulse {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  position: relative;
}

.fire-marker-pulse::after {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 2px solid currentColor;
  animation: markerRipple 1.6s ease-out infinite;
}

@keyframes markerRipple {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   RESPONSIVE DESIGN BREAKPOINTS (Desktop, Tablet, Mobile)
   ========================================================================== */

@media (max-width: 1024px) {
  .content-split-layout {
    grid-template-columns: 1fr 340px;
  }
}

@media (max-width: 868px) {
  .navbar {
    padding: 0 14px;
  }

  .nav-btn-label {
    display: none;
  }

  .nav-search {
    max-width: 200px;
  }

  .content-split-layout {
    grid-template-columns: 1fr;
  }

  .map-wrapper {
    min-height: 420px;
  }

  .command-drawer {
    max-height: none;
  }

  .tab-pane {
    max-height: 450px;
  }

  .footer-bar {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .main-container {
    padding: 8px;
    gap: 10px;
  }

  /* KPI Cards grid on Mobile: compact 3-column with scaled fonts */
  .kpi-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .kpi-card {
    padding: 8px 10px;
    gap: 8px;
    border-radius: 10px;
  }

  .kpi-icon-box {
    width: 32px;
    height: 32px;
    font-size: 14px;
    border-radius: 8px;
  }

  .kpi-value {
    font-size: 16px;
  }

  .kpi-label {
    font-size: 8.5px;
    letter-spacing: 0;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .kpi-subtext {
    font-size: 8px;
    display: none;
  }

  /* Map & Floating controls */
  .map-wrapper {
    min-height: 360px;
  }

  #map {
    min-height: 360px;
  }

  .map-floating-controls {
    top: 6px;
    left: 6px;
  }

  .map-btn {
    padding: 5px 8px;
    font-size: 11px;
  }

  /* Legenda Peta (Map Legend) Mobile Scaling */
  .map-legend {
    bottom: 8px;
    right: 8px;
    max-width: 145px;
    padding: 6px 8px;
    font-size: 9.5px;
    background: rgba(11, 15, 25, 0.92);
    border-radius: 10px;
  }

  .legend-header {
    font-size: 9.5px;
    margin-bottom: 4px;
  }

  .legend-items {
    font-size: 9px;
    gap: 3px;
  }

  .dot {
    width: 7px;
    height: 7px;
  }

  .aqi-color-bar {
    height: 5px;
  }

  /* Command Drawer Right Panel Mobile Scaling */
  .command-drawer {
    padding: 10px;
    border-radius: 14px;
  }

  .drawer-tabs {
    gap: 2px;
    padding: 2px;
  }

  .tab-btn {
    padding: 6px 4px;
    font-size: 10px;
    gap: 3px;
  }

  .tab-btn i {
    font-size: 11px;
  }

  .pane-header h4 {
    font-size: 12.5px;
  }

  /* Hotspot Cards inside Drawer */
  .hotspot-card-item {
    padding: 8px 10px;
  }

  .hotspot-item-title {
    font-size: 11.5px;
  }

  .hotspot-item-meta {
    font-size: 9.5px;
  }

  .hotspot-dist-badge {
    font-size: 11px;
    padding: 2px 7px;
  }

  /* AQI Hero & Pollutants */
  .aqi-hero-card {
    padding: 10px 12px;
    gap: 10px;
  }

  .aqi-score-badge {
    width: 46px;
    height: 46px;
    font-size: 16px;
  }

  .aqi-status-group h3 {
    font-size: 13.5px;
  }

  .pollutant-card {
    padding: 6px 8px;
  }

  .pol-val {
    font-size: 14px;
  }

  /* Filter Inputs */
  .form-group label {
    font-size: 10px;
  }

  .form-group select,
  .form-group input[type="range"] {
    padding: 7px 10px;
    font-size: 11px;
  }

  .sensor-info-card {
    padding: 8px 10px;
  }

  .sensor-info-title {
    font-size: 10px;
  }

  .sensor-info-desc {
    font-size: 10px;
  }
}

@media (max-width: 420px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .brand-title {
    font-size: 13.5px;
  }

  .logo-icon-wrapper {
    width: 34px;
    height: 34px;
  }

  .fire-svg-logo {
    width: 22px;
    height: 22px;
  }
}
