/* =============================================
   TOLDENSTORM — styles.css
   Aesthetic: Dark Atmospheric / Storm Intelligence
   Fonts: Bebas Neue (display) · Syne (UI) · DM Mono (data)
   ============================================= */

:root {
  --bg-deep:     #080c12;
  --bg-card:     #0d1420;
  --bg-card2:    #111927;
  --border:      rgba(99, 160, 220, 0.12);
  --border-glow: rgba(99, 200, 255, 0.3);
  --accent:      #4fc3f7;
  --accent2:     #f7c94f;
  --accent3:     #f74f4f;
  --text-primary:#e8f4ff;
  --text-muted:  #6a8aaa;
  --text-dim:    #3a5570;
  --storm-blue:  #1565c0;
  --storm-cyan:  #0097a7;
  --storm-violet:#5c35b0;
  --glow:        0 0 30px rgba(79, 195, 247, 0.15);
  --glow-strong: 0 0 60px rgba(79, 195, 247, 0.3);
  --radius:      12px;
  --radius-lg:   20px;
  --transition:  0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-deep:     #e8f0fa;
  --bg-card:     #f0f6ff;
  --bg-card2:    #ffffff;
  --border:      rgba(30, 90, 160, 0.15);
  --border-glow: rgba(30, 90, 160, 0.3);
  --accent:      #1565c0;
  --accent2:     #b8860b;
  --accent3:     #c0392b;
  --text-primary:#0a1628;
  --text-muted:  #3a5580;
  --text-dim:    #8aadcc;
  --glow:        0 0 30px rgba(21, 101, 192, 0.1);
  --glow-strong: 0 0 60px rgba(21, 101, 192, 0.2);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Syne', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* =============================================
   BACKGROUND LAYERS
   ============================================= */

.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(21, 80, 160, 0.25) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(92, 53, 176, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 100% 80% at 50% 50%, rgba(0, 30, 60, 0.8) 0%, var(--bg-deep) 100%);
  transition: background var(--transition);
}

[data-theme="light"] .bg-layer {
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(100, 160, 230, 0.2) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(140, 100, 220, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 100% 80% at 50% 50%, rgba(220, 235, 255, 0.5) 0%, var(--bg-deep) 100%);
}

.lightning-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  background: rgba(160, 210, 255, 0.08);
  transition: opacity 0.05s;
}

.particle-canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.6;
}

/* =============================================
   APP SHELL
   ============================================= */

.app-shell {
  position: relative;
  z-index: 10;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px 60px;
  min-height: 100vh;
}

/* =============================================
   HEADER
   ============================================= */

.app-header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 22px 0 18px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(to bottom, var(--bg-deep) 70%, transparent);
  backdrop-filter: blur(12px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.logo-icon { font-size: 1.5rem; filter: drop-shadow(0 0 10px rgba(79,195,247,0.6)); }
.logo-text {
  font-family: 'Bebas Neue', cursive;
  font-size: 1.7rem;
  letter-spacing: 0.12em;
  color: var(--text-primary);
  text-shadow: 0 0 20px rgba(79,195,247,0.4);
}

.header-nav {
  display: flex;
  gap: 4px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
}
.nav-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  padding: 7px 16px;
  border-radius: 7px;
  cursor: pointer;
  transition: var(--transition);
}
.nav-btn:hover { color: var(--text-primary); background: rgba(79,195,247,0.08); }
.nav-btn.active {
  color: var(--bg-deep);
  background: var(--accent);
  font-weight: 500;
}

.header-actions { display: flex; gap: 8px; }
.icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover { color: var(--accent); border-color: var(--border-glow); }

/* =============================================
   SEARCH
   ============================================= */

.search-section { position: relative; margin: 24px 0 20px; }

.search-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 12px;
  gap: 10px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-wrapper:focus-within {
  border-color: var(--border-glow);
  box-shadow: var(--glow);
}

.search-icon { color: var(--text-dim); font-size: 1.1rem; flex-shrink: 0; }

.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: 'Syne', sans-serif;
  font-size: 0.95rem;
  padding: 14px 0;
}
.search-input::placeholder { color: var(--text-dim); }

.search-btn {
  background: var(--accent);
  color: var(--bg-deep);
  border: none;
  border-radius: 8px;
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  padding: 8px 18px;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}
.search-btn:hover { background: #81d4fa; }

.location-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 7px;
  transition: var(--transition);
  flex-shrink: 0;
}
.location-btn:hover { background: rgba(79,195,247,0.1); }

