/* ============================================================
   Weather App — Glassmorphism Dark Theme
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0e1a;
  --bg2: #0f1525;
  --glass: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.08);
  --text: #e2e8f8;
  --muted: #8892b0;
  --accent: #60a5fa;
  --accent2: #a78bfa;
  --warm: #fb923c;
  --error: #f87171;
  --radius-lg: 20px;
  --radius-md: 12px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ── Base ─────────────────────────────────────────────────── */

body {
  background: radial-gradient(ellipse at 30% 20%, #111827 0%, #0a0e1a 55%, #050810 100%);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  padding: 2rem 1.5rem 3rem;
}

/* ── Header ───────────────────────────────────────────────── */

.app-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  text-align: center;
  margin-bottom: 2.5rem;
}

.app-header-logo {
  flex-shrink: 0;
  filter: drop-shadow(0 0 12px rgba(96, 165, 250, 0.4));
}

.app-header-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}

.app-title {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.app-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Zones Grid ───────────────────────────────────────────── */

.zones-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 1280px;
  margin: 0 auto;
}

@media (max-width: 1024px) {
  .zones-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .zones-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Zone Card ────────────────────────────────────────────── */

.zone {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-height: 440px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.zone:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

/* Gradient top accent border */
.zone::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent2) 100%);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  opacity: 0.7;
}

/* ── Zone Search / Autocomplete ───────────────────────────── */

.zone-search {
  position: relative;
}

.zone-city-input {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.zone-city-input::placeholder {
  color: var(--muted);
}

.zone-city-input:focus {
  border-color: var(--accent);
  background: rgba(96, 165, 250, 0.06);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
}

.zone-autocomplete-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: rgba(15, 21, 37, 0.95);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  list-style: none;
  z-index: 100;
  max-height: 200px;
  overflow-y: auto;
  display: none;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  scrollbar-width: thin;
  scrollbar-color: var(--glass-border) transparent;
}

.zone-autocomplete-list.open {
  display: block;
}

.zone-autocomplete-list li {
  padding: 0.55rem 1rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.zone-autocomplete-list li:first-child {
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.zone-autocomplete-list li:last-child {
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.zone-autocomplete-list li:hover,
.zone-autocomplete-list li.ac-active {
  background: rgba(96, 165, 250, 0.12);
  color: var(--text);
}

/* ── Current Conditions ───────────────────────────────────── */

.zone-current {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 0 0.5rem;
  flex: 1;
}

.zone-city-name {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-align: center;
}

.zone-city-name:empty {
  display: none;
}

.zone-temp {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(135deg, var(--text) 0%, rgba(226, 232, 248, 0.7) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.zone-temp.temp-hot {
  background: linear-gradient(135deg, var(--warm) 0%, #fbbf24 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.zone-temp.temp-cold {
  background: linear-gradient(135deg, var(--accent) 0%, #93c5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.zone-condition-img {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zone-condition-img img {
  width: 64px;
  height: 64px;
  filter: drop-shadow(0 2px 8px rgba(96, 165, 250, 0.3));
}

.zone-condition-label {
  font-size: 0.95rem;
  color: var(--muted);
  text-transform: capitalize;
  text-align: center;
}

/* ── Zone Meta (humidity + wind) ──────────────────────────── */

.zone-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 0.2rem;
}

.zone-meta-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.zone-meta-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

/* ── 7-Day Forecast Strip ─────────────────────────────────── */

.zone-forecast {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: var(--glass-border) transparent;
}

.zone-forecast::-webkit-scrollbar {
  height: 3px;
}

.zone-forecast::-webkit-scrollbar-track {
  background: transparent;
}

.zone-forecast::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 2px;
}

.forecast-day {
  flex: 1 0 56px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.35rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.forecast-day:hover {
  background: rgba(96, 165, 250, 0.08);
  border-color: rgba(96, 165, 250, 0.2);
}

.forecast-day[data-today="true"],
.forecast-day.today {
  background: rgba(96, 165, 250, 0.1);
  border-color: rgba(96, 165, 250, 0.35);
}

.forecast-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.forecast-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.forecast-icon img {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 1px 4px rgba(96, 165, 250, 0.25));
}

.forecast-high {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
}

.forecast-low {
  font-size: 0.75rem;
  color: var(--muted);
}

/* ── Loading State ────────────────────────────────────────── */

.zone-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: rgba(10, 14, 26, 0.75);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  font-size: 0.85rem;
  color: var(--muted);
  z-index: 10;
}

.zone-loading[hidden] {
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(96, 165, 250, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

/* ── Error State ──────────────────────────────────────────── */

.zone-error-msg {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.25);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  color: var(--error);
  margin-top: auto;
}

.zone--error {
  border-color: rgba(248, 113, 113, 0.35);
}

.zone--error::before {
  background: linear-gradient(90deg, var(--error) 0%, #fb923c 100%);
}

/* ── Footer ───────────────────────────────────────────────── */

.app-footer {
  text-align: center;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--glass-border);
  font-size: 0.78rem;
  color: var(--muted);
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
}

.app-footer a {
  color: var(--accent);
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 0.2s;
}

.app-footer a:hover {
  opacity: 1;
}

/* ── Responsive adjustments ───────────────────────────────── */

@media (max-width: 768px) {
  body {
    padding: 1.25rem 1rem 2.5rem;
  }

  .app-title {
    font-size: 1.9rem;
  }

  .zone {
    min-height: 380px;
  }

  .zone-temp {
    font-size: 3rem;
  }
}

@media (max-width: 480px) {
  .app-header {
    flex-direction: column;
    gap: 0.5rem;
  }

  .app-header-text {
    align-items: center;
  }
}
