/* WeatherOps — Components */

/* ─── LAYOUT ─── */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── HEADER ─── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
[data-theme="light"] .header {
  background: rgba(244,247,255,0.85);
  backdrop-filter: blur(16px);
}
[data-theme="dark"] .header {
  background: rgba(10,15,30,0.85);
  backdrop-filter: blur(16px);
}

.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(79,139,255,0.3);
  flex-shrink: 0;
  color: white;
}
.logo-name { font-size: 17px; font-weight: 600; letter-spacing: -0.3px; }
.logo-tagline { font-size: 10px; color: var(--text3); letter-spacing: 1.5px; text-transform: uppercase; font-weight: 400; }

.header-center { flex: 1; max-width: 340px; margin: 0 24px; }

.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 14px;
  transition: border-color .2s, box-shadow .2s;
}
.search-bar:focus-within {
  border-color: var(--border2);
  box-shadow: 0 0 0 3px rgba(79,139,255,0.1);
}
.search-icon { font-size: 14px; color: var(--text3); flex-shrink: 0; }
.search-bar input {
  background: none; border: none; outline: none;
  color: var(--text); font-size: 13px; font-family: var(--sans);
  width: 100%;
}
.search-bar input::placeholder { color: var(--text3); }
.search-kbd {
  font-size: 10px; color: var(--text3); font-family: var(--mono);
  background: var(--bg4); border: 1px solid var(--border);
  padding: 2px 6px; border-radius: 4px; white-space: nowrap;
}

.header-actions { display: flex; align-items: center; gap: 10px; }

/* ─── UNIT TOGGLE ─── */
.unit-toggle {
  display: flex;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  padding: 2px;
  gap: 2px;
}
.unit-btn {
  padding: 5px 14px; font-size: 12px; font-weight: 500;
  border: none; border-radius: 8px;
  background: none; color: var(--text3);
  transition: all .2s;
}
.unit-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(79,139,255,0.3);
}

/* ─── THEME TOGGLE ─── */
.theme-toggle-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg3);
  display: flex; align-items: center; justify-content: center;
  color: var(--text2);
  transition: all .2s;
}
.theme-toggle-btn:hover { border-color: var(--border2); background: var(--bg4); }

/* ─── ALERT BADGE ─── */
.alert-badge {
  background: rgba(255,77,109,0.12);
  border: 1px solid rgba(255,77,109,0.3);
  color: var(--danger);
  border-radius: 10px;
  padding: 6px 14px;
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  animation: pulse-badge 2.5s ease-in-out infinite;
}
@keyframes pulse-badge {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,77,109,0.2); }
  50% { box-shadow: 0 0 0 5px rgba(255,77,109,0); }
}
.pulse-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--danger);
  animation: blink 1.2s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.2} }

/* ─── NAV TABS ─── */
.tab-nav {
  display: flex; gap: 0;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }

.nav-tab {
  padding: 14px 20px 13px;
  font-size: 13px; font-weight: 400;
  color: var(--text3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
  white-space: nowrap;
  border: none; background: none;
  display: flex; align-items: center; gap: 6px;
}
.nav-tab:hover { color: var(--text2); }
.nav-tab.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  font-weight: 500;
}
.nav-tab .tab-icon { display:inline-flex; align-items:center; }
.nav-tab .tab-icon svg { width:14px; height:14px; }
.nav-tab .tab-badge {
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 10px;
  line-height: 1.6;
}

/* ─── MAIN CONTENT ─── */
.main { padding: 24px 28px; max-width: 1400px; width: 100%; }

/* ─── TAB PANES ─── */
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:translateY(0); } }

/* ─── SECTION LABEL ─── */
.section-label {
  font-size: 10px; color: var(--text3);
  text-transform: uppercase; letter-spacing: 1.4px; font-weight: 600;
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px;
}
.section-label::after {
  content: '';
  flex: 1; height: 1px; background: var(--border);
}

