/* ObservaFEN - Design System Master Stylesheet (high-impact-web-design) */
/* Style Fusion: Bauhaus Mobile + Swiss Modernism 2.0 + Accessible & Ethical on Warm Paper */

@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:ital,wght@0,400;0,700;1,400&family=JetBrains+Mono:wght@600;800&family=Outfit:wght@700;800;900&display=swap');

:root {
  /* Warm Matte Paper Canvas (Outdoor sunlight anti-glare, e-ink inspired) */
  --bg-canvas: #F4F3EE;
  --bg-surface: #FFFFFF;
  --bg-subtle: #EAE8E0;

  /* Ink & Strong Structural Borders (Bauhaus / Swiss Modernism 2.0) */
  --ink-primary: #090D16;
  --ink-secondary: #334155;
  --border-strong: #090D16;

  /* Civil Traffic Light Semáforo */
  --alert-green-bg: #047857;
  --alert-green-tint: #ECFDF5;
  --alert-yellow-bg: #FACC15;
  --alert-yellow-tint: #FEFCE8;
  --alert-orange-bg: #EA580C;
  --alert-orange-tint: #FFF7ED;
  --alert-red-bg: #DC2626;
  --alert-red-tint: #FEF2F2;

  /* Hydro Brand Accent */
  --hydro-blue: #0284C7;

  /* Scientific / Operational dark theme */
  --bg-ops: #06090e;
  --bg-card: rgba(13, 20, 32, 0.75);
  --border-card: rgba(30, 41, 59, 0.7);
  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
}

/* Base Document Styling */
body {
  font-family: 'Atkinson Hyperlegible', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink-primary);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.mode-citizen {
  background-color: var(--bg-canvas);
  color: var(--ink-primary);
}

body.mode-scientific {
  background-color: var(--bg-ops);
  color: #f1f5f9;
}

/* Typography Utility Classes */
.font-display {
  font-family: 'Outfit', sans-serif;
}

.font-citizen {
  font-family: 'Atkinson Hyperlegible', sans-serif;
}

.font-mono-numbers {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
}

/* 1. Civic Card Block (Editorial Clean Technical Style) */
.civic-block {
  background: #FFFFFF;
  border: 1.5px solid #CBD5E1;
  border-radius: 0.75rem; /* rounded-xl (12px) */
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.civic-block-hero {
  background: #FFFFFF;
  border: 1.5px solid #1E293B;
  border-radius: 1rem; /* rounded-2xl (16px) */
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.07);
}

/* 2. Tactile Mechanical Button (Accessible & Clean Touch) */
.civic-btn {
  min-height: 44px;
  padding: 10px 18px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border: 1.5px solid #090D16;
  border-radius: 9999px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.1);
  transition: transform 80ms linear, box-shadow 80ms linear, background-color 120ms ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  user-select: none;
  text-decoration: none;
}

.civic-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

/* 3. Civic Pill Selection Tabs */
.civic-pill {
  min-height: 38px;
  padding: 6px 14px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.8125rem;
  border: 1.5px solid #CBD5E1;
  border-radius: 9999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 120ms ease;
  user-select: none;
}

.civic-pill:active {
  transform: translateY(1px);
}

.civic-pill-active {
  background: #090D16;
  color: #FFFFFF;
  border-color: #090D16;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}

.civic-pill-inactive {
  background: #FFFFFF;
  color: #334155;
}

.civic-pill-inactive:hover {
  background: #F8FAFC;
  border-color: #94A3B8;
}

/* 4. Top Dual Mode Switcher */
.mode-toggle-btn {
  min-height: 36px;
  padding: 6px 14px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1px solid transparent;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 100ms ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.mode-toggle-active {
  background: #090D16;
  color: #FFFFFF;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.mode-toggle-inactive {
  background: transparent;
  color: #475569;
}

.mode-toggle-inactive:hover {
  background: #E2E8F0;
  color: #0F172A;
}

/* 4b. Vertical Traffic Light (Semáforo 3 Luces) */
.traffic-glow-red {
  box-shadow: 0 0 14px rgba(220, 38, 38, 0.85);
}

.traffic-glow-yellow {
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.85);
}

.traffic-glow-green {
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.85);
}

/* 5. Mobile Map Containment */
.map-contain {
  overscroll-behavior: contain;
  touch-action: pan-x pan-y;
}

/* 6. Scientific Mode Operational Cards & Effects */
.ops-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: 0.75rem;
  transition: all 0.2s ease-in-out;
}

.ops-card:hover {
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
}

@keyframes pulse-glow-red {
  0%, 100% {
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.5), inset 0 0 15px rgba(239, 68, 68, 0.2);
  }
  50% {
    box-shadow: 0 0 35px rgba(239, 68, 68, 0.8), inset 0 0 25px rgba(239, 68, 68, 0.4);
  }
}

@keyframes pulse-glow-orange {
  0%, 100% {
    box-shadow: 0 0 12px rgba(249, 115, 22, 0.4);
  }
  50% {
    box-shadow: 0 0 25px rgba(249, 115, 22, 0.7);
  }
}

.glow-red {
  animation: pulse-glow-red 2s infinite ease-in-out;
}

.glow-orange {
  animation: pulse-glow-orange 2.5s infinite ease-in-out;
}

/* Leaflet Container Styling */
.leaflet-container {
  background-color: #0b0f17 !important;
  font-family: inherit;
}

.leaflet-bar {
  border: 1px solid #CBD5E1 !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1) !important;
  border-radius: 8px !important;
  overflow: hidden;
}

.leaflet-bar a {
  background-color: #ffffff !important;
  color: #090D16 !important;
  border-bottom: 1px solid #E2E8F0 !important;
  font-weight: bold;
}

.leaflet-bar a:hover {
  background-color: #F8FAFC !important;
  color: #0284C7 !important;
}

.leaflet-popup-content-wrapper {
  background: #ffffff !important;
  color: #090D16 !important;
  border: 1px solid #CBD5E1 !important;
  border-radius: 10px !important;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12) !important;
}

.leaflet-popup-tip {
  background: #ffffff !important;
  border: 1px solid #CBD5E1;
}

/* Color Scale Bar */
.tb-color-scale {
  background: linear-gradient(
    to right,
    #1e293b 0%,
    #334155 15%,
    #38bdf8 30%,
    #22c55e 45%,
    #eab308 60%,
    #ef4444 75%,
    #d946ef 90%,
    #ffffff 100%
  );
  height: 12px;
  border-radius: 0px;
  border: 2px solid #090D16;
}

/* Custom range inputs */
input[type="range"] {
  accent-color: #0284C7;
}

/* Custom scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #F4F3EE;
}

::-webkit-scrollbar-thumb {
  background: #090D16;
  border-radius: 0px;
}

::-webkit-scrollbar-thumb:hover {
  background: #334155;
}
