/* ============================================
   WeatherCast - Main Styles
   Professional weather forecast UI
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Colors */
  --color-bg: #f0f4f8;
  --color-surface: #ffffff;
  --color-primary: #0f172a;
  --color-primary-light: #1e293b;
  --color-accent: #3b82f6;
  --color-accent-light: #60a5fa;
  --color-accent-dark: #2563eb;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-success: #10b981;
  --color-text: #0f172a;
  --color-text-secondary: #64748b;
  --color-text-muted: #94a3b8;
  --color-border: #e2e8f0;
  --color-border-light: #f1f5f9;

  /* Gradients */
  --gradient-header: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #1e40af 100%);
  --gradient-clear-day: linear-gradient(180deg, #3b82f6 0%, #60a5fa 50%, #93c5fd 100%);
  --gradient-clear-night: linear-gradient(180deg, #0f172a 0%, #1e293b 50%, #334155 100%);
  --gradient-cloudy: linear-gradient(180deg, #64748b 0%, #94a3b8 50%, #cbd5e1 100%);
  --gradient-rain: linear-gradient(180deg, #334155 0%, #475569 50%, #64748b 100%);
  --gradient-snow: linear-gradient(180deg, #e2e8f0 0%, #cbd5e1 50%, #94a3b8 100%);
  --gradient-storm: linear-gradient(180deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', SFMono-Regular, 'Consolas', 'Liberation Mono', Menlo, monospace;

  /* Spacing */
  --header-height: 64px;
  --mobile-nav-height: 72px;
  --content-max-width: 1200px;
  --content-padding: 16px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  padding-top: var(--header-height);
  padding-bottom: calc(var(--mobile-nav-height) + 16px);
  overflow-x: hidden;
}

@media (min-width: 769px) {
  body {
    padding-bottom: 0;
  }
}

a {
  color: var(--color-accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

img, svg {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* --- Utility Classes --- */
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); border: 0;
}

/* --- Skeleton Loading --- */
.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-text { height: 16px; margin-bottom: 8px; }
.skeleton-text.short { width: 60%; }
.skeleton-title { height: 28px; width: 50%; margin-bottom: 12px; }
.skeleton-icon { width: 80px; height: 80px; border-radius: 50%; }
.skeleton-temp { height: 56px; width: 120px; margin-bottom: 8px; }

/* ============================================
   HEADER
   ============================================ */
#site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--gradient-header);
  color: white;
  height: var(--header-height);
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.header-inner {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 var(--content-padding);
  height: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: inherit;
  text-decoration: none;
}
.header-brand:hover {
  text-decoration: none;
  opacity: 0.9;
}

.header-logo {
  width: 32px;
  height: 32px;
}

.header-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 0;
}

.header-date {
  font-size: 0.8rem;
  opacity: 0.9;
  white-space: nowrap;
}

.header-updated {
  font-size: 0.7rem;
  opacity: 0.6;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: background var(--transition-fast);
}
.btn-icon:hover {
  background: rgba(255, 255, 255, 0.15);
}
.btn-icon:active {
  background: rgba(255, 255, 255, 0.25);
}
.btn-icon svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 480px) {
  .header-title { font-size: 1.1rem; }
  .header-meta { display: none; }
}

/* ============================================
   ALERT BANNER
   ============================================ */
.alert-banner {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  z-index: 90;
  background: var(--color-danger);
  color: white;
  transform: translateY(-100%);
  transition: transform var(--transition-base);
}
.alert-banner.visible {
  transform: translateY(0);
}
.alert-banner.severity-advisory { background: var(--color-warning); color: #1a1a2e; }
.alert-banner.severity-watch { background: #f97316; }
.alert-banner.severity-warning { background: var(--color-danger); }

.alert-banner-inner {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 10px var(--content-padding);
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.alert-content {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 500;
}
.alert-content strong {
  display: block;
  font-size: 0.9rem;
}

.alert-dismiss {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: inherit;
  opacity: 0.8;
  flex-shrink: 0;
  transition: opacity var(--transition-fast);
}
.alert-dismiss:hover { opacity: 1; }

@keyframes alert-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}
.alert-banner.visible { animation: alert-pulse 3s ease-in-out 2; }

/* ============================================
   REGION NAVIGATION
   ============================================ */
.region-nav {
  position: sticky;
  top: var(--header-height);
  z-index: 80;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 var(--content-padding);
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  background: linear-gradient(90deg,
    var(--color-bg) 0%,
    var(--color-surface) 3%,
    var(--color-surface) 97%,
    var(--color-bg) 100%
  );
  border-bottom: 1px solid var(--color-border);
}
.region-nav::-webkit-scrollbar { display: none; }

@media (min-width: 769px) {
  .region-nav { padding: 0 24px; }
}
@media (min-width: 1025px) {
  .region-nav { padding: 0 32px; }
}

.region-tab {
  padding: 12px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: all var(--transition-fast);
  scroll-snap-align: start;
  flex-shrink: 0;
  background: none;
}
.region-tab:hover {
  color: var(--color-text);
  background: var(--color-border-light);
}
.region-tab.active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
  font-weight: 600;
}

/* ============================================
   DASHBOARD LAYOUT
   ============================================ */
.dashboard {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--content-padding);
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

@media (min-width: 769px) {
  .dashboard {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 24px;
  }
  .card-current { grid-column: 1 / -1; }
  .card-forecast-text { grid-column: 1; }
  .card-commentary { grid-column: 2; }
  .card-hourly { grid-column: 1 / -1; }
  .card-daily { grid-column: 1; }
  .card-details { grid-column: 2; }
}

@media (min-width: 1025px) {
  .dashboard {
    grid-template-columns: 2fr 1fr;
    gap: 24px;
  }
  .card-current { grid-column: 1 / -1; }
  .card-hourly { grid-column: 1 / -1; }
  .card-daily { grid-column: 1; }
  .card-details { grid-column: 2; }
}

/* --- Cards --- */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: box-shadow var(--transition-base);
}

.section-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary);
  padding: 16px 20px 8px;
}

/* ============================================
   CURRENT CONDITIONS
   ============================================ */
.current-conditions-content {
  padding: 24px 20px 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  color: white;
  min-height: 200px;
}

/* Weather-based backgrounds */
.bg-clear-day { background: var(--gradient-clear-day); }
.bg-clear-night { background: var(--gradient-clear-night); }
.bg-cloudy { background: var(--gradient-cloudy); }
.bg-rain { background: var(--gradient-rain); }
.bg-snow { background: var(--gradient-snow); color: var(--color-text); }
.bg-storm { background: var(--gradient-storm); }
.bg-fog { background: linear-gradient(180deg, #94a3b8 0%, #cbd5e1 100%); color: var(--color-text); }

.current-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.current-location {
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 4px;
}

.current-temp-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.current-temp {
  font-size: 4.5rem;
  font-weight: 200;
  line-height: 1;
  letter-spacing: -0.04em;
}
.current-temp .degree {
  font-size: 2rem;
  font-weight: 300;
  vertical-align: super;
}

.current-condition {
  font-size: 1.15rem;
  font-weight: 500;
  margin-top: 2px;
}

.current-feels-like {
  font-size: 0.85rem;
  opacity: 0.75;
}

.current-hilo {
  display: flex;
  gap: 12px;
  margin-top: 4px;
  font-size: 0.9rem;
  font-weight: 500;
}
.current-hilo .low { opacity: 0.7; }

.current-icon-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.weather-icon-large {
  width: 100px;
  height: 100px;
}

.current-quick-stats {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  flex-wrap: wrap;
}

.quick-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.quick-stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
}
.quick-stat-value {
  font-size: 0.9rem;
  font-weight: 600;
}

@media (max-width: 480px) {
  .current-conditions-content {
    grid-template-columns: 1fr;
    padding: 20px 16px 16px;
  }
  .current-temp { font-size: 3.5rem; }
  .weather-icon-large { width: 72px; height: 72px; }
  .current-icon-side {
    position: absolute;
    top: 20px;
    right: 16px;
  }
}

/* ============================================
   WEATHER SCENE EFFECTS
   ============================================ */
.weather-scene {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.current-main { position: relative; z-index: 2; }
.current-icon-side { z-index: 2; }

/* --- Clear Day --- */
.scene-sun-glow {
  position: absolute;
  top: -60%;
  right: -30%;
  width: 120%;
  height: 160%;
  background: radial-gradient(circle, rgba(250, 204, 21, 0.3) 0%, rgba(250, 204, 21, 0.08) 40%, rgba(250, 204, 21, 0) 65%);
  animation: sun-pulse 4s ease-in-out infinite;
}
.scene-rays {
  position: absolute;
  top: 10%;
  right: 15%;
  width: 60px;
  height: 60px;
  animation: ray-rotate 20s linear infinite;
}
.scene-ray {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, rgba(250, 204, 21, 0.4), transparent);
  transform-origin: 0 50%;
}
.scene-particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  animation: float-particle 6s ease-in-out infinite;
}

@keyframes sun-pulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}
@keyframes ray-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes float-particle {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50% { opacity: 0.8; transform: translateY(-12px); }
}

/* --- Clear Night --- */
.scene-star {
  position: absolute;
  border-radius: 50%;
  background: white;
  animation: twinkle 3s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.4); }
}