/* ─── CARDS ─── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.card::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--card-glow);
  pointer-events: none;
  border-radius: inherit;
}
.card.accent-card::before {
  background: radial-gradient(circle at 30% 20%, rgba(79,139,255,0.1) 0%, transparent 70%);
}
[data-theme="light"] .card::before { opacity: 0.5; }

.card-sm { border-radius: 12px; padding: 16px; }
.card-label {
  font-size: 10px; color: var(--text3);
  text-transform: uppercase; letter-spacing: 1px; font-weight: 600;
  margin-bottom: 4px;
}
.card-title { font-size: 20px; font-weight: 600; letter-spacing: -0.3px; margin-bottom: 2px; }
.card-subtitle { font-size: 12px; color: var(--text3); margin-bottom: 18px; }

/* ─── TEMPERATURE HERO ─── */
.temp-hero { display: flex; align-items: flex-start; gap: 4px; margin-bottom: 4px; }
.temp-big { font-size: 68px; font-weight: 300; line-height: 1; letter-spacing: -3px; }
.temp-unit-sup { font-size: 24px; font-weight: 300; margin-top: 10px; color: var(--text2); }
.temp-feels { font-size: 12px; color: var(--text3); margin-bottom: 16px; }
.temp-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 10px;
  font-size: 12px; font-weight: 500; margin-bottom: 14px;
}

/* ─── STAT ROW ─── */
.stat-row {
  display: flex; gap: 0;
  border-top: 1px solid var(--border);
  padding-top: 14px; margin-top: 6px;
}
.stat-cell { flex: 1; }
.stat-cell + .stat-cell {
  border-left: 1px solid var(--border);
  padding-left: 14px; margin-left: 2px;
}
.stat-lbl { font-size: 9px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 4px; }
.stat-val { font-size: 14px; font-weight: 500; font-family: var(--mono); }

/* ─── METER BAR ─── */
.meter { margin-top: 8px; }
.meter-row {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 5px;
}
.meter-name { font-size: 12px; color: var(--text2); }
.meter-num { font-size: 20px; font-weight: 600; }
.meter-status { font-size: 10px; margin-bottom: 4px; }
.meter-track {
  height: 4px; border-radius: 2px;
  background: var(--bg4); overflow: hidden;
}
.meter-fill { height: 100%; border-radius: 2px; transition: width .8s ease; }
.meter + .meter { margin-top: 16px; }

/* ─── SOLAR GRID ─── */
.solar-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.solar-cell {
  background: var(--bg3); border-radius: 10px; padding: 12px;
  border: 1px solid var(--border);
}
.solar-lbl { font-size: 9px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 4px; }
.solar-time { font-size: 18px; font-weight: 600; font-family: var(--mono); }
.solar-tz { font-size: 9px; color: var(--text3); margin-top: 2px; }

/* ─── PRECIP ROWS ─── */
.precip-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; padding: 4px 0;
}
.precip-label { color: var(--text2); }
.precip-val { font-family: var(--mono); color: var(--cold); }

/* ─── MOON CARD ─── */
.moon-card {
  background: var(--bg3); border-radius: 8px; padding: 10px 12px;
  border: 1px solid var(--border);
  margin-top: 12px;
}
.moon-name { font-size: 12px; font-weight: 500; }
.moon-illum { font-size: 10px; color: var(--text3); }

/* ─── HERO GRID ─── */
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 1fr;
  gap: 16px;
  margin-bottom: 22px;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .hero-grid { grid-template-columns: 1fr; }
  .main { padding: 16px; }
  .header { padding: 12px 16px; }
  .tab-nav { padding: 0 16px; }
}

/* ─── HOURLY STRIP ─── */
.hourly-strip {
  display: flex; gap: 8px;
  overflow-x: auto; padding-bottom: 6px;
  scrollbar-width: none;
  margin-bottom: 22px;
}
.hourly-strip::-webkit-scrollbar { display: none; }

.hour-card {
  flex: 0 0 72px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .15s;
}
.hour-card:hover { border-color: var(--border2); transform: translateY(-1px); }
.hour-card.active {
  border-color: var(--accent);
  background: var(--bg3);
}
.hour-time { font-size: 10px; color: var(--text3); margin-bottom: 6px; font-family: var(--mono); font-weight: 500; }
.hour-icon { display:flex; align-items:center; justify-content:center; margin-bottom: 6px; }
.hour-icon svg { width:20px; height:20px; color:var(--text2); }
.hour-temp { font-size: 14px; font-weight: 600; }
.hour-pop { font-size: 10px; color: var(--cold); margin-top: 3px; font-family: var(--mono); }

