@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

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

:root {
  --navy-950: #03061a;
  --navy-900: #060d2e;
  --navy-800: #0b1547;
  --navy-700: #101d60;
  --navy-600: #1a2d82;
  --navy-500: #2240a8;
  --accent:   #4f8ef7;
  --accent2:  #7eb3ff;
  --teal:     #38d9c0;
  --amber:    #f5a623;
  --rose:     #f76f8e;
  --text-pri: #eef2ff;
  --text-sec: #8fa3cc;
  --text-muted: #4d6494;
  --card-bg:  rgba(11,21,71,0.72);
  --card-border: rgba(79,142,247,0.18);
  --glass: rgba(255,255,255,0.05);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
}

html, body {
  min-height: 100%;
  font-family: 'Outfit', sans-serif;
  background: var(--navy-950);
  color: var(--text-pri);
  overflow-x: hidden;
}

/* ── Background ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 0%,   rgba(34,64,168,0.55) 0%, transparent 65%),
    radial-gradient(ellipse 45% 40% at 85% 10%,  rgba(79,142,247,0.25) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 50% 100%, rgba(6,13,46,0.9)     0%, transparent 70%),
    var(--navy-950);
  z-index: 0;
  pointer-events: none;
}

/* ── Layout shell ── */
.shell {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: 78px;
  background: rgba(6,13,46,0.85);
  border-right: 1px solid var(--card-border);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 0 32px;
  gap: 8px;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}

.sidebar-logo {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: 28px;
  box-shadow: 0 0 24px rgba(79,142,247,0.4);
}

.nav-link {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  text-decoration: none;
  color: var(--text-muted);
  transition: all 0.2s;
  position: relative;
}

.nav-link:hover { background: var(--glass); color: var(--text-sec); }
.nav-link.active {
  background: linear-gradient(135deg, rgba(79,142,247,0.25), rgba(56,217,192,0.12));
  color: var(--accent2);
  box-shadow: inset 0 0 0 1px rgba(79,142,247,0.35);
}

.nav-link .tooltip {
  position: absolute;
  left: 58px;
  background: var(--navy-800);
  border: 1px solid var(--card-border);
  color: var(--text-pri);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 99;
}

.nav-link:hover .tooltip { opacity: 1; }

.sidebar-spacer { flex: 1; }

/* ── Main content ── */
.main {
  flex: 1;
  padding: 28px 32px;
  min-width: 0;
  overflow-y: auto;
}

/* ── Top bar ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.topbar-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-pri);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.time-badge {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 50px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sec);
}

#liveClock {
  font-weight: 700;
  color: var(--text-pri);
  font-variant-numeric: tabular-nums;
}

.loc-badge {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 50px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent2);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Glass card ── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(18px);
  padding: 22px 24px;
}

.card-sm { padding: 16px 18px; }

/* ── Section label ── */
.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* ── Stat pill ── */
.stat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-sec);
}

.stat-row + .stat-row { margin-top: 8px; }

.stat-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Chart wrapper ── */
.chart-box {
  position: relative;
  height: 220px;
}

/* ── Metric card ── */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}

.metric-card {
  background: var(--glass);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  transition: transform 0.2s, border-color 0.2s;
}

.metric-card:hover {
  transform: translateY(-3px);
  border-color: rgba(79,142,247,0.38);
}

.metric-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.metric-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-pri);
  line-height: 1;
}

.metric-unit {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-sec);
  margin-left: 3px;
}

.metric-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

.metric-icon {
  font-size: 22px;
  margin-bottom: 10px;
}

/* ── Spinner ── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 28px; height: 28px;
  border: 3px solid rgba(79,142,247,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 24px auto;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .main { padding: 18px 14px; }
}

/* ── Alert banner ── */
.alert-banner {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 13px;
  font-weight: 500;
}

.alert-banner.show { display: flex; }
.alert-warn { background: rgba(245,166,35,0.15); border: 1px solid rgba(245,166,35,0.4); color: #f5a623; }
.alert-danger { background: rgba(247,111,142,0.15); border: 1px solid rgba(247,111,142,0.4); color: #f76f8e; }

/* ── Tabs ── */
.tab-row { display: flex; gap: 6px; margin-bottom: 18px; }
.tab-btn {
  padding: 7px 18px;
  border-radius: 50px;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text-sec);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.tab-btn:hover { background: var(--glass); color: var(--text-pri); }
.tab-btn.active {
  background: linear-gradient(135deg, var(--accent), rgba(56,217,192,0.7));
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}

/* ── Table ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--card-border);
}

.data-table td {
  padding: 11px 14px;
  color: var(--text-sec);
  border-bottom: 1px solid rgba(79,142,247,0.06);
}

.data-table tr:hover td { background: var(--glass); }

.data-table td:first-child { color: var(--text-pri); font-weight: 500; }

/* ── Forecast day card ── */
@keyframes fadeUp { from { opacity:0; transform:translateY(14px); } to { opacity:1; transform:translateY(0); } }

.fc-day {
  background: var(--glass);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  text-align: center;
  animation: fadeUp 0.4s ease both;
  transition: transform 0.2s, border-color 0.2s;
}

.fc-day:hover { transform: translateY(-4px); border-color: rgba(79,142,247,0.4); }
.fc-day.today { border-color: rgba(79,142,247,0.55); background: rgba(79,142,247,0.1); }

.fc-day-name { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 10px; }
.fc-day-name.today-label { color: var(--accent2); }
.fc-icon { font-size: 2rem; margin-bottom: 8px; }
.fc-max { font-size: 20px; font-weight: 800; color: var(--text-pri); }
.fc-min { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.fc-cond { font-size: 11px; color: var(--text-sec); margin-top: 6px; line-height: 1.4; }
.fc-bar-wrap { height: 4px; border-radius: 99px; background: rgba(79,142,247,0.15); margin: 10px 0 6px; overflow: hidden; }
.fc-bar { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--teal)); }
.fc-rain { font-size: 11px; color: var(--accent2); margin-top: 4px; }
