:root {
  --bg1: #0f172a;
  --bg2: #1e3a8a;
  --card: rgba(255, 255, 255, 0.08);
  --card-border: rgba(255, 255, 255, 0.14);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent2: #818cf8;
  --radius: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: var(--text);
  background: linear-gradient(160deg, var(--bg1) 0%, var(--bg2) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.topbar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  text-align: center;
}

.logo { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.5px; }

.search {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 520px;
}

.search input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.search input::placeholder { color: var(--muted); }
.search input:focus { border-color: var(--accent); background: rgba(255, 255, 255, 0.12); }

.btn {
  padding: 12px 20px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  transition: transform 0.1s, opacity 0.2s;
}
.btn:hover { opacity: 0.92; }
.btn:active { transform: scale(0.97); }

.btn-ghost {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--card-border);
  padding: 12px 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.card h3 { margin-bottom: 16px; font-size: 1.15rem; font-weight: 600; }

.current-card .current-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

#cityName { font-size: 2rem; font-weight: 700; }
.muted { color: var(--muted); }

.current-temp { display: flex; align-items: center; gap: 8px; }
.big-icon { font-size: 3.2rem; line-height: 1; }
.temp { font-size: 3.4rem; font-weight: 800; letter-spacing: -2px; }
.deg { font-size: 1.6rem; color: var(--muted); }

.desc { margin: 10px 0 18px; font-size: 1.15rem; }

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.metric {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.metric .label { font-size: 0.82rem; color: var(--muted); }
.metric .value { font-size: 1.15rem; font-weight: 600; }

.daily { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }

.day {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 14px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.15s, background 0.15s;
}
.day:hover { transform: translateY(-3px); background: rgba(255, 255, 255, 0.11); }
.day .dow { font-weight: 600; font-size: 0.95rem; }
.day .icon { font-size: 1.8rem; }
.day .range { font-size: 0.92rem; color: var(--muted); }
.day .tmax { font-weight: 700; font-size: 1.1rem; }

.hourly {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
}
.hour {
  flex: 0 0 auto;
  min-width: 72px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 12px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hour .time { font-size: 0.85rem; color: var(--muted); }
.hour .icon { font-size: 1.5rem; }
.hour .t { font-weight: 600; }
.hour .pop { font-size: 0.78rem; color: var(--accent); }

.footer { text-align: center; font-size: 0.85rem; }
.footer a { color: var(--accent); text-decoration: none; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: var(--text);
  border: 1px solid var(--card-border);
  padding: 12px 20px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  font-size: 0.95rem;
  z-index: 50;
}

@media (max-width: 480px) {
  #cityName { font-size: 1.5rem; }
  .temp { font-size: 2.6rem; }
  .big-icon { font-size: 2.4rem; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
}
