/* === UV Propagation Tool - Styles v2 === */
:root {
  --bg-primary: #071015;
  --bg-secondary: #0c181f;
  --bg-card: rgba(13,28,36,0.92);
  --bg-hover: #132936;
  --text-primary: #edf4f4;
  --text-secondary: #9badad;
  --text-muted: #687c7c;
  --accent-blue: #10b6d8;
  --accent-green: #22c55e;
  --accent-yellow: #f59e0b;
  --accent-red: #ef4444;
  --accent-purple: #7dd3fc;
  --accent-orange: #f97316;
  --border-color: rgba(255,255,255,0.08);
  --glass: rgba(10,22,28,0.82);
  --glass-border: rgba(180,225,225,0.12);
  --shadow: 0 12px 30px rgba(0,0,0,0.36);
  --radius: 8px;
  /* Theme-specific extras */
  --card-bg: rgba(0,0,0,0.25);
  --input-bg: rgba(0,0,0,0.3);
  --scrollbar-thumb: rgba(255,255,255,0.1);
  --hover-highlight: rgba(255,255,255,0.03);
  --stat-border: rgba(255,255,255,0.04);
  --panel-top-line: rgba(255,255,255,0.1);
  --body-gradient-1: rgba(16,182,216,0.07);
  --body-gradient-2: rgba(245,158,11,0.05);
  --body-gradient-3: rgba(34,197,94,0.035);
  --map-bg: #050b0e;
  --canvas-bg: #071015;
  --terrain-grad-top: rgba(139,90,43,0.8);
  --terrain-grad-bot: rgba(100,60,20,0.4);
  --terrain-stroke: #8b5a2b;
  --chart-text: #8899aa;
  --chart-tick: #556677;
  --chart-grid: rgba(255,255,255,0.05);
  --chart-grid-sub: rgba(255,255,255,0.04);
  --btn-ripple: rgba(255,255,255,0.1);
  --admin-row-hover: rgba(255,255,255,0.02);
  --admin-row-border: rgba(255,255,255,0.03);
}

/* === Light Theme === */
[data-theme="light"] {
  --bg-primary: #f0f4f8;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255,255,255,0.9);
  --bg-hover: #e2e8f0;
  --text-primary: #1a202c;
  --text-secondary: #4a5568;
  --text-muted: #a0aec0;
  --accent-blue: #0284c7;
  --accent-green: #16a34a;
  --accent-yellow: #d97706;
  --accent-red: #dc2626;
  --accent-purple: #9333ea;
  --accent-orange: #ea580c;
  --border-color: rgba(0,0,0,0.08);
  --glass: rgba(255,255,255,0.75);
  --glass-border: rgba(0,0,0,0.1);
  --shadow: 0 8px 32px rgba(0,0,0,0.08);
  --card-bg: rgba(0,0,0,0.04);
  --input-bg: rgba(0,0,0,0.05);
  --scrollbar-thumb: rgba(0,0,0,0.15);
  --hover-highlight: rgba(0,0,0,0.03);
  --stat-border: rgba(0,0,0,0.06);
  --panel-top-line: rgba(0,0,0,0.06);
  --body-gradient-1: rgba(14,165,233,0.05);
  --body-gradient-2: rgba(168,85,247,0.04);
  --body-gradient-3: rgba(34,197,94,0.03);
  --map-bg: #dce4ec;
  --canvas-bg: #f0f4f8;
  --terrain-grad-top: rgba(139,90,43,0.6);
  --terrain-grad-bot: rgba(100,60,20,0.25);
  --terrain-stroke: #a0714a;
  --chart-text: #4a5568;
  --chart-tick: #a0aec0;
  --chart-grid: rgba(0,0,0,0.06);
  --chart-grid-sub: rgba(0,0,0,0.04);
  --btn-ripple: rgba(0,0,0,0.08);
  --admin-row-hover: rgba(0,0,0,0.03);
  --admin-row-border: rgba(0,0,0,0.05);
}

/* Theme toggle button */
.theme-toggle {
  width: 36px;
  height: 36px;
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  background: var(--glass);
  backdrop-filter: blur(10px);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.3s;
  padding: 0;
  line-height: 1;
}

