/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  min-height: 100vh;
  padding: 2rem 1rem;
}

/* ── Layout ── */
.container {
  max-width: 640px;
  margin: 0 auto;
}

header {
  margin-bottom: 1.5rem;
}

h1 {
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #f8fafc;
}

/* ── Search ── */
.search-row {
  display: flex;
  gap: 8px;
}

input[type="text"] {
  flex: 1;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #f1f5f9;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

input[type="text"]:focus {
  border-color: #60a5fa;
}

button {
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  background: #3b82f6;
  color: white;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover { background: #2563eb; }
button:active { transform: scale(0.98); }

/* ── Error ── */
.error {
  background: #7f1d1d;
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 14px;
}

.hidden { display: none; }

/* ── Hero Card ── */
.hero {
  background: #1e293b;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.hero h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: #f8fafc;
}

.hero p {
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 8px;
}

.temp {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1;
  color: #f8fafc;
}

.weather-icon {
  font-size: 4rem;
}

/* ── Stats Grid ── */
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 1rem;
}

.stat {
  background: #1e293b;
  border-radius: 8px;
  padding: 12px 14px;
}

.stat-label {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value {
  font-size: 1.2rem;
  font-weight: 600;
  color: #f1f5f9;
}

/* ── Unit Toggle ── */
.toggle-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

#unit-toggle {
  background: transparent;
  border: 1px solid #334155;
  color: #94a3b8;
  font-size: 13px;
  padding: 6px 12px;
}

#unit-toggle:hover {
  background: #1e293b;
  color: #f1f5f9;
}

/* ── Forecast ── */
.forecast-title {
  font-size: 12px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.forecast {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.day-card {
  background: #1e293b;
  border-radius: 8px;
  padding: 12px 8px;
  text-align: center;
}

.day-name {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 6px;
}

.day-icon {
  font-size: 1.4rem;
  margin-bottom: 6px;
}

.day-hi {
  font-size: 14px;
  font-weight: 600;
  color: #f1f5f9;
}

.day-lo {
  font-size: 12px;
  color: #64748b;
}