/* --- Rain / Drizzle --- */
.scene-raindrop {
  position: absolute;
  top: -10%;
  width: 2px;
  background: linear-gradient(180deg, transparent, rgba(150, 200, 255, 0.6));
  border-radius: 0 0 2px 2px;
  animation: rain-fall 1s linear infinite;
}
@keyframes rain-fall {
  0% { transform: translateY(0); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translateY(300px); opacity: 0.3; }
}

/* --- Lightning --- */
.scene-lightning {
  position: absolute;
  top: 0;
  width: 3px;
  height: 60%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.4) 70%, transparent 100%);
  border-radius: 2px;
  opacity: 0;
  filter: blur(1px);
  animation: lightning 6s ease-in-out infinite;
}
@keyframes lightning {
  0%, 95%, 100% { opacity: 0; }
  96% { opacity: 0.9; }
  97% { opacity: 0.1; }
  98% { opacity: 0.7; }
  99% { opacity: 0; }
}

/* --- Snow --- */
.scene-snowflake {
  position: absolute;
  top: -10%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  animation: snow-fall 6s linear infinite;
}
@keyframes snow-fall {
  0% { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translateY(300px) translateX(30px) rotate(360deg); opacity: 0.2; }
}

/* --- Cloudy --- */
.scene-cloud {
  position: absolute;
  left: -130px;
  height: 40px;
  background: radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 70%);
  border-radius: 20px;
  animation: cloud-drift 30s linear infinite;
}
@keyframes cloud-drift {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(100% + 260px)); }
}

