/* NPC Weather — design ported from npclocal PrimaryWeather + SecondaryWeather
   components (Next.js/Tailwind) to pure CSS. Same visual language. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #0a1018;
  color: #e5e7eb;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.bg-storm {
  background-image:
    radial-gradient(ellipse at top left, rgba(56, 189, 248, 0.08), transparent 55%),
    radial-gradient(ellipse at top right, rgba(125, 211, 252, 0.05), transparent 50%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200' fill='none'><g stroke='%2338bdf8' stroke-opacity='0.06' stroke-width='0.6' fill='none'><circle cx='50' cy='50' r='20'/><circle cx='50' cy='50' r='32'/><circle cx='150' cy='150' r='20'/><circle cx='150' cy='150' r='32'/></g></svg>");
}

a { color: #38bdf8; text-decoration: none; }
a:hover { text-decoration: underline; color: #7dd3fc; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }

/* ───── Top bar ───── */
.topbar {
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: rgba(10,16,24,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .container {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 0.85rem; padding-bottom: 0.85rem; flex-wrap: wrap; gap: 0.5rem;
}
.brand {
  margin: 0; font-weight: 800; font-size: 1.05rem; letter-spacing: 0.01em;
  color: #fff;
  display: inline-flex; align-items: center; gap: 0.5rem;
  text-decoration: none;
  transition: color 120ms ease;
}
.brand:hover { color: #7dd3fc; text-decoration: none; }
.brand:hover .brand-mark path[stroke] { stroke: #fbbf24; }
.brand-mark { display: inline-block; flex-shrink: 0; }
.brand-mark path[stroke] { transition: stroke 120ms ease; }
.topbar-note { margin: 0; font-size: 0.82rem; color: #9ca3af; }

/* ───── Hero ───── */
.hero { padding: 2.5rem 1.25rem 1rem; }
.eyebrow {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 0.18em;
  text-transform: uppercase; color: #7dd3fc;
  padding: 4px 10px; background: rgba(56, 189, 248, 0.12); border-radius: 999px;
  margin-bottom: 1rem;
}
.hero h1 {
  font-size: clamp(1.7rem, 2.6vw + 1rem, 2.5rem);
  line-height: 1.15; margin: 0 0 0.85rem; color: #fff; letter-spacing: -0.015em;
}
.lede { color: #cbd5e1; font-size: 1.025rem; margin: 0 0 1rem; max-width: 720px; }

/* ───── Quick-nav (anchor jump links under hero) ───── */
.quick-nav {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-top: 1.25rem;
}
.quick-nav a {
  display: inline-flex; align-items: center;
  font-size: 0.82rem; font-weight: 600;
  padding: 0.5rem 0.9rem;
  background: rgba(56, 189, 248, 0.08);
  color: #7dd3fc;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.18);
  text-decoration: none;
  transition: background 120ms ease, color 120ms ease, box-shadow 120ms ease;
}
.quick-nav a:hover {
  background: rgba(56, 189, 248, 0.18);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.45);
  text-decoration: none;
}

/* ───── Section headers (h2 with subtle separator + scroll target) ───── */
.section-h {
  font-size: 1.4rem; color: #fff; margin: 0 0 1rem;
  letter-spacing: -0.01em;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
/* Smooth scroll for in-page nav */
html { scroll-behavior: smooth; }
/* Offset for sticky topbar */
section[id], a[id] { scroll-margin-top: 4.5rem; }

/* ───── PRIMARY WEATHER CARD (port of PrimaryWeather.tsx) ───── */
.weather-section { padding: 0.5rem 1.25rem 2rem; }
.primary-card {
  background: linear-gradient(135deg, #0f172a 0%, #0c1a35 100%);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
  transition: opacity 220ms ease;
}
@media (min-width: 640px) {
  .primary-card { padding: 1.75rem 2rem; }
}
.primary-card.fetching { opacity: 0.5; }

/* City picker */
.city-picker-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.85rem; flex-wrap: wrap; gap: 0.5rem;
  position: relative;
}
.city-picker-btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: #38bdf8;
  background: none; border: none; padding: 0; cursor: pointer;
  transition: color 150ms ease;
}
.city-picker-btn:hover { color: #7dd3fc; }
.city-picker-btn .caret { opacity: 0.6; transition: opacity 120ms ease; margin-left: 0.15rem; }
.city-picker-btn:hover .caret { opacity: 1; }
.city-picker-btn .pin { font-size: 0.9rem; }

.city-picker-dropdown {
  position: absolute;
  top: 100%; left: 0;
  margin-top: 0.5rem;
  z-index: 20;
  background: #1e293b;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 12px 32px rgba(0,0,0,0.45);
  border-radius: 0.75rem;
  overflow: hidden;
  min-width: 220px;
  max-height: 60vh;
  overflow-y: auto;
}
.city-picker-dropdown button {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 0.65rem 0.85rem;
  font-size: 0.875rem; color: #cbd5e1;
  background: none; border: none; cursor: pointer;
  text-align: left;
  transition: background 120ms ease, color 120ms ease;
}
.city-picker-dropdown button:hover {
  background: #334155;
  color: #fff;
}
.city-picker-dropdown button.active {
  background: #0284c7;
  color: #fff;
  font-weight: 700;
}
.detecting-pulse {
  font-size: 0.72rem; color: #cbd5e1;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

/* Big temp + emoji row */
.temp-emoji-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
}
.big-temp {
  font-size: clamp(4rem, 13vw, 7rem);
  font-weight: 200;
  line-height: 1;
  color: #fff;
  letter-spacing: -0.03em;
}
.big-emoji {
  font-size: clamp(3.5rem, 11vw, 6rem);
  line-height: 1;
  user-select: none;
}

.cond-row {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 0.5rem; margin-top: 0.75rem;
  flex-wrap: wrap;
}
.cond-text {
  font-size: 1.1rem; color: #cbd5e1; line-height: 1.3;
}
.updated-label {
  font-size: 0.72rem; color: #94a3b8;
  white-space: nowrap;
}

/* Detail chips grid */
.detail-chips {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-top: 0.85rem;
  transition: opacity 220ms ease;
}
@media (min-width: 640px) {
  .detail-chips { grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }
}
.detail-chips.fetching { opacity: 0.5; }
.chip {
  background: #0f172a;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
}
.chip-label {
  font-size: 0.7rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 0.25rem;
  font-weight: 600;
}
.chip-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}

/* ───── 5-day / 7-day forecast strip (port of SecondaryWeather) ───── */
.forecast-card {
  margin-top: 0.75rem;
  background: #0f172a;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
  border-radius: 1rem;
  overflow: hidden;
  transition: opacity 220ms ease;
}
.forecast-card.fetching { opacity: 0.4; }
.forecast-card .label {
  padding: 0.65rem 1rem 0.35rem;
  font-size: 0.7rem; color: #94a3b8;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em;
}
.forecast-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.forecast-day {
  display: flex; flex-direction: column; align-items: center;
  padding: 0.65rem 0.2rem;
  border-left: 1px solid rgba(255,255,255,0.05);
  gap: 0.1rem;
  min-width: 0;
}
.forecast-day:first-child { border-left: none; }
.forecast-day.is-today {
  background: rgba(56, 189, 248, 0.08);
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.25);
}
.forecast-day.is-today .fd-day {
  color: #7dd3fc;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.fd-day {
  font-size: 0.7rem; font-weight: 700; color: #cbd5e1;
}
.fd-emoji {
  font-size: 1.45rem; line-height: 1.1;
}
.fd-rain { font-size: 0.62rem; color: #38bdf8; font-weight: 600; line-height: 1; }
.fd-temp { display: flex; flex-direction: column; align-items: center; gap: 0; }
.fd-hi { font-size: 0.82rem; font-weight: 700; color: #fff; line-height: 1.1; }
.fd-lo { font-size: 0.7rem; color: #94a3b8; line-height: 1.1; }

/* On mobile: smaller padding + slightly smaller type so all 7 days fit.
   We DO NOT hide days — the previous version hid 6 & 7 on mobile but the
   copy promises 7, so all 7 must be visible at every viewport. */
@media (max-width: 480px) {
  .forecast-day { padding: 0.55rem 0.12rem; }
  .fd-day { font-size: 0.62rem; letter-spacing: -0.02em; }
  .fd-emoji { font-size: 1.25rem; }
  .fd-hi { font-size: 0.75rem; }
  .fd-lo { font-size: 0.65rem; }
  .fd-rain { font-size: 0.56rem; }
}

/* ───── 17-city overview chips ───── */
.cities-section { padding: 2rem 1.25rem 1rem; }
.cities-section h2 {
  font-size: 1.5rem; color: #fff; margin: 0 0 0.75rem; letter-spacing: -0.01em;
}
.last-updated { font-size: 0.78rem; color: #94a3b8; margin: 0 0 1rem; }
.city-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 0.6rem;
}
.city-chip {
  display: block;
  background: #0f172a;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
  border-radius: 0.6rem;
  padding: 0.65rem 0.85rem;
  text-decoration: none;
  color: inherit;
  transition: transform 120ms ease, background 120ms ease;
}
.city-chip:hover {
  background: #1e293b;
  transform: translateY(-1px);
  text-decoration: none;
}
.city-chip .cc-name {
  font-size: 0.78rem; font-weight: 700; color: #fff; margin-bottom: 0.15rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.35rem;
}
.cc-temp-row {
  display: flex; align-items: baseline; gap: 0.4rem;
}
.cc-temp { font-size: 1.6rem; font-weight: 200; color: #fff; line-height: 1; }
.cc-emoji { font-size: 1.3rem; line-height: 1; margin-left: auto; }
.cc-cond { font-size: 0.7rem; color: #94a3b8; margin-top: 0.2rem; text-transform: capitalize; }

/* ───── Alerts banner (clickable, jumps to #alerts section) ───── */
.alerts-banner {
  background: linear-gradient(135deg, #7f1d1d, #991b1b);
  border-radius: 0.75rem;
  padding: 0.85rem 1.1rem;
  display: flex; align-items: center; gap: 0.85rem;
  box-shadow: inset 0 0 0 1px rgba(248,113,113,0.4);
  margin-top: 1rem;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.alerts-banner:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px rgba(248,113,113,0.7), 0 6px 20px rgba(127,29,29,0.35);
}
.alerts-banner.hidden { display: none; }
.alerts-banner-icon { font-size: 1.6rem; line-height: 1; flex-shrink: 0; }
.alerts-banner-content { flex: 1; }
.alerts-banner-content h3 { margin: 0 0 0.2rem; color: #fff; font-size: 1rem; }
.alerts-banner-content p { margin: 0; color: #fecaca; font-size: 0.85rem; }
.alerts-banner-cta {
  flex-shrink: 0;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(255,255,255,0.12);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
}

/* ───── Tropical Atlantic widget ───── */
.tropical-status {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.5rem 0;
  flex-wrap: wrap;
}
.tropical-pulse {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 1rem; font-weight: 700;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
}
.tropical-pulse.calm {
  background: rgba(134, 239, 172, 0.12);
  color: #86efac;
  box-shadow: inset 0 0 0 1px rgba(134, 239, 172, 0.3);
}
.tropical-pulse.active {
  background: rgba(248, 113, 113, 0.15);
  color: #fca5a5;
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.4);
  animation: tropical-pulse-anim 1.8s ease-in-out infinite;
}
@keyframes tropical-pulse-anim {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(248,113,113,0.4); }
  50% { box-shadow: inset 0 0 0 1px rgba(248,113,113,0.4), 0 0 0 6px rgba(248,113,113,0.18); }
}
.tropical-off {
  color: #94a3b8;
  font-size: 0.92rem;
}
.tropical-storms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}
.tropical-storm {
  background: rgba(127, 29, 29, 0.2);
  border-radius: 0.6rem;
  padding: 0.85rem 1rem;
  box-shadow: inset 0 0 0 1px rgba(248,113,113,0.3);
}
.tropical-storm h4 { margin: 0 0 0.3rem; color: #fca5a5; font-size: 0.95rem; }
.tropical-storm p { margin: 0; color: #cbd5e1; font-size: 0.85rem; }

/* ───── Storm / sources panels ───── */
.storm-section, .info, .disclaimer { padding: 2rem 1.25rem 1rem; }
.storm-section h2, .info h2 {
  font-size: 1.35rem; color: #fff; margin: 0 0 0.5rem; letter-spacing: -0.01em;
}
.storm-section p, .info p { color: #cbd5e1; }
.storm-content {
  background: #0f172a;
  border-radius: 0.85rem;
  padding: 1rem 1.25rem;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
  margin-top: 0.75rem;
}
.storm-empty { color: #86efac; font-size: 0.95rem; line-height: 1.55; }
.storm-alert { margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid rgba(255,255,255,0.07); }
.storm-alert:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.storm-alert h3 { color: #fca5a5; font-size: 1.025rem; margin: 0 0 0.25rem; }
.storm-alert p { color: #cbd5e1; font-size: 0.9rem; margin: 0; }

h3 { color: #e5e7eb; font-size: 1.05rem; margin: 1rem 0 0.4rem; }
ul.tools-list, ul.sources { padding-left: 1.25rem; margin: 0.5rem 0; }
ul.tools-list li, ul.sources li { margin-bottom: 0.45rem; color: #cbd5e1; }
.disclaimer { font-size: 0.9rem; color: #94a3b8; }
.disclaimer strong { color: #fca5a5; }

/* ───── Per-city pages (existing /[city] pages also use this CSS) ───── */
.current-card {
  background: linear-gradient(135deg, #0f172a 0%, #0c1a35 100%);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
  display: grid;
  gap: 0.5rem;
}
.current-temp {
  font-size: clamp(3.5rem, 11vw, 6rem);
  font-weight: 200; line-height: 1; color: #fff; letter-spacing: -0.03em;
}
.current-cond { font-size: 1.1rem; color: #cbd5e1; }
.current-meta {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem;
  font-size: 0.92rem; color: #cbd5e1;
}
.current-meta li { display: flex; align-items: center; gap: 0.35rem; }

/* loading + error states */
.loading {
  color: #94a3b8; font-style: italic; font-size: 0.9rem;
}
.result-error {
  color: #fca5a5; padding: 0.75rem 1rem; background: rgba(127,29,29,0.3);
  border-radius: 0.6rem; box-shadow: inset 0 0 0 1px rgba(248,113,113,0.3);
}

/* ───── Footer ───── */
.footer {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: 1.5rem 1.25rem;
  background: rgba(10,16,24,0.5);
  margin-top: 2rem;
}
.footer p { margin: 0.25rem 0; color: #94a3b8; font-size: 0.85rem; }
.footer .footer-sub { font-size: 0.78rem; }
