:root {
  --bg-primary: #0b0f17;
  --bg-secondary: #121824;
  --bg-card: rgba(22, 30, 46, 0.75);
  --bg-card-hover: rgba(28, 38, 58, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #00f2fe;

  --text-main: #f0f4f8;
  --text-muted: #8b9bb4;
  --text-dim: #5c6b84;

  --accent-cyan: #00f2fe;
  --accent-teal: #4facfe;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #8b5cf6;

  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --sidebar-width: 420px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  position: relative;
}

/* Sidebar Frame */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.sidebar-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(18, 24, 36, 1) 0%, rgba(18, 24, 36, 0.8) 100%);
}

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

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-teal));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0b0f17;
}

.brand-title {
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, #fff, #b8c7db);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tagline {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  display: block;
}

.team-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 8px;
  background: rgba(0, 242, 254, 0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.3);
  border-radius: 20px;
}

.sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-body::-webkit-scrollbar {
  width: 5px;
}
.sidebar-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}

.sidebar-footer {
  padding: 12px 24px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
  background-color: var(--bg-primary);
}

/* Map Viewport */
.map-viewport {
  flex: 1;
  height: 100vh;
  position: relative;
}

#map {
  width: 100%;
  height: 100%;
  background-color: #0a0e14;
}

/* Leaflet Dark Filter Overrides */
.leaflet-container {
  background: #0b0f17 !important;
}
.leaflet-tile {
  filter: brightness(0.65) invert(1) contrast(3) hue-rotate(200deg) saturate(0.35);
}

/* ========================================================
   FEATURE 1: RESPIRATION & HEALTH IMPACT CALCULATOR STYLES
   ======================================================== */
.health-impact-card {
  margin-top: 14px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: var(--transition);
}

.health-impact-card:hover {
  border-color: rgba(0, 242, 254, 0.25);
  background: rgba(18, 28, 48, 0.8);
}

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

.health-card-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.health-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(16, 185, 129, 0.3);
  letter-spacing: 0.04em;
}

.health-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.health-metric-box {
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
}

.metric-subtitle {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.metric-highlight {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
}

.metric-highlight.text-emerald {
  color: var(--accent-emerald);
}

.lung-equiv-box {
  background: rgba(16, 185, 129, 0.08);
  border-left: 3px solid var(--accent-emerald);
  border-radius: 4px;
  padding: 8px 10px;
}

.lung-equiv-text {
  font-size: 0.74rem;
  color: var(--text-main);
  line-height: 1.45;
  margin: 0;
}

.lung-equiv-text b {
  color: var(--accent-cyan);
}

/* ========================================================
   FEATURE 2 & 3: CLICK-TO-ROUTE & WIND VECTOR HUD STYLES
   ======================================================== */
.btn-click-route-toggle:hover {
  background: rgba(0, 242, 254, 0.25) !important;
  border-color: var(--accent-cyan) !important;
}

.click-route-status {
  animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Floating Wind Vector Indicator HUD */
.wind-hud {
  position: absolute;
  top: 20px;
  right: 60px; /* Positioned on the top-right of the map view */
  z-index: 999;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(0, 242, 254, 0.25);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.wind-hud-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wind-icon {
  display: inline-block;
  font-size: 1.25rem;
  color: var(--accent-cyan);
  font-weight: 800;
  transform: rotate(45deg);
  transition: transform 0.4s ease;
}

.wind-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
}

.wind-data {
  font-size: 0.82rem;
  color: var(--text-main);
  font-family: var(--font-mono);
}

.wind-data b {
  color: var(--accent-cyan);
}

/* ========================================================
   FEATURE 4: MUNICIPAL GREEN BUFFER CORRIDOR STYLES
   ======================================================== */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(148, 163, 184, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 20px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: #cbd5e1;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: #10b981;
  border-color: #34d399;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

input:checked + .toggle-slider:before {
  transform: translateX(18px);
  background-color: #ffffff;
}

.eco-benefit-box {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-top: 10px;
}

.eco-benefit-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  color: #10b981;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 3px;
}

.eco-benefit-text {
  font-size: 0.72rem;
  color: #cbd5e1;
  line-height: 1.4;
  margin: 0;
}

.eco-benefit-text b {
  color: #34d399;
}