.theme-toggle:hover {
  color: var(--accent-yellow);
  border-color: var(--accent-yellow);
  box-shadow: 0 0 12px rgba(245,158,11,0.2);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  display: none;
}

[data-theme="light"] .theme-toggle .icon-sun { display: inline; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }
:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
:not([data-theme="light"]) .theme-toggle .icon-moon { display: inline; }
html:not([data-theme]) .theme-toggle .icon-moon { display: inline; }
html:not([data-theme]) .theme-toggle .icon-sun { display: none; }

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-primary);
  background-image:
    linear-gradient(135deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 16px),
    radial-gradient(ellipse at 18% 20%, var(--body-gradient-1) 0%, transparent 46%),
    radial-gradient(ellipse at 88% 10%, var(--body-gradient-2) 0%, transparent 42%),
    radial-gradient(ellipse at 55% 88%, var(--body-gradient-3) 0%, transparent 45%);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  transition: all 0.3s;
}

/* === Header === */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  height: 58px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(180,225,225,0.14);
  box-shadow: 0 1px 0 rgba(255,255,255,0.03), 0 12px 30px rgba(0,0,0,0.18);
  z-index: 100;
}

.header h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.subtitle {
  font-size: 11px;
  color: var(--accent-blue);
  margin-left: 10px;
  text-transform: uppercase;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.solar-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 5px 12px;
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  transition: all 0.3s;
}

.solar-indicator:hover { border-color: var(--accent-blue); }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.dot.green { background: var(--accent-green); box-shadow: 0 0 8px var(--accent-green); }
.dot.yellow { background: var(--accent-yellow); box-shadow: 0 0 8px var(--accent-yellow); }
.dot.red { background: var(--accent-red); box-shadow: 0 0 8px var(--accent-red); }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

.clock {
  font-size: 13px;
  font-family: 'Courier New', monospace;
  color: var(--text-secondary);
}

.btn-admin {
  padding: 5px 12px;
  font-size: 12px;
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
}

.btn-admin:hover {
  color: var(--accent-purple);
  border-color: var(--accent-purple);
  box-shadow: 0 0 12px rgba(168,85,247,0.2);
}

/* === Main Layout === */
.main-container {
  display: flex;
  height: calc(100vh - 58px);
}

/* === Sidebar === */
.sidebar {
  width: 430px;
  min-width: 430px;
  background: rgba(7,16,21,0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid rgba(180,225,225,0.13);
  box-shadow: 16px 0 40px rgba(0,0,0,0.22);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }

/* === Tabs === */
.tab-nav {
  display: flex;
  gap: 6px;
  background: var(--input-bg);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  padding: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
  flex: 0 0 auto;
  padding: 8px 10px;
  background: rgba(255,255,255,0.025);
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}

.tab-btn:hover { color: var(--text-primary); background: var(--hover-highlight); }
.tab-btn.active {
  color: var(--accent-blue);
  border-color: rgba(16,182,216,0.35);
  background: rgba(16,182,216,0.11);
}
.tab-btn.active::after { display: none; }

.tab-content { display: none; padding: 12px; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === Panels (Glassmorphism) === */
.panel {
  background: rgba(13,28,36,0.72);
  backdrop-filter: blur(8px);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--glass-border);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--panel-top-line), transparent);
}

.panel:hover {
  border-color: rgba(180,225,225,0.18);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

.panel h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

/* === Condition Cards === */
.condition-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.condition-card {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 12px 10px;
  text-align: center;
  border: 1px solid var(--glass-border);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.condition-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(14,165,233,0.05) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
}

.condition-card:hover {
  border-color: rgba(14,165,233,0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.condition-card:hover::after { opacity: 1; }

.condition-card.good-card { border-color: rgba(34,197,94,0.2); }
.condition-card.good-card .condition-icon { animation: breatheGreen 3s infinite; }
.condition-card.moderate-card { border-color: rgba(245,158,11,0.2); }
.condition-card.moderate-card .condition-icon { animation: breatheYellow 3s infinite; }

@keyframes breatheGreen {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(34,197,94,0.3)); }
  50% { filter: drop-shadow(0 0 12px rgba(34,197,94,0.6)); }
}

@keyframes breatheYellow {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(245,158,11,0.3)); }
  50% { filter: drop-shadow(0 0 12px rgba(245,158,11,0.6)); }
}