.search-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 200;
  overflow: hidden;
  display: none;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}
.suggestion-item {
  padding: 12px 18px;
  cursor: pointer;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover { background: rgba(79,195,247,0.08); color: var(--accent); }

/* =============================================
   VIEWS
   ============================================= */

.view { display: none; }
.view.active { display: block; animation: fadeUp 0.4s ease both; }

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

/* =============================================
   CURRENT HERO
   ============================================= */

.current-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 36px 0 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.hero-left { flex: 1; }

.city-name {
  font-family: 'Bebas Neue', cursive;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  letter-spacing: 0.05em;
  line-height: 1;
  color: var(--text-primary);
  text-shadow: 0 0 40px rgba(79,195,247,0.3);
}

.location-meta {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sep { color: var(--text-dim); }

.temp-display {
  display: flex;
  align-items: flex-start;
  margin-top: 20px;
  line-height: 1;
}
.temp-value {
  font-family: 'Bebas Neue', cursive;
  font-size: clamp(4rem, 12vw, 8rem);
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.temp-unit {
  font-family: 'Bebas Neue', cursive;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  color: var(--text-muted);
  margin-top: 0.8rem;
}

.condition-display {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.condition-icon { font-size: 2rem; }
.condition-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.feels-like {
  font-family: 'DM Mono', monospace;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 10px;
  letter-spacing: 0.04em;
}

/* Storm Orb */
.hero-right { flex-shrink: 0; }

.storm-orb {
  position: relative;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orb-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(79,195,247,0.2);
  animation: orbPulse 3s ease-in-out infinite;
}
.r1 { width: 180px; height: 180px; animation-delay: 0s; }
.r2 { width: 130px; height: 130px; animation-delay: 0.4s; border-color: rgba(79,195,247,0.35); }
.r3 { width: 80px; height: 80px; animation-delay: 0.8s; border-color: rgba(79,195,247,0.5); }

@keyframes orbPulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50%       { transform: scale(1.05); opacity: 1; }
}

.orb-core {
  width: 60px;
  height: 60px;
  background: radial-gradient(circle, rgba(79,195,247,0.2), rgba(79,195,247,0.05));
  border: 1px solid var(--border-glow);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  animation: orbFloat 4s ease-in-out infinite;
  box-shadow: 0 0 30px rgba(79,195,247,0.25), inset 0 0 20px rgba(79,195,247,0.1);
}

@keyframes orbFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

/* =============================================
   STATS GRID
   ============================================= */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(79,195,247,0.04) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition);
}
.stat-card:hover { border-color: var(--border-glow); box-shadow: var(--glow); }
.stat-card:hover::before { opacity: 1; }

.stat-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.stat-value {
  font-family: 'Bebas Neue', cursive;
  font-size: 1.9rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  line-height: 1;
}

.stat-sub {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Stat bar */
.stat-bar {
  height: 4px;
  background: rgba(79,195,247,0.1);
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
}
.stat-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--storm-cyan), var(--accent));
  border-radius: 2px;
  width: 0%;
  transition: width 1s cubic-bezier(0.4,0,0.2,1);
}

