@font-face {
  font-family: "Nunito";
  font-weight: 700;
  src: url("/fonts/nunito-bold.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  font-weight: 800;
  src: url("/fonts/nunito-extrabold.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  font-weight: 900;
  src: url("/fonts/nunito-black.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #080b18;
  --panel: rgba(255, 255, 255, 0.07);
  --panel-strong: rgba(61, 111, 238, 0.14);
  --line: rgba(255, 255, 255, 0.14);
  --text: #ffffff;
  --muted: #9aa3b8;
  --dim: #d8d8d8;
  --blue: #3d6fee;
  --blue-mid: #2255cc;
  --amber: #f59e0b;
  --danger: #e06060;
  --ok: #5fd2a1;
  --radius-lg: 28px;
  --radius-md: 20px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  font-family: "Nunito", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(ellipse at 80% 0%, rgba(61, 111, 238, 0.22) 0%, transparent 50%),
    radial-gradient(ellipse at 10% 90%, rgba(245, 158, 11, 0.12) 0%, transparent 45%),
    linear-gradient(180deg, #080b18 0%, #0b1228 55%, #080b18 100%);
}

button, input { font: inherit; }
button { cursor: pointer; }

/* ── Layout shell ── */
.shell {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

/* ── Topbar ── */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.brand {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.2);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 2.5px;
  text-transform: lowercase;
  white-space: nowrap;
}

.topbar-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
}

.icon-button,
.glass-button,
.primary-button {
  min-height: 42px;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: background 0.15s, border-color 0.15s;
}

.icon-button:hover,
.glass-button:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
}

.icon-button {
  width: 42px;
  font-size: 18px;
}

.glass-button {
  padding: 0 16px;
  font-weight: 800;
}

.primary-button {
  padding: 0 20px;
  border-color: rgba(61, 111, 238, 0.5);
  background: linear-gradient(135deg, var(--blue), var(--blue-mid));
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.3px;
}

.primary-button:hover {
  background: linear-gradient(135deg, #5582ff, var(--blue));
}

/* ── Search ── */
.search {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.search-field,
.chat-form input {
  min-width: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.07);
  transition: border-color 0.15s, background 0.15s;
}

.search-field:focus-within,
.chat-form input:focus {
  border-color: rgba(61, 111, 238, 0.5);
  background: rgba(255, 255, 255, 0.1);
}

.search-field input,
.chat-form input {
  width: 100%;
  min-height: 42px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  padding: 0 18px;
}

.search-field input::placeholder,
.chat-form input::placeholder {
  color: rgba(154, 163, 184, 0.7);
}

/* ── Suggestions dropdown ── */
.suggestions {
  position: relative;
  z-index: 100;
  display: grid;
  gap: 6px;
  padding: 10px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(8, 11, 24, 0.96);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.suggestion {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  border: 0;
  border-radius: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  text-align: left;
  font-weight: 700;
  transition: background 0.12s;
}

.suggestion:hover:not(:disabled) {
  background: rgba(61, 111, 238, 0.18);
}

.suggestion small {
  color: var(--muted);
  font-size: 12px;
}

/* ── Alert banner ── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  margin-bottom: 16px;
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.1);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.alert > span:first-child {
  font-size: 18px;
  line-height: 1.4;
  flex: 0 0 auto;
}

.alert strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.alert p {
  margin: 4px 0 0;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.4;
}

/* ── Hero section ── */
.hero {
  margin-bottom: 20px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: stretch;
}

.current,
.side-panel,
.glass-card {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
}

.current {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 400px;
  padding: clamp(28px, 4.5vw, 56px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}

.current::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 100% 0%, rgba(61, 111, 238, 0.12) 0%, transparent 60%);
  pointer-events: none;
}

/* ── Temperature ── */
.temperature-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}

.temperature,
.temperature-shadow {
  margin: 0;
  font-size: clamp(100px, 16vw, 220px);
  font-weight: 900;
  line-height: 0.88;
  letter-spacing: -2px;
}

.temperature {
  position: relative;
  z-index: 2;
  width: max-content;
  max-width: 100%;
  color: transparent;
  background: linear-gradient(180deg, #ffffff 0%, #d4d8e8 50%, #9aa3b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(10px 10px 0 rgba(4, 8, 30, 0.8));
}

.temperature-shadow {
  position: absolute;
  left: 11px;
  top: calc(50% + 8px);
  transform: translateY(-50%);
  color: rgba(4, 8, 30, 0.8);
  filter: blur(0.5px);
  z-index: 1;
}

/* ── Temp range pill ── */
.temp-range {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 20px;
  padding: 6px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  width: max-content;
}

.temp-range strong {
  color: transparent;
  background: linear-gradient(180deg, #ffffff 0%, #9aa3b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.range-sep {
  color: var(--amber);
  font-size: 13px;
  opacity: 0.8;
}

/* ── Condition row ── */
.condition-row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  margin-bottom: 4px;
}

.condition-icon {
  width: 60px;
  height: 60px;
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}

.condition {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.2;
}

.summary {
  margin: 5px 0 0;
  color: var(--dim);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  max-width: 480px;
}

/* ── Live indicator ── */
.live-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
}

.muted {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(95, 210, 161, 0.2);
  animation: live-pulse 2.2s ease-in-out infinite;
  flex: 0 0 auto;
}

@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(95, 210, 161, 0.2); }
  50%       { box-shadow: 0 0 0 7px rgba(95, 210, 161, 0.06); }
}

