/* ============================================
   AURA — Glassmorphism Weather
   Vanilla CSS · No framework
   ============================================ */

:root {
  /* Palette — soft dawn into dusk */
  --bg-1: #0a1430;
  --bg-2: #1e2a5e;
  --bg-3: #4a3a8a;
  --bg-4: #ff8fa3;

  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-bg-strong: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-shadow: 0 8px 32px rgba(8, 12, 40, 0.35);

  --text: #f5f7ff;
  --text-soft: rgba(245, 247, 255, 0.72);
  --text-mute: rgba(245, 247, 255, 0.5);

  --accent: #ffd28a;
  --accent-cool: #9ec5ff;

  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", system-ui, sans-serif;
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }
input { font: inherit; color: inherit; background: none; border: none; outline: none; }
a { color: inherit; }
ul { list-style: none; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }

/* ---------- Base ---------- */
body {
  font-family: var(--font-body);
  color: var(--text);
  background: linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 40%, var(--bg-3) 75%, var(--bg-4) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* ---------- Ambient background ---------- */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: float 18s ease-in-out infinite;
}
.orb--a {
  width: 520px; height: 520px;
  background: radial-gradient(circle, #ff8fa3, transparent 60%);
  top: -120px; left: -100px;
}
.orb--b {
  width: 460px; height: 460px;
  background: radial-gradient(circle, #9ec5ff, transparent 60%);
  bottom: -100px; right: -80px;
  animation-delay: -6s;
}
.orb--c {
  width: 380px; height: 380px;
  background: radial-gradient(circle, #ffd28a, transparent 60%);
  top: 40%; left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -12s;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(40px, -30px) scale(1.08); }
  66%      { transform: translate(-30px, 40px) scale(0.94); }
}
.orb--c { animation-name: floatCenter; }
@keyframes floatCenter {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%      { transform: translate(-55%, -45%) scale(1.1); }
}
.noise {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.4 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.5'/></svg>");
  opacity: 0.04;
  mix-blend-mode: overlay;
}

/* ---------- Layout shell ---------- */
.shell {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 48px);
  display: grid;
  gap: 24px;
  animation: fadeUp 0.8s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Glass surface ---------- */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255,255,255,0.15);
}

/* ---------- Topbar ---------- */
.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand__mark {
  width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, var(--accent) 60%, transparent 80%);
  box-shadow: 0 0 16px var(--accent);
}
.search {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  backdrop-filter: blur(20px);
  transition: border-color 0.25s, background 0.25s;
}
.search:focus-within {
  border-color: rgba(255,255,255,0.4);
  background: var(--glass-bg-strong);
}
.search__icon { width: 18px; height: 18px; color: var(--text-soft); }
#searchInput {
  flex: 1;
  min-width: 0;
  padding: 4px 0;
  color: var(--text);
}
#searchInput::placeholder { color: var(--text-mute); }
.search__btn {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.15);
  font-weight: 500;
  font-size: 0.85rem;
  transition: background 0.2s;
}
.search__btn:hover { background: rgba(255,255,255,0.25); }

.geo {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  backdrop-filter: blur(20px);
  transition: transform 0.2s, background 0.2s;
}
.geo:hover { background: var(--glass-bg-strong); transform: rotate(45deg); }
.geo svg { width: 18px; height: 18px; }

/* ---------- Suggestions dropdown ---------- */
.suggestions {
  position: relative;
  margin-top: -16px;
  background: rgba(20, 24, 60, 0.85);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(28px);
  overflow: hidden;
  max-height: 280px;
  overflow-y: auto;
}
.suggestions li {
  padding: 12px 18px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background 0.15s;
  display: flex; flex-direction: column; gap: 2px;
}
.suggestions li:last-child { border-bottom: none; }
.suggestions li:hover, .suggestions li.active {
  background: rgba(255,255,255,0.08);
}
.suggestions .sug__name { font-weight: 500; }
.suggestions .sug__meta { font-size: 0.8rem; color: var(--text-mute); }