/* ─── CHART CARD ─── */
.chart-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.chart-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.chart-title { font-size: 14px; font-weight: 500; }
.chart-meta { font-size: 11px; color: var(--text3); }
.chart-btns { display: flex; gap: 5px; }
.chart-btn {
  padding: 5px 12px; border-radius: 7px;
  font-size: 11px; font-weight: 500;
  border: 1px solid var(--border);
  background: none; color: var(--text3);
  transition: all .2s;
}
.chart-btn:hover { border-color: var(--border2); color: var(--text2); }
.chart-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chart-wrap { position: relative; height: 160px; }

/* ─── FORECAST GRID ─── */
.forecast-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 22px;
}
@media (max-width: 700px) {
  .forecast-grid { grid-template-columns: repeat(4, 1fr); }
}

.fc-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, transform .15s, box-shadow .2s;
  box-shadow: var(--shadow);
}
.fc-card:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
  box-shadow: var(--shadow2);
}
.fc-day { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 8px; font-weight: 600; }
.fc-icon { display:flex; align-items:center; justify-content:center; margin-bottom: 8px; }
.fc-icon svg { width:22px; height:22px; color:var(--text2); }
.fc-high { font-size: 15px; font-weight: 700; }
.fc-low { font-size: 12px; color: var(--text3); margin-top: 2px; }
.fc-bar-wrap { margin: 8px 4px 6px; height: 3px; background: var(--bg4); border-radius: 2px; overflow: hidden; }
.fc-bar { height: 100%; border-radius: 2px; }
.fc-pop { font-size: 10px; color: var(--cold); font-family: var(--mono); }

/* ─── BOTTOM GRID ─── */
.bottom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 22px; }
@media (max-width: 700px) { .bottom-grid { grid-template-columns: 1fr; } }

/* ─── ALERTS PANEL (mini) ─── */
.alerts-mini {
  background: var(--bg2);
  border: 1px solid rgba(255,77,109,0.2);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
}
[data-theme="light"] .alerts-mini {
  border-color: rgba(217,32,69,0.18);
  background: rgba(255,240,244,0.6);
}
.alert-row {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.alert-row:last-child { border-bottom: none; padding-bottom: 0; }
.sev-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; }
.sev-high { background: var(--danger); }
.sev-med  { background: var(--warn); }
.sev-low  { background: var(--success); }
.alert-title { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.alert-when  { font-size: 11px; color: var(--text3); }

/* ─── HISTORICAL MINI ─── */
.hist-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
}
.hist-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.hist-row:last-child { border-bottom: none; }
.hist-year { font-size: 10px; color: var(--text3); font-family: var(--mono); width: 34px; font-weight: 500; }
.hist-bar-track { flex: 1; height: 4px; background: var(--bg4); border-radius: 2px; overflow: hidden; }
.hist-bar { height: 100%; border-radius: 2px; }
.hist-range { font-size: 10px; color: var(--text2); font-family: var(--mono); white-space: nowrap; }

/* ─── FULL ALERTS ─── */
.alert-card-full {
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 12px;
  background: var(--bg3);
  transition: transform .15s, box-shadow .15s;
}
.alert-card-full:hover { transform: translateY(-1px); box-shadow: var(--shadow2); }
.alert-card-full.sev-danger {
  border-color: rgba(255,77,109,0.3);
  background: rgba(255,77,109,0.04);
}
[data-theme="light"] .alert-card-full.sev-danger {
  border-color: rgba(217,32,69,0.25);
  background: rgba(217,32,69,0.04);
}
.alert-card-full.sev-warn {
  border-color: rgba(255,203,71,0.3);
  background: rgba(255,203,71,0.04);
}
[data-theme="light"] .alert-card-full.sev-warn {
  border-color: rgba(196,139,0,0.25);
  background: rgba(196,139,0,0.04);
}
.alert-card-full.sev-info {
  border-color: rgba(79,139,255,0.2);
  background: rgba(79,139,255,0.03);
}
.alert-tag {
  display: inline-block;
  font-size: 9px; font-weight: 700;
  padding: 3px 9px; border-radius: 5px;
  margin-bottom: 8px;
  letter-spacing: 0.8px; text-transform: uppercase;
}
.tag-danger { background: rgba(255,77,109,0.15); color: var(--danger); }
.tag-warn   { background: rgba(255,203,71,0.15); color: var(--warn); }
.tag-info   { background: rgba(79,139,255,0.12); color: var(--accent); }
[data-theme="light"] .tag-warn { background: rgba(196,139,0,0.1); }