/* ── Side panel / metrics ── */
.side-panel {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 16px;
  border-radius: var(--radius-lg);
  align-content: start;
}

.metric {
  min-height: 88px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(61, 111, 238, 0.22);
  background: var(--panel-strong);
  transition: border-color 0.2s;
}

.metric:hover {
  border-color: rgba(61, 111, 238, 0.4);
}

.metric span,
.section-title {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.metric strong {
  color: transparent;
  background: linear-gradient(180deg, #ffffff 0%, #d8d8d8 50%, #9aa3b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1;
}

/* ── Section title ── */
.section-title {
  margin-bottom: 14px;
}

/* ── Content grid ── */
.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding-bottom: 32px;
}

.glass-card {
  min-width: 0;
  padding: 22px;
  border-radius: var(--radius-lg);
}

.wide,
.chat-card {
  grid-column: 1 / -1;
}

/* ── Hourly chart ── */
.hourly-svg {
  width: 100%;
  height: 150px;
  display: block;
  overflow: visible;
}

.hour-row {
  display: flex;
  justify-content: space-around;
  padding: 8px 14px 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 6px;
}

.hour-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 56px;
  flex: 1;
}

.hour-node img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35));
}

.hour-temp {
  color: transparent;
  background: linear-gradient(180deg, #ffffff 0%, #9aa3b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.3px;
}

.hour-time {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.hour-pop {
  color: #60b4f8;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.2px;
}

/* ── Daily forecast ── */
.day-list {
  display: grid;
  gap: 8px;
}

.day {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 54px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.045);
  transition: background 0.15s;
}

.day:hover {
  background: rgba(255, 255, 255, 0.08);
}

.day img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35));
}

.day-label {
  min-width: 44px;
  font-size: 11px;
  font-weight: 900;
  color: var(--muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  flex: 0 0 auto;
}

.day div {
  flex: 1;
  min-width: 0;
}

.day-condition {
  font-size: 13px;
  font-weight: 800;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.day-bar {
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--amber));
  margin-top: 5px;
  opacity: 0.35;
  width: 70%;
}

.day-temp {
  color: transparent;
  background: linear-gradient(180deg, #ffffff 0%, #9aa3b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
  flex: 0 0 auto;
  letter-spacing: -0.3px;
}

/* ── Sun panel ── */
.sun-content {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 0;
}

.sun-time {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  flex: 1;
}

.sun-time img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.5));
}