.condition-icon { font-size: 26px; margin-bottom: 6px; position: relative; z-index: 1; }
.condition-label { font-size: 11px; color: var(--text-secondary); margin-bottom: 4px; position: relative; z-index: 1; }
.condition-status { font-size: 12px; font-weight: 700; position: relative; z-index: 1; }
.condition-status.good { color: var(--accent-green); text-shadow: 0 0 8px rgba(34,197,94,0.3); }
.condition-status.moderate { color: var(--accent-yellow); text-shadow: 0 0 8px rgba(245,158,11,0.3); }
.condition-status.poor { color: var(--accent-red); }
.condition-status.unknown { color: var(--text-muted); }

.condition-desc {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.3;
  max-height: 2.6em;
  overflow: hidden;
}

/* === Layer Controls === */
.layer-toolbar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.layer-action {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: rgba(14,165,233,0.08);
  color: var(--text-secondary);
  padding: 6px 8px;
  font-size: 12px;
  cursor: pointer;
}

.layer-action:hover {
  color: var(--text-primary);
  border-color: var(--accent-blue);
}

.layer-controls { display: flex; flex-direction: column; gap: 6px; }

.layer-group-title {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.layer-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  cursor: pointer;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.layer-toggle:hover {
  color: var(--accent-blue);
  background: rgba(14,165,233,0.06);
}

.layer-toggle.active {
  border-color: rgba(14,165,233,0.28);
  background: rgba(14,165,233,0.09);
  color: var(--text-primary);
}

.layer-toggle input[type="checkbox"] {
  accent-color: var(--accent-blue);
  width: 16px;
  height: 16px;
}

.layer-toggle span:nth-child(2) { flex: 1; }

.layer-count {
  min-width: 28px;
  text-align: center;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  font-size: 11px;
}

.layer-count.ready {
  color: var(--accent-green);
  background: rgba(34,197,94,0.12);
}

.layer-count.empty {
  color: var(--accent-yellow);
  background: rgba(245,158,11,0.12);
}

.layer-status {
  margin-top: 10px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.4;
}

.condition-quality {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  min-height: 24px;
}

.quality-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  background: rgba(255,255,255,0.04);
}

.operator-summary {
  color: var(--text-muted);
  font-size: 12px;
}

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

.operator-summary-card {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px;
  background: var(--card-bg);
}

.operator-summary-card.live,
.operator-summary-card.cached,
.operator-summary-card.active {
  border-color: rgba(34,197,94,0.35);
}

.operator-summary-card.degraded,
.operator-summary-card.quiet {
  border-color: rgba(245,158,11,0.35);
}

.operator-summary-card.error,
.operator-summary-card.offline {
  border-color: rgba(239,68,68,0.35);
}

.summary-label {
  color: var(--text-muted);
  font-size: 11px;
}

.summary-value {
  color: var(--text-primary);
  font-weight: 700;
  margin-top: 4px;
}

.summary-note {
  margin-top: 4px;
  line-height: 1.4;
}

.summary-frequency-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.summary-frequency-list span {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(14,165,233,0.12);
  color: var(--accent-blue);
}

.leaflet-control-layers {
  background: rgba(7,17,31,0.92) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 12px !important;
  color: var(--text-primary) !important;
  box-shadow: 0 12px 30px rgba(0,0,0,0.35) !important;
}

.leaflet-control-layers-toggle {
  background-color: rgba(14,165,233,0.12) !important;
  border-radius: 10px;
}

.leaflet-control-layers-expanded {
  padding: 10px 12px !important;
}

.leaflet-control-layers label {
  color: var(--text-secondary);
  font-size: 12px;
  margin: 4px 0;
}

.leaflet-control-layers-separator {
  border-top-color: var(--border-color) !important;
}