.alert-h { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.alert-h.danger { color: var(--danger); }
.alert-h.warn   { color: var(--warn); }
.alert-h.info   { color: var(--text2); }
.alert-meta-row {
  display: flex; flex-wrap: wrap; gap: 12px;
  font-size: 11px; color: var(--text3);
  margin-bottom: 10px;
}
.alert-body { font-size: 13px; color: var(--text2); line-height: 1.7; }

.next-event-box {
  margin-top: 20px; padding: 16px;
  background: var(--bg3); border-radius: 12px;
  border: 1px solid var(--border);
}
.next-event-box p { font-size: 12px; color: var(--text2); line-height: 1.7; }

/* ─── HISTORICAL FULL ─── */
.hist-charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 700px) { .hist-charts-grid { grid-template-columns: 1fr; } }

.stats5-grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 12px; margin-top: 4px;
}
@media (max-width: 700px) { .stats5-grid { grid-template-columns: repeat(3, 1fr); } }

.stat-box {
  background: var(--bg3); border-radius: 12px;
  padding: 14px; text-align: center;
  border: 1px solid var(--border);
}
.stat-box-label {
  font-size: 9px; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.8px;
  margin-bottom: 8px; font-weight: 600;
}
.stat-box-val { font-size: 22px; font-weight: 700; }
.stat-box-note { font-size: 10px; color: var(--text3); margin-top: 4px; }
.stat-box-delta { font-size: 10px; margin-top: 4px; }

/* ─── RADAR ─── */
.radar-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.radar-canvas-wrap {
  border-radius: 12px;
  overflow: hidden;
  background: #050c1a;
  position: relative;
  height: 300px;
}
.radar-legend {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 16px; margin-top: 14px;
  font-size: 11px; color: var(--text3);
}
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-bar { width: 36px; height: 4px; border-radius: 2px; }
.radar-info-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 14px; margin-top: 4px;
}
@media (max-width: 700px) { .radar-info-grid { grid-template-columns: 1fr 1fr; } }

/* ─── WIND COMPASS ─── */
.compass-wrap {
  display: flex; flex-direction: column; align-items: center;
  padding: 20px;
}
.compass-canvas { border-radius: 50%; }

/* ─── NO ALERTS STATE ─── */
.no-alerts {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 0; font-size: 12px; color: var(--success);
}
.no-alerts svg { flex-shrink: 0; color: var(--success); }

.no-alerts-full {
  display: flex; flex-direction: column; align-items: center;
  padding: 60px 20px; gap: 14px; text-align: center;
  color: var(--text3);
}
.no-alerts-full svg { color: var(--success); opacity: 0.7; }
.no-alerts-title { font-size: 18px; font-weight: 600; color: var(--success); }
.no-alerts-sub { font-size: 13px; color: var(--text3); max-width: 380px; line-height: 1.6; }
.footer {
  text-align: center;
  padding: 16px 28px;
  font-size: 11px;
  color: var(--text3);
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.footer span { color: var(--accent); }

/* ─── LIVE DOT ─── */
.live-indicator {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text3);
}

/* ─── RANGE INPUT ─── */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%; height: 4px;
  border-radius: 2px;
  background: var(--bg4);
  outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 2px 6px rgba(79,139,255,0.3);
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%; border: none;
  background: var(--accent);
}

/* ─── TOOLTIP ─── */
.tippy-box[data-theme='weatherops'] {
  background: var(--tooltip-bg);
  border: 1px solid var(--tooltip-border);
  color: var(--text);
  font-family: var(--sans);
  font-size: 12px;
  border-radius: 8px;
}
