/* WeatherMate — styles */
:root {
  --font: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --glass: rgba(255,255,255,0.10);
  --glass-stroke: rgba(255,255,255,0.18);
  --radius-card: 26px;
  --ink: #fff;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: var(--font);
  background: #0a0a12;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; color: inherit; border: none; background: none; cursor: pointer; }

/* ---------- device shell ---------- */
#root { height: 100%; }
.stage {
  height: 100%; width: 100%;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(1200px 800px at 30% -10%, #25204a 0%, transparent 60%),
    radial-gradient(1000px 700px at 110% 110%, #1a2740 0%, transparent 55%),
    #0a0a12;
  overflow: hidden;
}
.device {
  position: relative;
  width: 100%; height: 100%;
  max-width: 440px;
  overflow: hidden;
  background: #11131c;
  isolation: isolate;
}
/* framed look on large screens */
@media (min-width: 480px) and (min-height: 760px) {
  .stage { padding: 22px; }
  .device {
    height: min(932px, calc(100vh - 44px));
    border-radius: 46px;
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow: 0 40px 90px -20px rgba(0,0,0,0.7), 0 0 0 11px #07080d, 0 0 0 12px rgba(255,255,255,0.06);
  }
}

/* ---------- background layers ---------- */
.wx-bg { position: absolute; inset: 0; overflow: hidden; transition: background 1.2s ease; z-index: 0; }
.wx-glow, .wx-rays, .wx-vignette { position: absolute; inset: 0; pointer-events: none; }
.wx-glow { transition: background 1.2s ease; }
.wx-vignette { background: radial-gradient(120% 80% at 50% 8%, transparent 40%, rgba(0,0,0,0.28) 100%); }
.wx-rays { mix-blend-mode: screen; opacity: 0.8; }

.wx-star { position: absolute; border-radius: 50%; background: #fff; box-shadow: 0 0 6px rgba(255,255,255,0.7); }
.wx-twinkle { animation: twinkle 3.2s ease-in-out infinite; }
@keyframes twinkle { 0%,100% { opacity: 0.25; } 50% { opacity: 1; } }

.wx-cloud-layer { position: absolute; inset: 0; overflow: hidden; }
.wx-cloud-layer > div { position: absolute; left: -40%; }
.wx-softcloud {
  width: 360px; height: 120px; border-radius: 100px;
  background: radial-gradient(60% 80% at 30% 60%, rgba(255,255,255,0.9), rgba(255,255,255,0) 70%),
              radial-gradient(55% 90% at 60% 45%, rgba(255,255,255,0.85), rgba(255,255,255,0) 72%),
              radial-gradient(50% 80% at 80% 65%, rgba(255,255,255,0.8), rgba(255,255,255,0) 70%);
  filter: blur(6px);
}
.wx-drift { animation-name: drift; animation-timing-function: linear; animation-iteration-count: infinite; }
@keyframes drift { from { transform: translateX(0) scale(var(--s,1)); } to { transform: translateX(180vw) scale(var(--s,1)); } }

.wx-precip { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.wx-rain {
  position: absolute; top: -12%; width: 2px; border-radius: 2px;
  background: linear-gradient(transparent, rgba(190,215,245,0.9));
  animation: rainfall linear infinite;
}
@keyframes rainfall { from { transform: translateY(-20vh); } to { transform: translateY(120vh); } }
.wx-snow {
  position: absolute; top: -6%; border-radius: 50%; background: #fff;
  box-shadow: 0 0 4px rgba(255,255,255,0.6);
  animation: snowfall linear infinite;
}
@keyframes snowfall {
  0% { transform: translate(0, -10vh); }
  100% { transform: translate(var(--drift,0), 120vh); }
}

.wx-fogwrap { position: absolute; inset: 0; overflow: hidden; }
.wx-fogband {
  position: absolute; left: -20%; width: 140%; height: 120px;
  background: linear-gradient(90deg, transparent, rgba(232,236,243,0.55), transparent);
  filter: blur(14px);
}
.wx-fogdrift { animation: fogdrift linear infinite; }
@keyframes fogdrift { from { transform: translateX(-12%); } to { transform: translateX(12%); } }

.wx-lightning { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; animation: lightning 7s infinite; }
@keyframes lightning {
  0%, 92%, 100% { opacity: 0; }
  93% { opacity: 0.0; } 94% { opacity: 0.55; } 95% { opacity: 0.05; }
  96% { opacity: 0.6; } 97% { opacity: 0; }
}

/* ---------- icon animations ---------- */
.wx-anim { will-change: transform; }
.wx-spin { animation: spin 26s linear infinite; }
.wx-spin-slow { animation: spin 120s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.wx-float { animation: floaty 4.5s ease-in-out infinite; }
.wx-float-slow { animation: floaty 6.5s ease-in-out infinite; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.wx-drop { animation: drop 1.1s ease-in infinite; }
@keyframes drop { 0% { transform: translateY(-6px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(10px); opacity: 0; } }
.wx-flake { animation: flake 2.4s ease-in-out infinite; }
@keyframes flake { 0% { transform: translateY(-4px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(12px); opacity: 0; } }
.wx-flash { animation: flash 3.5s ease-in-out infinite; transform-origin: center; }
@keyframes flash { 0%,40%,100% { opacity: 0.25; } 45%,55% { opacity: 1; } }
.wx-fog { animation: fogline 3s ease-in-out infinite; }
@keyframes fogline { 0%,100% { transform: translateX(-4px); } 50% { transform: translateX(4px); } }

/* ---------- screen scaffolding ---------- */
.screen {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column;
  height: 100%;
}
.scroll {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.scroll::-webkit-scrollbar { display: none; }

/* ---------- status bar ---------- */
.statusbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px 4px; font-size: 15px; font-weight: 600;
  letter-spacing: 0.3px; flex: none; position: relative; z-index: 3;
}
.statusbar .sb-icons { display: flex; align-items: center; gap: 6px; }
.statusbar svg { display: block; }

/* ---------- glass ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-stroke);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  backdrop-filter: blur(20px) saturate(1.2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 10px 30px -12px rgba(0,0,0,0.4);
}

/* ---------- hero ---------- */
.hero { text-align: center; padding: 6px 24px 4px; position: relative; z-index: 2; }
.hero .city { font-size: 34px; font-weight: 500; letter-spacing: 0.2px; }
.hero .temp {
  font-size: 96px; font-weight: 200; line-height: 1; letter-spacing: -4px;
  margin-left: 10px; /* optical: balance the degree mark */
}
.hero .temp .deg { font-weight: 200; }
.hero .cond { font-size: 20px; font-weight: 600; color: var(--theme-sub, rgba(235,235,245,0.7)); }
.hero .hilo { font-size: 20px; font-weight: 600; }
.hero .hilo span { margin: 0 4px; }

/* novel hero variant */
.hero.novel { text-align: left; padding-left: 30px; }
.hero.novel .temp { font-size: 120px; letter-spacing: -6px; margin-left: -6px; }
.hero.novel .city { font-size: 28px; }

/* ---------- forecast card ---------- */
.fc-card { margin: 0 14px; border-radius: var(--radius-card); padding: 14px 4px 16px; }
.fc-tabs { display: flex; gap: 18px; padding: 2px 18px 12px; border-bottom: 1px solid rgba(255,255,255,0.14); margin: 0 0 12px; }
.fc-tab { font-size: 15px; font-weight: 700; letter-spacing: -0.3px; color: rgba(235,235,245,0.5); padding-bottom: 8px; position: relative; }
.fc-tab.active { color: #fff; }
.fc-tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -13px; height: 3px; border-radius: 3px; background: #fff; }

.hours { display: flex; gap: 4px; overflow-x: auto; padding: 4px 12px 6px; scrollbar-width: none; }
.hours::-webkit-scrollbar { display: none; }
.hour-slot {
  flex: none; width: 60px; padding: 12px 0 14px; border-radius: 30px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transition: background 0.25s ease, transform 0.2s ease; cursor: pointer; border: 1px solid transparent;
}
.hour-slot .h-label { font-size: 15px; font-weight: 600; color: var(--theme-sub, rgba(235,235,245,0.7)); }
.hour-slot .h-temp { font-size: 18px; font-weight: 600; }
.hour-slot .h-pop { font-size: 11px; font-weight: 700; color: #8fc4f5; height: 12px; }
.hour-slot.active { background: rgba(255,255,255,0.16); border-color: rgba(255,255,255,0.22); box-shadow: inset 0 1px 0 rgba(255,255,255,0.15); }
.hour-slot.active .h-label { color: #fff; }
.hour-slot:active { transform: scale(0.95); }

/* weekly */
.week { display: flex; flex-direction: column; padding: 0 6px; }
.week-row { display: grid; grid-template-columns: 56px 30px 1fr 86px; align-items: center; gap: 10px; padding: 11px 12px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.week-row:last-child { border-bottom: none; }
.week-row .w-day { font-size: 18px; font-weight: 600; }
.week-row .w-pop { font-size: 12px; font-weight: 700; color: #8fc4f5; }
.week-row .w-lo { color: var(--theme-sub, rgba(235,235,245,0.6)); font-weight: 600; }
.week-row .w-hi { font-weight: 600; text-align: right; }
.tempbar { height: 5px; border-radius: 5px; background: rgba(255,255,255,0.18); position: relative; overflow: hidden; }
.tempbar > i { position: absolute; top: 0; bottom: 0; border-radius: 5px; background: linear-gradient(90deg, #65b1ff, #ffd45e); }

/* ---------- detail widgets ---------- */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 4px 14px 20px; }
.dwidget { border-radius: 22px; padding: 14px 16px 16px; min-height: 150px; display: flex; flex-direction: column; }
.dwidget .dw-head { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase; color: var(--theme-sub, rgba(235,235,245,0.6)); }
.dwidget .dw-value { font-size: 30px; font-weight: 500; margin-top: 8px; letter-spacing: -0.5px; }
.dwidget .dw-note { font-size: 14px; font-weight: 500; margin-top: auto; color: rgba(235,235,245,0.8); }
.dwidget .dw-unit { font-size: 18px; font-weight: 500; color: var(--theme-sub, rgba(235,235,245,0.6)); }

/* sun arc */
.sun-arc { margin-top: 8px; flex: 1; position: relative; }
.sun-arc svg { width: 100%; height: 100%; overflow: visible; }

/* wind compass */
.compass { margin-top: 6px; align-self: center; }

/* ---------- medium summary widget ---------- */
.summary { margin: 8px 14px 14px; border-radius: var(--radius-card); padding: 14px 18px; display: flex; align-items: center; gap: 14px; }
.summary .s-txt { flex: 1; }
.summary .s-title { font-size: 13px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase; color: var(--theme-sub, rgba(235,235,245,0.6)); }
.summary .s-body { font-size: 16px; font-weight: 500; margin-top: 4px; line-height: 1.32; }

/* ---------- bottom nav ---------- */
.bottombar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  display: grid; grid-template-columns: 1fr 1fr 64px 1fr 1fr; align-items: center;
  padding: 10px 4px calc(16px + env(safe-area-inset-bottom, 0px));
  background: rgba(14,12,26,0.82);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,0.10);
}
.bottombar .nav-btn {
  justify-self: center; width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: rgba(255,255,255,0.45); transition: color 0.2s, background 0.2s;
}
.bottombar .nav-btn.active { color: #fff; }
.bottombar .nav-btn:active { background: rgba(255,255,255,0.10); }
.bottombar .add {
  justify-self: center; width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.28);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 4px 14px -4px rgba(0,0,0,0.5); color: #fff; font-size: 24px; font-weight: 300;
  display: flex; align-items: center; justify-content: center; margin-top: -10px;
}

/* ---------- pull to refresh ---------- */
.ptr { display: flex; align-items: center; justify-content: center; overflow: hidden; transition: height 0.25s ease; }
.ptr-spinner { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,0.25); border-top-color: #fff; }
.ptr.spin .ptr-spinner { animation: spin 0.7s linear infinite; }

/* ---------- search screen ---------- */
.search-screen { background: rgba(10,10,18,0.55); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); }
.search-head { padding: 10px 20px 6px; display: flex; align-items: center; gap: 12px; }
.search-head h1 { font-size: 30px; font-weight: 700; margin: 0; flex: 1; letter-spacing: 0.3px; }
.search-head .done-btn { font-size: 16px; font-weight: 600; color: #c69cf5; }
.search-box { margin: 8px 20px 12px; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px; background: rgba(255,255,255,0.12); }
.search-box input { flex: 1; background: none; border: none; outline: none; color: #fff; font-size: 17px; }
.search-box input::placeholder { color: rgba(235,235,245,0.5); }
.search-list { padding: 4px 16px 24px; display: flex; flex-direction: column; gap: 10px; }
.result-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; text-align: left; width: 100%; }
.result-card .r-temp { font-size: 30px; font-weight: 300; }
.result-card .r-name { font-size: 19px; font-weight: 600; }
.result-card .r-sub { font-size: 13px; color: var(--theme-sub, rgba(235,235,245,0.6)); margin-top: 2px; }
.result-card .r-meta { margin-left: auto; text-align: right; }
.hint { text-align: center; color: rgba(235,235,245,0.5); font-size: 14px; padding: 30px 24px; }

/* fade/slide transitions */
.fade-enter { animation: fadeUp 0.45s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.sheet-enter { animation: sheetUp 0.4s cubic-bezier(0.2,0.8,0.2,1) both; }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }

/* sample/offline pill */
.offline-pill {
  position: absolute; top: 50px; left: 50%; transform: translateX(-50%); z-index: 6;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.2px;
  padding: 5px 12px; border-radius: 20px; background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.16); color: rgba(255,255,255,0.85);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}

/* ---------- radar screen ---------- */
.radar-screen { background: #0d1117; }
.radar-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px 10px; flex: none; z-index: 3; position: relative;
}
.radar-back {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(255,255,255,0.12);
}
.radar-title { font-size: 22px; font-weight: 700; letter-spacing: 0.2px; }
.radar-sub { font-size: 13px; color: rgba(235,235,245,0.55); font-weight: 500; margin-top: 1px; }
.radar-time { font-size: 13px; font-weight: 600; color: rgba(235,235,245,0.7); }

.radar-map {
  flex: 1; position: relative; overflow: hidden;
  background: #1a2233;
}
.radar-loader {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}

.radar-controls {
  flex: none; margin: 10px 14px 12px; border-radius: 20px;
  padding: 12px 16px 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.radar-timeline {
  display: flex; gap: 4px; align-items: center; justify-content: center;
}
.radar-tick {
  flex: 1; height: 4px; border-radius: 4px;
  background: rgba(255,255,255,0.22); transition: background 0.2s;
}
.radar-tick.active { background: #fff; }
.radar-play {
  align-self: center; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.28);
  display: flex; align-items: center; justify-content: center;
  color: #fff; transition: background 0.2s;
}
.radar-play:active { background: rgba(255,255,255,0.3); }

.radar-legend { display: flex; flex-direction: column; gap: 4px; }
.radar-legend-bar {
  height: 6px; border-radius: 4px;
  background: linear-gradient(90deg,
    rgba(0,100,255,0.7),
    rgba(0,220,100,0.8),
    rgba(255,220,0,0.9),
    rgba(255,80,0,0.95),
    rgba(200,0,200,1));
}
.radar-legend-labels {
  display: flex; justify-content: space-between;
  font-size: 11px; font-weight: 600; color: rgba(235,235,245,0.5);
}

.radar-attr {
  flex: none; text-align: center; font-size: 10px;
  color: rgba(235,235,245,0.3); padding: 4px 0 calc(8px + env(safe-area-inset-bottom, 0px));
}

/* reduce motion */
@media (prefers-reduced-motion: reduce) {
  .wx-spin, .wx-spin-slow, .wx-drift, .wx-rain, .wx-snow, .wx-fogdrift, .wx-lightning,
  .wx-float, .wx-float-slow, .wx-drop, .wx-flake, .wx-flash, .wx-twinkle { animation: none !important; }
}