/* === Band Filter === */
.band-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.band-btn {
  padding: 6px 10px;
  font-size: 11px;
  background: var(--input-bg);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
}

.band-btn:hover { border-color: var(--accent-blue); color: var(--text-primary); }
.band-btn.active {
  background: linear-gradient(135deg, rgba(14,165,233,0.3), rgba(14,165,233,0.1));
  color: var(--accent-blue);
  border-color: var(--accent-blue);
  box-shadow: 0 0 8px rgba(14,165,233,0.2);
}

/* === Form Elements === */
.form-group { margin-bottom: 12px; }

.form-group label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.coord-row { display: flex; gap: 8px; }

input, select, textarea {
  width: 100%;
  padding: 9px 10px;
  background: var(--input-bg);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  transition: all 0.3s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.1);
}

/* === Buttons === */
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  width: 100%;
  font-family: inherit;
  position: relative;
  overflow: hidden;
}

.predict-form > .btn {
  width: calc(50% - 5px);
  min-height: 38px;
  margin: 6px 4px 0 0 !important;
  vertical-align: top;
}

.predict-form > .btn-primary {
  width: 100%;
  margin-right: 0 !important;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: var(--btn-ripple);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s;
}

.btn:active::after { width: 300px; height: 300px; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), #0284c7);
  color: white;
  box-shadow: 0 2px 8px rgba(14,165,233,0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(14,165,233,0.4);
}

