:root {
  --bg: #090c16;
  --bg-soft: #12162a;
  --card: rgba(255, 255, 255, 0.05);
  --line: rgba(255, 255, 255, 0.14);
  --text: #f4f7ff;
  --muted: #b8c1de;
  --accent: #74c0fc;
  --accent-2: #ffd166;
  --danger: #ff8d8d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(circle at 0% 0%, #1b2d4f 0%, transparent 28%),
    radial-gradient(circle at 90% 10%, #2c1f48 0%, transparent 33%),
    linear-gradient(160deg, var(--bg) 0%, #0b1020 55%, #12142a 100%);
}

.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
  padding: 0.85rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.95rem;
}

.tagline {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.2rem 1rem 2.4rem;
  display: grid;
  gap: 1rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.hero h1 {
  margin: 0.2rem 0 0.6rem;
  line-height: 1.08;
  font-size: clamp(1.55rem, 4vw, 2.55rem);
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-2);
  font-size: 0.72rem;
}

.lead {
  margin: 0;
  color: var(--muted);
  max-width: 72ch;
}

.search-container {
  position: relative;
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
}

.input-loc,
.action-btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.26);
  color: var(--text);
  font-size: 0.95rem;
  padding: 0.68rem 0.72rem;
}

.action-btn {
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}

.action-btn:hover {
  border-color: rgba(116, 192, 252, 0.7);
}

.input-loc:focus {
  outline: none;
  border-color: rgba(116, 192, 252, 0.75);
}

.suggestions {
  position: absolute;
  top: 3.05rem;
  left: 0;
  right: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  z-index: 12;
  border-radius: 10px;
  background: #1a1f34;
}

.suggestions:not(:empty) {
  border: 1px solid var(--line);
}

.suggestions li {
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  cursor: pointer;
}

.suggestions li:last-child {
  border-bottom: none;
}

.suggestions li:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.error-msg {
  margin: 0.75rem 0 0;
  color: var(--danger);
}

.stats-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.stat span,
.stat small {
  display: block;
  color: var(--muted);
  font-size: 0.79rem;
}

.stat strong {
  display: block;
  margin: 0.28rem 0;
  font-size: 1.4rem;
}

.info-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1.1fr 1fr;
}

.summary-layout {
  grid-template-columns: 1fr;
}

h2 {
  margin-top: 0;
  margin-bottom: 0.55rem;
}

.summary-line {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.vibe {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
}

.hint {
  margin: 0.65rem 0 0;
  color: #d6def8;
}

.weather-meta {
  display: flex;
  gap: 0.8rem;
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.hourly-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.52rem;
}

.hourly-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
}

.hourly-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.hourly-item img {
  width: 40px;
  height: 40px;
}

.hourly-item strong {
  display: block;
  margin-top: 0.1rem;
}

.hourly-item small {
  color: var(--muted);
}

.chart-card h2 {
  margin-bottom: 0.7rem;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.55rem;
}

.chart-header h2 {
  margin-bottom: 0;
}

.timeframe-toggle {
  display: inline-flex;
  gap: 0.45rem;
}

.timeframe-btn {
  text-decoration: none;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.36rem 0.72rem;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.22);
}

.timeframe-btn:hover {
  color: var(--text);
  border-color: rgba(116, 192, 252, 0.7);
}

.timeframe-btn.active {
  color: #061423;
  background: var(--accent);
  border-color: transparent;
}

.chart-container {
  width: 100%;
}

.chart-container .js-plotly-plot {
  width: 100% !important;
}

.daily-forecast {
  margin: 0;
  padding: 0;
  list-style: none;
}

.daily-forecast li {
  padding: 0.58rem 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.14);
  color: #d6def8;
}

.daily-forecast li:last-child {
  border-bottom: none;
}

.empty-state p {
  margin-bottom: 0;
  color: var(--muted);
}

.footer {
  border-top: 1px solid var(--line);
  padding: 0.8rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
}

@media (max-width: 900px) {
  .info-layout {
    grid-template-columns: 1fr;
  }

  .hourly-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .chart-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