.sun-time span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.sun-time strong {
  color: transparent;
  background: linear-gradient(180deg, var(--amber) 0%, #d97706 100%);
  -webkit-background-clip: text;
  background-clip: text;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.sun-arc {
  flex: 2;
  height: 56px;
  border: 2px solid rgba(245, 158, 11, 0.28);
  border-bottom: none;
  border-radius: 100px 100px 0 0;
  position: relative;
}

.sun-arc span {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 14px var(--amber), 0 0 28px rgba(245, 158, 11, 0.4);
}

/* ── Pollen ── */
.pollen-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}

.pollen-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
  text-align: center;
  transition: background 0.15s;
}

.pollen-card:hover {
  background: rgba(255, 255, 255, 0.08);
}

.pollen-card img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  opacity: 0.82;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35));
}

.pollen-card strong {
  font-size: 11px;
  font-weight: 900;
  color: var(--dim);
  letter-spacing: 0.2px;
}

.pollen-card span {
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
}

/* ── Chat ── */
.chat-log {
  display: grid;
  gap: 8px;
  min-height: 60px;
  max-height: 260px;
  overflow-y: auto;
  margin: 4px 0 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}

.chat-message {
  padding: 12px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.05);
  color: var(--dim);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  width: min(720px, 100%);
}

.chat-message.user {
  justify-self: end;
  color: var(--text);
  background: rgba(61, 111, 238, 0.16);
  border-color: rgba(61, 111, 238, 0.32);
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.chat-form input {
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.07);
  outline: 0;
  color: var(--text);
  padding: 0 18px;
}

.send-button {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(61, 111, 238, 0.5);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--blue), var(--blue-mid));
  color: var(--text);
  font-size: 17px;
  transition: background 0.15s;
}

.send-button:hover {
  background: linear-gradient(135deg, #5582ff, var(--blue));
}

/* ── Utility ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] { display: none !important; }

/* ── Radar Nowcast ── */
.radar-top {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 14px;
}

.radar-layout {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: start;
}

.radar-chart-col {
  min-width: 0;
}

.radar-img-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.radar-map-img {
  width: 220px;
  height: auto;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  display: block;
}

.radar-img-caption {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.radar-summary {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.2px;
}

.radar-raining {
  color: #60b4f8;
}

.radar-clear {
  color: var(--ok);
}

.radar-bar {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 64px;
  padding: 0 0 4px;
}

.radar-bar-item {
  flex: 1;
  min-width: 3px;
  height: var(--h, 4%);
  min-height: 3px;
  border-radius: 3px 3px 0 0;
  background: rgba(255, 255, 255, 0.15);
  transition: height 0.3s ease;
  position: relative;
}

.radar-bar-item.wet {
  background: linear-gradient(180deg, #60b4f8, #3d6fee);
  box-shadow: 0 0 6px rgba(96, 180, 248, 0.4);
}

.radar-bar-item.nowcast {
  opacity: 0.55;
}

.radar-bar-item.nowcast.wet {
  background: linear-gradient(180deg, #93c8fb, #6494f0);
}

.radar-bar-item.now-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  width: 2px;
  height: 6px;
  background: var(--amber);
  border-radius: 1px;
}

.radar-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.radar-legend-now {
  color: var(--amber);
  font-weight: 900;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .shell {
    width: min(100% - 24px, 640px);
    padding-top: 16px;
  }

  .hero-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .wide { grid-column: 1; }

  .current { min-height: 340px; padding: 28px; }

  .side-panel {
    grid-template-columns: repeat(3, 1fr);
  }

  .temperature,
  .temperature-shadow {
    font-size: 110px;
  }
}

@media (max-width: 540px) {
  .side-panel { grid-template-columns: repeat(2, 1fr); }
  .topbar { flex-wrap: wrap; }
  .search { order: 3; grid-column: 1 / -1; }
  .temperature, .temperature-shadow { font-size: 92px; }
}