/* Wind compass */
.wind-compass {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.compass-needle {
  font-size: 1rem;
  color: var(--accent);
  display: inline-block;
  transition: transform 0.8s cubic-bezier(0.4,0,0.2,1);
}

/* UV bar */
.uv-bar {
  height: 6px;
  background: linear-gradient(90deg, #4caf50, #ffeb3b, #ff9800, #f44336, #9c27b0);
  border-radius: 3px;
  margin-top: 10px;
  position: relative;
}
.uv-fill {
  position: absolute;
  top: -2px;
  width: 10px;
  height: 10px;
  background: white;
  border-radius: 50%;
  border: 2px solid var(--bg-deep);
  box-shadow: 0 0 6px rgba(255,255,255,0.6);
  transition: left 1s cubic-bezier(0.4,0,0.2,1);
}
.uv-label {
  display: block;
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Sun arc */
.sun-arc { margin-top: 10px; }
.sun-track {
  height: 4px;
  background: linear-gradient(90deg, #ff6f00, #ffd54f, #ff6f00);
  border-radius: 2px;
  position: relative;
}
.sun-pos {
  position: absolute;
  top: -4px;
  width: 12px;
  height: 12px;
  background: #ffd54f;
  border-radius: 50%;
  box-shadow: 0 0 8px #ffd54f;
  transition: left 1s cubic-bezier(0.4,0,0.2,1);
}

/* =============================================
   AQI SECTION
   ============================================= */

.aqi-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 28px;
}
.section-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.aqi-bar-wrap { margin-bottom: 14px; }
.aqi-bar {
  height: 10px;
  position: relative;
  border-radius: 5px;
  overflow: visible;
  margin-bottom: 6px;
}
.aqi-gradient {
  position: absolute;
  inset: 0;
  border-radius: 5px;
  background: linear-gradient(90deg, #4caf50 0%, #8bc34a 20%, #ffeb3b 40%, #ff9800 60%, #f44336 80%, #9c27b0 100%);
}
.aqi-marker {
  position: absolute;
  top: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--bg-deep);
  box-shadow: 0 0 10px rgba(255,255,255,0.5);
  transform: translateX(-50%);
  transition: left 1s cubic-bezier(0.4,0,0.2,1);
  left: 0%;
}
.aqi-labels {
  display: flex;
  justify-content: space-between;
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-top: 4px;
}
.aqi-value-wrap { display: flex; align-items: baseline; gap: 12px; }
.aqi-num {
  font-family: 'Bebas Neue', cursive;
  font-size: 2.5rem;
  color: var(--accent);
}
.aqi-desc {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* =============================================
   HOURLY VIEW
   ============================================= */

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-top: 20px;
}

.hourly-scroll {
  overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.hourly-track {
  display: flex;
  gap: 10px;
  min-width: max-content;
  padding: 4px 2px;
}
.hourly-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  text-align: center;
  min-width: 80px;
  cursor: default;
  transition: var(--transition);
  animation: fadeUp 0.4s ease both;
}
.hourly-card:hover { border-color: var(--border-glow); transform: translateY(-3px); }
.hourly-time {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.hourly-icon { font-size: 1.4rem; margin-bottom: 8px; display: block; }
.hourly-temp {
  font-family: 'Bebas Neue', cursive;
  font-size: 1.4rem;
  color: var(--accent);
}
.hourly-precip {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  color: #64b5f6;
  margin-top: 4px;
}
.hourly-chart {
  width: 100%;
  height: 120px;
  margin-top: 16px;
  opacity: 0.8;
}

/* =============================================
   FORECAST VIEW
   ============================================= */

.forecast-list { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }

.forecast-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: 100px 1fr 80px 80px 80px;
  align-items: center;
  padding: 16px 22px;
  gap: 16px;
  transition: var(--transition);
  animation: fadeUp 0.4s ease both;
}
.forecast-row:hover { border-color: var(--border-glow); transform: translateX(4px); }
.forecast-day {
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.forecast-cond {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
}
.forecast-cond span:first-child { font-size: 1.3rem; }
.forecast-high {
  font-family: 'Bebas Neue', cursive;
  font-size: 1.5rem;
  color: var(--text-primary);
  text-align: center;
}
.forecast-low {
  font-family: 'Bebas Neue', cursive;
  font-size: 1.5rem;
  color: var(--text-dim);
  text-align: center;
}
.forecast-rain {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  color: #64b5f6;
  text-align: center;
}

/* =============================================
   RADAR VIEW
   ============================================= */

.radar-badge {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  background: var(--accent3);
  color: white;
  padding: 3px 8px;
  border-radius: 4px;
  animation: blink 1.5s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.radar-container {
  width: 100%;
  aspect-ratio: 4/3;
  max-height: 520px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}

.radar-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radar-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: var(--radius-lg);
  display: block;
}
.radar-frame.hidden { display: none; }

/* Animated radar placeholder inner content */
.radar-placeholder-inner {
  width: 300px;
  height: 300px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radar-rings { position: absolute; inset: 0; pointer-events: none; }
.ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(79,195,247,0.2);
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
}
.ring:nth-child(1) { width: 100%; height: 100%; }
.ring:nth-child(2) { width: 66%; height: 66%; border-color: rgba(79,195,247,0.3); }
.ring:nth-child(3) { width: 33%; height: 33%; border-color: rgba(79,195,247,0.4); }

.radar-sweep {
  position: absolute;
  width: 100%; height: 100%;
  border-radius: 50%;
  overflow: hidden;
  animation: sweep 3s linear infinite;
}
.sweep-line {
  position: absolute;
  top: 50%; left: 50%;
  width: 50%; height: 2px;
  background: linear-gradient(90deg, rgba(79,195,247,0.8), transparent);
  transform-origin: left center;
}
.sweep-fill {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(79,195,247,0.08) 0deg, transparent 60deg);
}
@keyframes sweep { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.radar-dot {
  width: 10px; height: 10px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent);
  z-index: 10;
  animation: radarPulse 2s ease-in-out infinite;
}
@keyframes radarPulse {
  0%, 100% { box-shadow: 0 0 8px var(--accent); }
  50%       { box-shadow: 0 0 24px var(--accent), 0 0 48px rgba(79,195,247,0.3); }
}

.radar-text {
  position: absolute;
  bottom: -50px;
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-dim);
  display: flex;
  gap: 20px;
}

/* =============================================
   ALERT BANNER
   ============================================= */

.alert-banner {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(247,79,79,0.15);
  border: 1px solid rgba(247,79,79,0.4);
  border-radius: 12px;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #ff8a8a;
  backdrop-filter: blur(12px);
  z-index: 500;
  max-width: 600px;
  box-shadow: 0 10px 40px rgba(247,79,79,0.2);
  animation: slideUp 0.4s ease;
}
.alert-banner.hidden { display: none; }
@keyframes slideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.alert-icon { font-size: 1.2rem; }
.alert-text { flex: 1; }
.alert-close {
  background: none;
  border: none;
  color: #ff8a8a;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.7;
  transition: opacity var(--transition);
}
.alert-close:hover { opacity: 1; }

/* =============================================
   FOOTER
   ============================================= */

.app-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  padding: 28px 0 10px;
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  border-top: 1px solid var(--border);
  margin-top: 30px;
}

/* =============================================
   LOADING OVERLAY
   ============================================= */

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease;
}
.loading-overlay.hidden { opacity: 0; pointer-events: none; }