.btn-danger {
  background: linear-gradient(135deg, var(--accent-red), #dc2626);
  color: white;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 11px;
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* === Prediction Results === */
.predict-summary {
  background: linear-gradient(180deg, rgba(16,182,216,0.08), var(--card-bg));
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.6;
  border: 1px solid rgba(16,182,216,0.18);
}

.predict-modes { display: flex; flex-direction: column; gap: 8px; }

.mode-card {
  background: rgba(4,12,16,0.38);
  border-radius: 8px;
  padding: 12px;
  border-left: 3px solid var(--accent-blue);
  border-top: 1px solid rgba(255,255,255,0.04);
  border-right: 1px solid rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: all 0.3s;
}

.mode-card:hover {
  transform: translateY(-1px);
  background: var(--bg-hover);
}

.mode-card.tropo { border-left-color: var(--accent-green); }
.mode-card.es { border-left-color: var(--accent-yellow); }
.mode-card.meteor { border-left-color: var(--accent-orange); }
.mode-card.te { border-left-color: var(--accent-purple); }

.mode-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.mode-name { font-weight: 600; font-size: 14px; }

.mode-prob {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.prob-high { background: rgba(34,197,94,0.15); color: var(--accent-green); }
.prob-medium { background: rgba(245,158,11,0.15); color: var(--accent-yellow); }
.prob-low { background: rgba(239,68,68,0.15); color: var(--accent-red); }

.mode-detail {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* === Reports === */
.report-filter {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 5px 10px;
  font-size: 11px;
  background: var(--input-bg);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
}

.filter-btn:hover { border-color: var(--accent-blue); }
.filter-btn.active { background: rgba(14,165,233,0.2); color: var(--accent-blue); border-color: var(--accent-blue); }

.reports-list { max-height: 400px; overflow-y: auto; }

.report-item {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  border-left: 3px solid var(--accent-blue);
  cursor: pointer;
  transition: all 0.3s;
}

.report-item:hover { background: var(--bg-hover); transform: translateX(3px); box-shadow: 0 2px 12px rgba(0,0,0,0.2); }
.report-item.es { border-left-color: var(--accent-yellow); }
.report-item.tropo { border-left-color: var(--accent-green); }
.report-item.meteor { border-left-color: var(--accent-orange); }
.report-item.te { border-left-color: var(--accent-purple); }

.report-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.report-callsign { font-weight: 600; font-size: 14px; color: var(--accent-blue); }
.report-time { font-size: 11px; color: var(--text-muted); }

.report-details {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  gap: 10px;
  margin-bottom: 4px;
}

.report-text { font-size: 12px; color: var(--text-primary); line-height: 1.4; }

/* === Solar Data === */
.solar-data {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.solar-item {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  transition: all 0.3s;
}

.solar-item:hover { transform: translateY(-2px); }

.solar-value {
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.solar-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.kindex-chart {
  display: flex;
  gap: 4px;
  align-items: flex-end;
  height: 80px;
}

.kindex-bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  min-width: 20px;
  transition: height 0.5s;
}

.band-conditions { display: flex; flex-direction: column; gap: 6px; }

.band-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.band-name { width: 50px; font-size: 12px; font-weight: 600; }

.band-meter {
  flex: 1;
  height: 8px;
  background: var(--input-bg);
  border-radius: 4px;
  overflow: hidden;
}

.band-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease;
}

.band-label { font-size: 11px; width: 50px; text-align: right; }

/* === DX Stats === */
.dx-stats { font-size: 12px; line-height: 1.8; }

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  border-bottom: 1px solid var(--stat-border);
}

.stat-label { color: var(--text-secondary); }
.stat-value { font-weight: 600; }

/* === Tips === */
.tips { font-size: 12px; color: var(--text-secondary); line-height: 1.8; }
.tips p { margin-bottom: 4px; }

/* === Map === */
.map-container { flex: 1; position: relative; }

#map {
  width: 100%;
  height: 100%;
  background: var(--map-bg);
}

.map-overlay-info {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(7,16,21,0.86);
  backdrop-filter: blur(12px);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 11px;
  font-family: 'Courier New', monospace;
  color: var(--text-secondary);
  z-index: 1000;
  display: flex;
  gap: 15px;
  border: 1px solid var(--glass-border);
}

/* Map Legend */
.map-legend {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(7,16,21,0.86);
  backdrop-filter: blur(12px);
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 11px;
  z-index: 1000;
  border: 1px solid var(--glass-border);
}

.legend-item { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.legend-item:last-child { margin-bottom: 0; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }

/* === Charts === */
.hour-chart, .month-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 60px;
  padding: 4px 0;
}

.hour-bar, .month-bar {
  flex: 1;
  border-radius: 2px 2px 0 0;
  min-width: 8px;
  transition: height 0.5s;
  position: relative;
  cursor: pointer;
}

.hour-bar:hover, .month-bar:hover {
  opacity: 0.8;
}

.hour-bar::after, .month-bar::after {
  content: attr(data-label);
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* === Modal === */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal.active { display: flex; animation: fadeIn 0.2s ease; }

.modal-content {
  background: var(--bg-secondary);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 24px;
  max-width: 600px;
  width: 92%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.modal-close {
  position: absolute;
  top: 12px; right: 16px;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s;
}

.modal-close:hover { color: var(--text-primary); }

/* === Custom Map Markers === */
.custom-marker { background: none; border: none; }

.spot-marker {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.8);
  box-shadow: 0 0 8px currentColor;
  animation: spotPulse 2s infinite;
}

@keyframes spotPulse {
  0%, 100% { box-shadow: 0 0 6px currentColor; transform: scale(1); }
  50% { box-shadow: 0 0 14px currentColor; transform: scale(1.15); }
}

.es-cloud-circle {
  fill: rgba(168, 85, 247, 0.12);
  stroke: var(--accent-purple);
  stroke-width: 2;
  stroke-dasharray: 8 4;
  animation: esPulse 3s infinite;
}

@keyframes esPulse {
  0%, 100% { stroke-opacity: 0.6; }
  50% { stroke-opacity: 1; }
}

.report-marker-icon {
  background: var(--bg-card);
  border: 2px solid var(--accent-green);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Path flow animation */
.path-animated {
  animation: pathFlow 1.5s linear infinite;
}

@keyframes pathFlow {
  0% { stroke-dashoffset: 20; }
  100% { stroke-dashoffset: 0; }
}

/* === Leaflet popup === */
.leaflet-popup-content-wrapper {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border-radius: 10px !important;
  border: 1px solid var(--glass-border) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4) !important;
}

.leaflet-popup-tip { background: var(--bg-secondary) !important; }

.leaflet-popup-content {
  margin: 12px 16px !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
}

.popup-title { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.popup-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.popup-label { color: var(--text-secondary); }
.popup-value { font-weight: 500; }

/* === Report Form === */
.report-form { display: flex; flex-direction: column; gap: 8px; }

/* === Admin Panel === */
.admin-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 3000;
  align-items: center;
  justify-content: center;
}

.admin-overlay.active { display: flex; animation: fadeIn 0.3s ease; }

.admin-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  width: 90%;
  max-width: 900px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--glass-border);
  background: var(--card-bg);
}

.admin-header h2 {
  font-size: 16px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.admin-close {
  font-size: 22px;
  cursor: pointer;
  color: var(--text-muted);
  background: none;
  border: none;
  transition: color 0.2s;
}

.admin-close:hover { color: var(--text-primary); }

.admin-tabs {
  display: flex;
  border-bottom: 1px solid var(--glass-border);
  background: var(--hover-highlight);
}

.admin-tab-btn {
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 500;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  font-family: inherit;
}

.admin-tab-btn:hover { color: var(--text-primary); }
.admin-tab-btn.active { color: var(--accent-purple); border-bottom-color: var(--accent-purple); }

.admin-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.admin-tab { display: none; }
.admin-tab.active { display: block; animation: fadeIn 0.2s ease; }

/* Admin Table */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.admin-table th {
  text-align: left;
  padding: 8px 10px;
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--glass-border);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--admin-row-border);
  vertical-align: middle;
}