/* --- Fog --- */
.scene-fog-wisp {
  position: absolute;
  left: -50%;
  width: 200%;
  height: 30px;
  background: radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 70%);
  border-radius: 15px;
  animation: fog-drift 10s ease-in-out infinite alternate;
}
@keyframes fog-drift {
  0% { transform: translateX(-5%); opacity: 0.4; }
  100% { transform: translateX(5%); opacity: 0.8; }
}

/* --- Accessibility: Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  .weather-scene * {
    animation: none !important;
  }
  .scene-sun-glow,
  .scene-particle,
  .scene-star { opacity: 0.5; }
}

/* ============================================
   FORECAST SUMMARY TEXT
   ============================================ */
.forecast-text-content {
  padding: 20px;
}

.forecast-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
  color: white;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}
.forecast-badge svg {
  width: 12px;
  height: 12px;
}

.forecast-text {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text);
}

/* ============================================
   FORECASTER COMMENTARY
   ============================================ */
.commentary-content {
  padding: 20px;
}
.commentary-empty {
  color: var(--color-text-muted);
  font-style: italic;
  font-size: 0.9rem;
}

.commentary-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.commentary-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-accent), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.commentary-meta {
  display: flex;
  flex-direction: column;
}
.commentary-author {
  font-weight: 600;
  font-size: 0.9rem;
}
.commentary-time {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.commentary-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-text);
}

/* ============================================
   HOURLY FORECAST
   ============================================ */
.hourly-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 6px;
  margin: 0 14px 10px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.hourly-scroll::-webkit-scrollbar { display: none; }

.hourly-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  min-width: 72px;
  border-radius: var(--radius-md);
  scroll-snap-align: start;
  transition: background var(--transition-fast);
  flex-shrink: 0;
}
.hourly-item:hover { background: var(--color-border-light); }
.hourly-item.now {
  background: var(--color-accent);
  color: white;
}
.hourly-item.now .hourly-precip { color: rgba(255,255,255,0.7); }

.hourly-time {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-secondary);
}
.hourly-item.now .hourly-time { color: rgba(255,255,255,0.85); }

.hourly-icon {
  width: 32px;
  height: 32px;
}

.hourly-temp {
  font-size: 0.95rem;
  font-weight: 600;
}

.hourly-precip {
  font-size: 0.7rem;
  color: var(--color-accent);
  font-weight: 500;
}

/* ============================================
   7-DAY FORECAST
   ============================================ */
.daily-list {
  padding: 0 20px 16px;
}

.daily-row {
  display: grid;
  grid-template-columns: 80px 36px 1fr 44px 44px;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border-light);
}
.daily-row:last-child { border-bottom: none; }

.daily-day {
  font-size: 0.9rem;
  font-weight: 500;
}
.daily-day.today { color: var(--color-accent); font-weight: 600; }

.daily-icon {
  width: 32px;
  height: 32px;
}

.daily-temp-bar-container {
  display: flex;
  align-items: center;
  height: 6px;
  background: var(--color-border-light);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.daily-temp-bar {
  position: absolute;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--color-accent-light), var(--color-warning));
  transition: all var(--transition-base);
}

.daily-low {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-align: right;
  font-weight: 500;
}

.daily-high {
  font-size: 0.85rem;
  font-weight: 600;
  text-align: right;
}