.loader-inner { text-align: center; }
.loader-ring {
  width: 56px;
  height: 56px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 0 auto 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  animation: fadePulse 1.5s ease-in-out infinite;
}
@keyframes fadePulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* =============================================
   WEATHER STATE THEMES
   ============================================= */

body.weather-rain .bg-layer {
  background:
    radial-gradient(ellipse 80% 60% at 30% 20%, rgba(0, 60, 120, 0.4) 0%, transparent 60%),
    radial-gradient(ellipse 100% 80% at 50% 50%, rgba(0, 20, 50, 0.9) 0%, var(--bg-deep) 100%);
}
body.weather-sunny .bg-layer {
  background:
    radial-gradient(ellipse 80% 60% at 70% 10%, rgba(255, 180, 0, 0.2) 0%, transparent 60%),
    radial-gradient(ellipse 100% 80% at 50% 50%, rgba(30, 20, 0, 0.7) 0%, var(--bg-deep) 100%);
}
body.weather-snow .bg-layer {
  background:
    radial-gradient(ellipse 80% 60% at 40% 20%, rgba(100, 150, 220, 0.25) 0%, transparent 60%),
    radial-gradient(ellipse 100% 80% at 50% 50%, rgba(20, 30, 50, 0.85) 0%, var(--bg-deep) 100%);
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 768px) {
  .app-header { flex-wrap: wrap; gap: 12px; }
  .header-nav { order: 3; width: 100%; justify-content: center; }
  .current-hero { flex-direction: column-reverse; align-items: flex-start; gap: 10px; }
  .hero-right { align-self: flex-end; }
  .storm-orb { width: 120px; height: 120px; }
  .r1 { width: 120px; height: 120px; }
  .r2 { width: 86px; height: 86px; }
  .r3 { width: 52px; height: 52px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .forecast-row { grid-template-columns: 80px 1fr 60px 60px; }
  .forecast-rain { display: none; }
  .aqi-labels span:nth-child(3), .aqi-labels span:nth-child(4) { display: none; }
}

@media (max-width: 480px) {
  .app-shell { padding: 0 12px 50px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .forecast-row { grid-template-columns: 1fr 1fr 50px 50px; gap: 8px; padding: 12px 14px; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-glow); }
