:root {
  color-scheme: dark;
  --bg: #0b1120;
  --bg-alt: rgba(15, 23, 42, 0.7);
  --surface: rgba(30, 41, 59, 0.55);
  --surface-hover: rgba(51, 65, 85, 0.65);
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #38bdf8;
  --primary-glow: rgba(56, 189, 248, 0.35);
  --accent: #2dd4bf;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(56, 189, 248, 0.4);
  --warning: #f59e0b;
  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg);
  background-image: 
    radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(45, 212, 191, 0.12) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  width: min(1240px, calc(100% - 3rem));
  margin: 0 auto;
}

/* Typography */
h1, h2, h3, h4 {
  color: #ffffff;
  font-weight: 700;
  line-height: 1.25;
}

.text-muted { color: var(--text-muted); }
.small { font-size: 0.85rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-full);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
}

.btn-sm {
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-outline:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: var(--primary);
  color: var(--primary);
}

/* Header & Navigation */
.app-header {
  background: rgba(11, 17, 32, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 1.2rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #0b1120;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 0 20px var(--primary-glow);
}

.brand-title {
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.badge-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(56, 189, 248, 0.15);
  color: var(--primary);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.brand-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.unit-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0.2rem;
}

.unit-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-weight: 700;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

.unit-btn.active {
  background: var(--primary);
  color: #0b1120;
}

/* Search Bar & Quick Cities */
.nav-tabs-bar {
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid var(--border);
  padding: 0.8rem 0;
}

.search-container {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.search-input-wrapper {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0.75rem 1rem 0.75rem 2.8rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

.quick-cities {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
}

.city-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.city-pill:hover,
.city-pill.active {
  background: var(--primary);
  color: #0b1120;
  border-color: var(--primary);
}

/* Main Layout */
.main-content {
  padding: 2.5rem 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

/* Current Weather Card */
.current-weather-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.95));
  border: 1px solid var(--border-hover);
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
}

.current-temp-big {
  font-size: 4.5rem;
  font-weight: 800;
  line-height: 1;
  color: #ffffff;
  margin: 0.5rem 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.current-condition {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.weather-hero-icon {
  font-size: 4rem;
  color: var(--warning);
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  backdrop-filter: blur(12px);
  transition: var(--transition);
}

.metric-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
}

.metric-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.15);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.metric-label { font-size: 0.85rem; color: var(--text-muted); display: block; }
.metric-value { font-size: 1.6rem; font-weight: 800; color: #ffffff; margin: 0.1rem 0; }
.metric-sub { font-size: 0.78rem; color: var(--text-muted); }

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

/* Forecast List */
.forecast-list {
  display: grid;
  gap: 0.9rem;
}

.forecast-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.2rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.forecast-day {
  font-weight: 600;
  width: 110px;
}

.forecast-cond {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
}

.forecast-temp {
  font-family: 'Fira Code', monospace;
  font-weight: 700;
}

/* Hourly Bars */
.hourly-bars {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: 220px;
  padding-top: 1.5rem;
}

.hourly-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  height: 100%;
  justify-content: flex-end;
}

.hourly-bar-track {
  width: 14px;
  height: 120px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hourly-bar-fill {
  width: 100%;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  border-radius: var(--radius-full);
  transition: height 0.6s ease;
}

.hourly-time {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.hourly-temp {
  font-family: 'Fira Code', monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--accent);
  color: #0b1120;
  font-weight: 700;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(20px);
  transition: var(--transition);
  pointer-events: none;
  z-index: 2000;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 992px) {
  .current-weather-card {
    grid-template-columns: 1fr;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}