.daily-precip-badge {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.7rem;
  color: var(--color-accent);
  font-weight: 500;
  margin-top: 2px;
}
.daily-precip-badge svg {
  width: 10px;
  height: 10px;
}

@media (max-width: 480px) {
  .daily-row {
    grid-template-columns: 56px 28px 1fr 36px 36px;
    gap: 8px;
    padding: 10px 0;
  }
  .daily-day { font-size: 0.8rem; }
  .daily-icon { width: 28px; height: 28px; }
}

/* ============================================
   WEATHER DETAILS GRID
   ============================================ */
.details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--color-border-light);
  padding: 0 0 1px;
}

.detail-card {
  background: var(--color-surface);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-card-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.detail-card-label svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

.detail-card-value {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
}

.detail-card-extra {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

@media (min-width: 769px) {
  .details-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============================================
   SUBSCRIBE / NOTIFICATION MODAL
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}
.modal-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform var(--transition-slow);
}
.modal-overlay.visible .modal {
  transform: translateY(0);
}

@media (min-width: 769px) {
  .modal-overlay {
    align-items: center;
  }
  .modal {
    border-radius: var(--radius-xl);
    transform: translateY(20px) scale(0.95);
  }
  .modal-overlay.visible .modal {
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 0;
}
.modal-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
}
.modal-close:hover {
  background: var(--color-border-light);
  color: var(--color-text);
}

.modal-body {
  padding: 16px 20px;
}

.modal-desc {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-text);
}

.form-group input[type="email"],
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color var(--transition-fast);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-accent);
}

/* Toggle switch */
.toggle-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
.toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  width: 48px;
  height: 26px;
  background: var(--color-border);
  border-radius: 13px;
  position: relative;
  transition: background var(--transition-fast);
  flex-shrink: 0;
}
.toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}
.toggle-input:checked + .toggle-slider {
  background: var(--color-accent);
}
.toggle-input:checked + .toggle-slider::after {
  transform: translateX(22px);
}

.modal-footer {
  padding: 0 20px 20px;
}

.btn-primary {
  width: 100%;
  padding: 12px 24px;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.btn-primary:hover { background: var(--color-accent-dark); }
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sub-status {
  padding: 12px 20px;
  margin: 0 20px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
}
.sub-status.success {
  background: #ecfdf5;
  color: #065f46;
}
.sub-status.error {
  background: #fef2f2;
  color: #991b1b;
}

/* ============================================
   MOBILE BOTTOM NAVIGATION
   ============================================ */
.mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-around;
  padding: 6px 0;
  padding-bottom: max(6px, env(safe-area-inset-bottom));
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

@media (min-width: 769px) {
  .mobile-nav { display: none; }
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: 0.65rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}
.mobile-nav-item svg {
  width: 22px;
  height: 22px;
}
.mobile-nav-item.active {
  color: var(--color-accent);
}
.mobile-nav-item:active {
  background: var(--color-border-light);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  margin-top: 24px;
}

.footer-inner {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 20px var(--content-padding);
  text-align: center;
}

.footer-sources {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}
.footer-sources a { color: var(--color-accent); }

.footer-copy {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* ============================================
   WEATHER ICONS (SVG-based)
   ============================================ */
.wi {
  display: inline-block;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* SVG weather icons are rendered inline via JS.
   These classes control sizing. */
.wi svg {
  width: 100%;
  height: 100%;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  animation: fadeInUp 0.4s ease both;
}
.card:nth-child(1) { animation-delay: 0s; }
.card:nth-child(2) { animation-delay: 0.05s; }
.card:nth-child(3) { animation-delay: 0.1s; }
.card:nth-child(4) { animation-delay: 0.15s; }
.card:nth-child(5) { animation-delay: 0.2s; }
.card:nth-child(6) { animation-delay: 0.25s; }

/* Refresh spin */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.btn-icon.refreshing svg {
  animation: spin 1s linear infinite;
}

/* ============================================
   RESPONSIVE TWEAKS
   ============================================ */
@media (max-width: 480px) {
  :root {
    --content-padding: 12px;
    --header-height: 56px;
  }

  .section-title {
    padding: 12px 16px 6px;
    font-size: 0.75rem;
  }

  .hourly-scroll { padding: 0 16px 12px; }
  .daily-list { padding: 0 16px 12px; }
  .forecast-text-content { padding: 16px; }
  .commentary-content { padding: 16px; }
}

@media (min-width: 1025px) {
  .dashboard {
    padding: 32px;
  }
}

/* ============================================
   PRINT
   ============================================ */
@media print {
  #site-header, .mobile-nav, .alert-banner,
  #btn-subscribe, #btn-refresh, .modal-overlay,
  .site-footer { display: none; }
  body { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
}