.admin-table tr:hover td { background: var(--admin-row-hover); }

.admin-table .actions { display: flex; gap: 6px; }

.admin-search {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.admin-search input {
  flex: 1;
  padding: 8px 12px;
  background: var(--input-bg);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13px;
}

.admin-search input:focus {
  outline: none;
  border-color: var(--accent-purple);
}

/* Status badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
}

.badge-green { background: rgba(34,197,94,0.15); color: var(--accent-green); }
.badge-yellow { background: rgba(245,158,11,0.15); color: var(--accent-yellow); }
.badge-red { background: rgba(239,68,68,0.15); color: var(--accent-red); }
.badge-blue { background: rgba(14,165,233,0.15); color: var(--accent-blue); }

/* Admin form */
.admin-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.admin-form .full-width { grid-column: 1 / -1; }

.admin-form label {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 3px;
}

.admin-form input, .admin-form select, .admin-form textarea {
  width: 100%;
  padding: 7px 10px;
  background: var(--input-bg);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 12px;
}

/* Status cards */
.status-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.status-card {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  border: 1px solid var(--glass-border);
}

.status-card .value {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 2px;
}

.status-card .label {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Login prompt */
.admin-login {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  gap: 12px;
}

.admin-login input {
  width: 250px;
  padding: 10px 14px;
  background: var(--input-bg);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  text-align: center;
}

.admin-login .btn { width: 250px; }

/* === Skeleton Loading === */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* === Responsive === */
@media (max-width: 768px) {
  .header { padding: 0 12px; height: 48px; }
  .header h1 { font-size: 14px; }
  .subtitle { display: none; }
  .solar-indicator span:last-child { display: none; }
  .btn-admin { padding: 4px 8px; font-size: 11px; }

  .main-container { flex-direction: column; }
  .sidebar {
    width: 100%; min-width: 100%;
    height: 45vh;
    order: 2;
    border-right: none;
    border-top: 1px solid var(--glass-border);
  }
  .map-container { order: 1; height: 55vh; }

  .tab-btn { padding: 10px 4px; font-size: 11px; }
  .condition-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .condition-icon { font-size: 20px; }
  .condition-label { font-size: 10px; }
  .condition-status { font-size: 11px; }
  .condition-desc { display: none; }

  .panel { padding: 10px; margin-bottom: 8px; }
  .panel h3 { font-size: 13px; }

  .band-filter { gap: 4px; }
  .band-btn { padding: 6px 8px; font-size: 10px; min-height: 32px; }

  .admin-panel { width: 98%; max-height: 92vh; border-radius: 12px; }
  .admin-form { grid-template-columns: 1fr; }
  .status-grid { grid-template-columns: 1fr 1fr; }

  .map-legend { font-size: 10px; padding: 8px 10px; }
  .map-overlay-info { font-size: 10px; padding: 5px 8px; }
}

@media (max-width: 480px) {
  .header h1 { font-size: 13px; }
  .header-right { gap: 6px; }
  .clock { font-size: 11px; }
  .condition-grid { gap: 4px; }
  .solar-data { gap: 4px; }
  .solar-value { font-size: 18px; }
  .tab-btn { font-size: 10px; padding: 8px 2px; }
  .predict-form .band-filter { flex-wrap: wrap; }
}

/* === Gauge Dashboard === */
.gauge-dashboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.gauge-item {
  text-align: center;
}

.gauge-svg {
  width: 100%;
  max-width: 100px;
  height: auto;
}

.gauge-bg {
  fill: none;
  stroke: var(--chart-grid);
  stroke-width: 8;
}

.gauge-fill {
  fill: none;
  stroke: #556677;
  stroke-width: 8;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: stroke-dashoffset 0.8s ease, stroke 0.5s ease;
}

.gauge-value {
  fill: var(--text-primary);
  font-size: 18px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
}

.gauge-label {
  fill: var(--text-secondary);
  font-size: 11px;
  font-family: 'Inter', sans-serif;
}

/* === Terrain Canvas === */
#terrainCanvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 8px;
  background: var(--canvas-bg);
  border: 1px solid var(--glass-border);
}

@media (max-width: 480px) {
  .gauge-dashboard { grid-template-columns: repeat(2, 1fr); }
  .gauge-svg { max-width: 80px; }
  .gauge-value { font-size: 15px; }
}

@media (min-width: 1400px) {
  .sidebar { width: 460px; min-width: 460px; }
}

/* === Data Health Panel === */
.data-health {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.health-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--card-bg);
  font-size: 0.75rem;
}
.health-link {
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.health-link:hover {
  background: rgba(14, 165, 233, 0.14);
  transform: translateY(-1px);
}
.health-item.online { border-left: 2px solid var(--accent-green); }
.health-item.offline { border-left: 2px solid var(--accent-red); }
.health-item.cached { border-left: 2px solid var(--accent-yellow); }
.health-dot {
  width: 6px; height: 6px; border-radius: 50%;
}
.health-dot.green { background: var(--accent-green); }
.health-dot.yellow { background: var(--accent-yellow); }
.health-dot.red { background: var(--accent-red); }
.health-name { color: var(--text-primary); }
.health-latency { color: var(--text-muted); font-size: 0.7rem; }
.health-external { color: var(--text-muted); font-size: 0.65rem; opacity: 0.75; }
.health-loading { color: var(--text-muted); font-size: 0.8rem; }

/* === Link Budget Section === */
.link-budget-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}
.link-budget-section h4 {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 8px;
}

/* === Responsive === */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48vh;
    z-index: 1000;
    border-radius: 10px 10px 0 0;
    overflow-y: auto;
    transform: none;
    transition: transform 0.3s ease;
  }
  .sidebar.open {
    transform: translateY(0);
  }
  .main-container {
    flex-direction: column;
  }
  .map-container {
    height: 52vh;
  }
  .header {
    padding: 6px 10px;
    flex-wrap: nowrap;
  }
  .header-left h1 { font-size: 0.9rem; }
  .subtitle { display: none; }
  .tab-nav {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .tab-btn {
    min-height: 44px;
    padding: 8px 12px;
  }
  .predict-form > .btn {
    width: 100%;
    margin-right: 0 !important;
  }
  .condition-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* === Toast Animation === */
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* === Prediction Enhancements === */
.mode-card.es_multi { border-left: 3px solid #eab308; }
.mode-card.aurora { border-left: 3px solid #06b6d4; }

/* === Keyboard Shortcut Hints === */
.shortcut-hint {
  display: inline-block;
  padding: 2px 6px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 10px;
  color: var(--text-muted);
  font-family: monospace;
}

/* === Coverage Layer === */
.coverage-popup .popup-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}