/* ---------- Hero ---------- */
.hero {
  padding: clamp(24px, 4vw, 40px);
  display: grid;
  gap: 28px;
}
.hero__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}
.hero__eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 6px;
}
.hero__city {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.hero__time {
  margin-top: 6px;
  color: var(--text-soft);
  font-size: 0.95rem;
}
.hero__icon {
  width: clamp(80px, 14vw, 140px);
  height: clamp(80px, 14vw, 140px);
}
.hero__icon svg { width: 100%; height: 100%; }

.hero__body {
  display: flex;
  align-items: baseline;
  gap: 24px;
  flex-wrap: wrap;
}
.hero__temp {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(5rem, 14vw, 9rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  background: linear-gradient(180deg, #fff, rgba(255,255,255,0.7));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__temp sup { font-size: 0.4em; vertical-align: top; opacity: 0.7; }
.hero__desc {
  font-size: 1.15rem;
  color: var(--text-soft);
  text-transform: capitalize;
  font-style: italic;
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--glass-border);
}
.hero__stats li { display: flex; flex-direction: column; gap: 4px; }
.stat__label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.stat__value {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 400;
}

/* ---------- Panel ---------- */
.panel {
  padding: clamp(20px, 3vw, 32px);
  display: grid;
  gap: 20px;
}
.panel__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}
.panel__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}
.panel__sub {
  font-size: 0.85rem;
  color: var(--text-mute);
}

/* ---------- Hourly ---------- */
.hourly {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}
.hourly::-webkit-scrollbar { height: 6px; }
.hourly::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }

.hour {
  flex: 0 0 88px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  transition: transform 0.25s, background 0.25s;
}
.hour:hover {
  transform: translateY(-4px);
  background: rgba(255,255,255,0.12);
}
.hour--now {
  background: rgba(255,210,138,0.15);
  border-color: rgba(255,210,138,0.4);
}
.hour__time {
  font-size: 0.8rem;
  color: var(--text-soft);
  font-weight: 500;
}
.hour__icon { width: 32px; height: 32px; }
.hour__temp {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
}

/* ---------- Daily ---------- */
.daily { display: grid; gap: 4px; }
.day {
  display: grid;
  grid-template-columns: 1.2fr 40px 1fr 1.6fr;
  align-items: center;
  gap: 16px;
  padding: 14px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background 0.2s, padding 0.2s;
  border-radius: var(--radius-sm);
}
.day:last-child { border-bottom: none; }
.day:hover { background: rgba(255,255,255,0.05); padding-left: 16px; }

.day__name { font-weight: 500; }
.day__icon { width: 32px; height: 32px; }
.day__desc {
  font-size: 0.85rem;
  color: var(--text-soft);
  text-transform: capitalize;
}
.day__temps {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1rem;
}
.day__min { color: var(--text-mute); min-width: 32px; text-align: right; }
.day__max { color: var(--text); min-width: 32px; }
.day__bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.day__bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, var(--accent-cool), var(--accent));
  border-radius: 2px;
}

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-mute);
  padding: 12px 0;
}
.footer a { color: var(--text-soft); text-decoration: underline; text-underline-offset: 3px; }
.footer a:hover { color: var(--text); }

/* ---------- Loader ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 99;
  display: grid;
  place-items: center;
  gap: 16px;
  background: rgba(10, 20, 48, 0.6);
  backdrop-filter: blur(8px);
  color: var(--text-soft);
}
.loader__ring {
  width: 48px; height: 48px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.loader p { grid-column: 1; text-align: center; margin-top: 64px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  background: rgba(220, 60, 90, 0.9);
  border-radius: 999px;
  color: white;
  font-size: 0.9rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  z-index: 100;
  animation: toastIn 0.3s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .topbar { grid-template-columns: 1fr auto; }
  .brand { grid-column: 1; }
  .search { grid-column: 1 / -1; order: 3; }
  .geo { grid-column: 2; }

  .hero__stats { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .hero__top { flex-direction: column; }
  .hero__icon { align-self: flex-end; }

  .day { grid-template-columns: 1fr 32px 1.2fr; gap: 12px; padding: 12px 6px; }
  .day__bar { display: none; }
}

/* ---------- Reveal animation for children ---------- */
.panel, .hero { animation: fadeUp 0.7s ease both; }
.panel:nth-of-type(2) { animation-delay: 0.1s; }
.panel:nth-of-type(3) { animation-delay: 0.2s; }
