@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=Instrument+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

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

:root {
  --bg-primary: #141418;
  --bg-secondary: #1C1C20;
  --bg-card: #28282E;
  --bg-hover: #31313A;
  --border: #3A3A42;
  --text-primary: #E4E4E7;
  --text-secondary: #A1A1AA;
  --text-muted: #6B6B76;
  --accent: #D4874D;
  --accent-glow: rgba(212, 135, 77, 0.25);
  --green: #38A169;
  --green-glow: rgba(56, 161, 105, 0.35);
  --orange: #FBBF24;
  --red: #F87171;
  --purple: #A78BFA;
  --cyan: #60A5FA;
  --copper: #C47B3A;
  --copper-bright: #D4874D;
  --sidebar-width: 240px;
  --panel-width: 300px;
  --topbar-height: 52px;
  --ticker-height: 36px;
}

html, body {
  height: 100%;
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ========== TOP BAR ========== */
.top-bar {
  height: var(--topbar-height);
  background: linear-gradient(180deg, var(--bg-secondary), rgba(28, 28, 32, 0.95));
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 20px;
  z-index: 100;
  position: relative;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--copper), var(--copper-bright));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(196, 123, 58, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: transform 0.2s, box-shadow 0.2s;
}

.brand:hover .brand-icon {
  transform: scale(1.05);
  box-shadow: 0 2px 12px rgba(196, 123, 58, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-name {
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 3px;
  line-height: 1;
  background: linear-gradient(135deg, var(--copper-bright), var(--green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tag {
  font-family: 'DM Sans', sans-serif;
  font-size: 8.5px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.8px;
  line-height: 1;
  text-transform: uppercase;
}

.top-nav {
  display: flex;
  gap: 4px;
}

.nav-link {
  padding: 5px 12px;
  border-radius: 6px;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
}

.nav-link:hover { color: var(--text-primary); background: var(--bg-hover); }
.nav-link.active {
  color: var(--copper-bright);
  background: rgba(212, 135, 77, 0.08);
  box-shadow: inset 0 -2px 0 var(--copper-bright);
}

.top-stats {
  display: flex;
  gap: 16px;
  margin-left: auto;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  background: rgba(40, 40, 46, 0.6);
  border: 1px solid rgba(58, 58, 66, 0.5);
  border-radius: 16px;
  font-size: 12px;
  white-space: nowrap;
  backdrop-filter: blur(6px);
  transition: border-color 0.2s, background 0.2s;
}

.stat-pill:hover {
  border-color: rgba(58, 58, 66, 0.8);
  background: rgba(40, 40, 46, 0.8);
}

.stat-pill .stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-primary);
}

.stat-pill .stat-label {
  font-family: 'DM Sans', sans-serif;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
}

.stat-pill.live-pulse .dot {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
  box-shadow: 0 0 6px var(--green-glow);
}

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

/* ========== MAIN LAYOUT ========== */
.main-layout {
  display: flex;
  height: calc(100vh - var(--topbar-height) - var(--ticker-height));
}

/* ========== SIDEBARS ========== */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--bg-secondary), rgba(20, 20, 24, 0.98));
  border-right: 1px solid rgba(58, 58, 66, 0.4);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
}

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

.sidebar-section {
  padding: 14px 14px 0;
}

.sidebar-section + .sidebar-section {
  border-top: 1px solid var(--border);
  margin-top: 14px;
  padding-top: 14px;
}

.section-label {
  display: block;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--text-muted);
  margin-bottom: 8px;
  opacity: 0.7;
}

.search-input {
  width: 100%;
  padding: 7px 10px;
  background: rgba(40, 40, 46, 0.5);
  border: 1px solid rgba(58, 58, 66, 0.5);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: all 0.25s ease;
}

.search-input::placeholder { color: var(--text-muted); font-size: 11px; }
.search-input:focus {
  border-color: var(--accent);
  background: rgba(40, 40, 46, 0.8);
  box-shadow: 0 0 0 3px rgba(212, 135, 77, 0.08);
}

.btn-group {
  display: flex;
  gap: 4px;
}

.btn-toggle {
  flex: 1;
  padding: 5px 0;
  background: rgba(40, 40, 46, 0.4);
  border: 1px solid rgba(58, 58, 66, 0.4);
  border-radius: 5px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-toggle:hover { background: var(--bg-hover); color: var(--text-secondary); }
.btn-toggle.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 1px 6px rgba(212, 135, 77, 0.25);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--text-secondary);
}

.toggle-switch {
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.5px;
  border: 1px solid rgba(58, 58, 66, 0.5);
  background: rgba(40, 40, 46, 0.4);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'JetBrains Mono', monospace;
}

.toggle-switch:hover { background: var(--bg-hover); }

.toggle-switch.active {
  background: rgba(56, 161, 105, 0.12);
  border-color: rgba(56, 161, 105, 0.4);
  color: var(--green);
  box-shadow: 0 0 6px rgba(56, 161, 105, 0.1);
}

.platform-filters {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.platform-btn {
  padding: 5px 9px;
  background: rgba(40, 40, 46, 0.3);
  border: 1px solid rgba(58, 58, 66, 0.3);
  border-radius: 5px;
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.platform-btn:hover { background: var(--bg-hover); color: var(--text-secondary); }
.platform-btn.active {
  background: rgba(212, 135, 77, 0.08);
  border-color: rgba(212, 135, 77, 0.3);
  color: var(--accent);
}

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

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-dot.high { background: var(--green); box-shadow: 0 0 6px var(--green-glow); }
.legend-dot.med { background: var(--orange); }
.legend-dot.low { background: var(--red); opacity: 0.6; }

.legend-range {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer-brand {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: var(--copper);
  opacity: 0.7;
}

.footer-tagline {
  font-family: 'DM Sans', sans-serif;
  font-size: 9px;
  color: var(--text-muted);
  font-style: italic;
  opacity: 0.5;
}

/* ========== GLOBE ========== */
.globe-wrap {
  flex: 1;
  position: relative;
  background: var(--bg-primary);
  overflow: hidden;
}

.globe-container {
  width: 100%;
  height: 100%;
}

/* FX overlay canvas for particles */
.fx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
}

/* Scanlines overlay (cyberpunk only) */
.scanlines {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background: none;
}

.scanlines.active {
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, 0.12) 2px,
      rgba(0, 0, 0, 0.12) 4px
    );
  mix-blend-mode: multiply;
  animation: scanFlicker 0.1s infinite;
}

@keyframes scanFlicker {
  0% { opacity: 0.85; }
  50% { opacity: 1; }
  100% { opacity: 0.9; }
}

/* Cyberpunk: intense glow border on globe wrap */
[data-theme="cyberpunk"] .globe-wrap {
  box-shadow: inset 0 0 80px rgba(255, 0, 255, 0.12),
              inset 0 0 160px rgba(0, 255, 255, 0.06),
              inset 0 0 250px rgba(255, 0, 255, 0.04);
}

/* Cyberpunk: glitch flicker on brand — more aggressive */
[data-theme="cyberpunk"] .brand-name {
  animation: glitch 2.5s infinite;
}

@keyframes glitch {
  0%, 88%, 100% { opacity: 1; transform: none; text-shadow: none; }
  89% { opacity: 0.7; transform: translateX(-3px) skewX(-2deg); text-shadow: 2px 0 #ff00ff, -2px 0 #00ffff; }
  90% { opacity: 1; transform: translateX(3px) skewX(2deg); text-shadow: -2px 0 #ff00ff, 2px 0 #00ffff; }
  91% { opacity: 0.85; transform: translateX(-1px); text-shadow: 1px 0 #00ffcc; }
  92% { opacity: 1; transform: none; text-shadow: none; }
  95% { opacity: 0.9; transform: translateX(1px) skewX(-0.5deg); text-shadow: -1px 0 #ff00ff; }
  96% { opacity: 1; transform: none; }
}

/* Cyberpunk: neon border glow on stat pills */
[data-theme="cyberpunk"] .stat-pill {
  box-shadow: 0 0 8px rgba(255, 0, 255, 0.1), inset 0 0 4px rgba(0, 255, 204, 0.05);
}

/* Cyberpunk: neon glow on active toggle */
[data-theme="cyberpunk"] .toggle-switch.active {
  text-shadow: 0 0 6px rgba(0, 255, 204, 0.6);
}

/* Fire: intense warm vignette */
[data-theme="fire"] .globe-wrap {
  box-shadow: inset 0 0 100px rgba(255, 69, 0, 0.2),
              inset 0 0 250px rgba(255, 34, 0, 0.12),
              inset 0 0 400px rgba(200, 0, 0, 0.06);
}

/* Fire: flickering glow on brand — more intense */
[data-theme="fire"] .brand-name {
  animation: fireFlicker 1.5s ease-in-out infinite;
}

@keyframes fireFlicker {
  0%, 100% { filter: brightness(1); text-shadow: 0 0 10px rgba(255, 69, 0, 0.3); }
  15% { filter: brightness(1.3); text-shadow: 0 0 20px rgba(255, 69, 0, 0.6); }
  30% { filter: brightness(0.85); text-shadow: 0 0 8px rgba(255, 69, 0, 0.2); }
  50% { filter: brightness(1.4); text-shadow: 0 0 25px rgba(255, 140, 0, 0.7); }
  70% { filter: brightness(0.9); text-shadow: 0 0 12px rgba(255, 69, 0, 0.3); }
  85% { filter: brightness(1.2); text-shadow: 0 0 18px rgba(255, 100, 0, 0.5); }
}

/* Fire: pulsing glow on live dot */
[data-theme="fire"] .stat-pill.live-pulse .dot {
  animation: fireDotPulse 0.8s ease-in-out infinite;
}

@keyframes fireDotPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 6px rgba(255, 69, 0, 0.6); }
  50% { transform: scale(1.4); box-shadow: 0 0 16px rgba(255, 69, 0, 1), 0 0 30px rgba(255, 140, 0, 0.4); }
}

/* Fire: warm glow on stat pills */
[data-theme="fire"] .stat-pill {
  box-shadow: 0 0 8px rgba(255, 69, 0, 0.08);
}

/* Fire: ember border effect on sidebar sections */
[data-theme="fire"] .sidebar-section + .sidebar-section {
  border-top-color: rgba(255, 69, 0, 0.3);
}

/* Ice: deep frost vignette */
[data-theme="ice"] .globe-wrap {
  box-shadow: inset 0 0 100px rgba(160, 232, 255, 0.12),
              inset 0 0 250px rgba(77, 201, 246, 0.06),
              inset 0 0 400px rgba(30, 58, 95, 0.08);
}

/* Ice: gentle shimmer on brand — with frost glow */
[data-theme="ice"] .brand-name {
  animation: iceShimmer 4s ease-in-out infinite;
}

@keyframes iceShimmer {
  0%, 100% { filter: brightness(1); text-shadow: 0 0 8px rgba(160, 232, 255, 0.2); }
  25% { filter: brightness(1.1); text-shadow: 0 0 12px rgba(160, 232, 255, 0.4); }
  50% { filter: brightness(1.2) drop-shadow(0 0 6px rgba(160, 232, 255, 0.5)); text-shadow: 0 0 20px rgba(200, 240, 255, 0.5); }
  75% { filter: brightness(1.05); text-shadow: 0 0 10px rgba(160, 232, 255, 0.3); }
}

/* Ice: frost glow on stat pills */
[data-theme="ice"] .stat-pill {
  box-shadow: 0 0 6px rgba(160, 232, 255, 0.06);
}

/* Ice: crystalline border effect */
[data-theme="ice"] .sidebar-section + .sidebar-section {
  border-top-color: rgba(77, 201, 246, 0.2);
}

/* Ice: slow breathing pulse on live dot */
[data-theme="ice"] .stat-pill.live-pulse .dot {
  animation: iceDotPulse 3s ease-in-out infinite;
}

@keyframes iceDotPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 6px rgba(160, 232, 255, 0.4); }
  50% { transform: scale(1.15); box-shadow: 0 0 12px rgba(160, 232, 255, 0.8), 0 0 24px rgba(200, 240, 255, 0.3); }
}

.globe-container canvas {
  width: 100% !important;
  height: 100% !important;
}

.globe-overlay {
  position: absolute;
  z-index: 10;
  pointer-events: none;
}

.globe-overlay.top-left {
  top: 16px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.overlay-label {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-muted);
  opacity: 0.6;
}

.overlay-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -1px;
  background: linear-gradient(135deg, var(--copper-bright), var(--green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(196, 123, 58, 0.2));
}

.globe-overlay.bottom-right {
  bottom: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: all;
}

.zoom-btn {
  width: 30px;
  height: 30px;
  background: rgba(40, 40, 46, 0.6);
  border: 1px solid rgba(58, 58, 66, 0.4);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-family: 'JetBrains Mono', monospace;
  backdrop-filter: blur(8px);
}

.zoom-btn:hover {
  background: rgba(40, 40, 46, 0.9);
  border-color: var(--accent);
  color: var(--text-primary);
  transform: scale(1.05);
}

/* ========== RIGHT PANEL ========== */
.right-panel {
  width: var(--panel-width);
  border-right: none;
  border-left: 1px solid rgba(58, 58, 66, 0.4);
  background: linear-gradient(180deg, var(--bg-secondary), rgba(20, 20, 24, 0.98));
}

.panel-tabs {
  display: flex;
  padding: 0 12px;
  gap: 0;
  border-bottom: 1px solid rgba(58, 58, 66, 0.4);
}

.panel-tab {
  flex: 1;
  padding: 10px 0 8px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.panel-tab:hover { color: var(--text-secondary); }
.panel-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px;
}

.panel-section { display: block; }
.panel-section.hidden { display: none; }

/* Recent view items */
.view-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  transition: all 0.15s ease;
  margin-bottom: 1px;
  border: 1px solid transparent;
}

.view-item:hover {
  background: rgba(49, 49, 58, 0.5);
  border-color: rgba(58, 58, 66, 0.3);
  transform: translateX(2px);
}

.view-flag {
  font-size: 18px;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

.view-info {
  flex: 1;
  min-width: 0;
}

.view-country {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.view-detail {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.3;
}

.view-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.view-platform {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8.5px;
  font-weight: 500;
  padding: 2px 5px;
  border-radius: 3px;
  letter-spacing: 0.3px;
  flex-shrink: 0;
  text-transform: lowercase;
}

.view-platform.linkedin { background: rgba(0, 119, 181, 0.15); color: #0077b5; }
.view-platform.github { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.view-platform.portfolio { background: rgba(6, 182, 212, 0.15); color: #06b6d4; }
.view-platform.twitter { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }

/* Country ranking items */
.country-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 2px;
}

.country-item:hover { background: var(--bg-hover); }

.country-rank {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  width: 20px;
  text-align: right;
}

.country-rank.gold { color: #fbbf24; }
.country-rank.silver { color: #94a3b8; }
.country-rank.bronze { color: #d97706; }

.country-bar-wrap {
  flex: 1;
  min-width: 0;
}

.country-name-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.country-name {
  font-size: 13px;
  font-weight: 500;
}

.country-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-secondary);
}

.country-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--bg-hover);
  overflow: hidden;
}

.country-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--copper), var(--green));
  transition: width 0.6s ease;
}

/* Referral items */
.referral-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.referral-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.referral-icon.linkedin { background: rgba(0, 119, 181, 0.15); }
.referral-icon.github { background: rgba(139, 92, 246, 0.15); }
.referral-icon.portfolio { background: rgba(6, 182, 212, 0.15); }
.referral-icon.twitter { background: rgba(148, 163, 184, 0.15); }
.referral-icon.direct { background: rgba(34, 197, 94, 0.15); }

.referral-info { flex: 1; }

.referral-name {
  font-size: 13px;
  font-weight: 500;
}

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

.referral-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.referral-pct {
  font-size: 11px;
  color: var(--green);
}

/* Mini chart */
.mini-chart-section {
  padding: 14px;
  border-top: 1px solid var(--border);
}

#miniChart {
  width: 100%;
  height: 80px;
  border-radius: 6px;
}

/* Peak hours */
.peak-section {
  padding: 14px;
  border-top: 1px solid var(--border);
}

.peak-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 3px;
}

.peak-cell {
  aspect-ratio: 1;
  border-radius: 3px;
  position: relative;
}

.peak-cell::after {
  content: attr(data-hour);
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.peak-cell.l0 { background: rgba(40, 40, 46, 0.4); }
.peak-cell.l1 { background: rgba(196, 123, 58, 0.12); }
.peak-cell.l2 { background: rgba(196, 123, 58, 0.25); }
.peak-cell.l3 { background: rgba(196, 123, 58, 0.4); }
.peak-cell.l4 { background: rgba(196, 123, 58, 0.6); }
.peak-cell.l5 { background: var(--copper-bright); box-shadow: 0 0 4px rgba(196, 123, 58, 0.3); }

/* ========== TICKER ========== */
.ticker-bar {
  height: var(--ticker-height);
  background: linear-gradient(180deg, rgba(28, 28, 32, 0.95), var(--bg-secondary));
  border-top: 1px solid rgba(58, 58, 66, 0.4);
  display: flex;
  align-items: center;
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.ticker-label {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--green);
  flex-shrink: 0;
  border-right: 1px solid rgba(58, 58, 66, 0.4);
  height: 100%;
}

.ticker-label .dot {
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

.ticker-track {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.ticker-content {
  display: flex;
  gap: 40px;
  white-space: nowrap;
  animation: scroll-ticker 60s linear infinite;
  padding-left: 100%;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.ticker-item .ticker-flag { font-size: 12px; }

.ticker-item .ticker-pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  color: var(--green);
}

.ticker-item .ticker-pct.negative { color: var(--red); }

@keyframes scroll-ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ========== ANIMATIONS ========== */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: translateX(0); }
}

.view-item { animation: fadeSlideIn 0.25s ease-out; }

/* ========== THEME SELECTOR ========== */
.theme-selector {
  flex-shrink: 0;
}

.theme-dropdown {
  padding: 4px 8px;
  background: rgba(40, 40, 46, 0.5);
  border: 1px solid rgba(58, 58, 66, 0.4);
  border-radius: 5px;
  color: var(--text-secondary);
  font-size: 10.5px;
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%236B6B76'%3E%3Cpath d='M2 3l3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
}

.theme-dropdown:hover { border-color: var(--accent); }
.theme-dropdown:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }
.theme-dropdown option { background: var(--bg-secondary); color: var(--text-primary); }

/* ========== THEME TRANSITION ========== */
body, .top-bar, .sidebar, .ticker-bar, .stat-pill, .search-input,
.btn-toggle, .toggle-switch, .platform-btn, .zoom-btn, .panel-tab,
.referral-item, .brand-name, .overlay-value, .country-bar-fill,
.globe-wrap, .theme-dropdown {
  transition: background 0.5s ease, color 0.5s ease, border-color 0.5s ease,
    box-shadow 0.5s ease, background-image 0.5s ease;
}

/* ═══════════════════════════════════════
   CYBERPUNK THEME
   ═══════════════════════════════════════ */
[data-theme="cyberpunk"] {
  --bg-primary: #0d0221;
  --bg-secondary: #150535;
  --bg-card: #1a0a3e;
  --bg-hover: #2d1266;
  --border: #3d1a8f;
  --text-primary: #e0d4ff;
  --text-secondary: #b49ce8;
  --text-muted: #7c5cbf;
  --accent: #ff00ff;
  --accent-glow: rgba(255, 0, 255, 0.3);
  --green: #00ffcc;
  --green-glow: rgba(0, 255, 204, 0.4);
  --orange: #ff6600;
  --red: #ff0066;
  --purple: #bf00ff;
  --cyan: #00ffff;
}

[data-theme="cyberpunk"] .brand-name {
  background: linear-gradient(135deg, #ff00ff, #00ffff);
  -webkit-background-clip: text;
  text-shadow: 0 0 20px rgba(255, 0, 255, 0.5);
}

[data-theme="cyberpunk"] .overlay-value {
  background: linear-gradient(135deg, #ff00ff, #00ffff);
  -webkit-background-clip: text;
}

[data-theme="cyberpunk"] .nav-link.active {
  color: #ff00ff;
  background: rgba(255, 0, 255, 0.1);
  box-shadow: 0 0 8px rgba(255, 0, 255, 0.2);
}

[data-theme="cyberpunk"] .btn-toggle.active {
  background: #ff00ff;
  border-color: #ff00ff;
  box-shadow: 0 0 10px rgba(255, 0, 255, 0.4);
}

[data-theme="cyberpunk"] .toggle-switch.active {
  background: rgba(0, 255, 204, 0.15);
  border-color: #00ffcc;
  color: #00ffcc;
  box-shadow: 0 0 6px rgba(0, 255, 204, 0.3);
}

[data-theme="cyberpunk"] .platform-btn.active {
  background: rgba(255, 0, 255, 0.1);
  border-color: #ff00ff;
  color: #ff00ff;
}

[data-theme="cyberpunk"] .panel-tab.active {
  color: #ff00ff;
  border-bottom-color: #ff00ff;
}

[data-theme="cyberpunk"] .stat-pill.live-pulse .dot {
  background: #00ffcc;
  box-shadow: 0 0 8px rgba(0, 255, 204, 0.6);
}

[data-theme="cyberpunk"] .ticker-label {
  color: #00ffcc;
  text-shadow: 0 0 8px rgba(0, 255, 204, 0.5);
}

[data-theme="cyberpunk"] .ticker-label .dot {
  background: #00ffcc;
  box-shadow: 0 0 8px rgba(0, 255, 204, 0.6);
}

[data-theme="cyberpunk"] .ticker-item .ticker-pct { color: #00ffcc; }

[data-theme="cyberpunk"] .legend-dot.high { background: #00ffcc; box-shadow: 0 0 8px rgba(0, 255, 204, 0.5); }
[data-theme="cyberpunk"] .legend-dot.med { background: #ff00ff; box-shadow: 0 0 6px rgba(255, 0, 255, 0.4); }
[data-theme="cyberpunk"] .legend-dot.low { background: #ff0066; opacity: 0.8; }

[data-theme="cyberpunk"] .country-bar-fill {
  background: linear-gradient(90deg, #ff00ff, #00ffff);
}

[data-theme="cyberpunk"] .referral-count { color: #ff00ff; }
[data-theme="cyberpunk"] .referral-pct { color: #00ffcc; }

[data-theme="cyberpunk"] .view-platform.linkedin { background: rgba(255, 0, 255, 0.15); color: #ff66ff; }
[data-theme="cyberpunk"] .view-platform.github { background: rgba(0, 255, 255, 0.15); color: #00ffff; }
[data-theme="cyberpunk"] .view-platform.portfolio { background: rgba(0, 255, 204, 0.15); color: #00ffcc; }
[data-theme="cyberpunk"] .view-platform.twitter { background: rgba(191, 0, 255, 0.15); color: #bf00ff; }

[data-theme="cyberpunk"] .peak-cell.l1 { background: rgba(255, 0, 255, 0.15); }
[data-theme="cyberpunk"] .peak-cell.l2 { background: rgba(255, 0, 255, 0.3); }
[data-theme="cyberpunk"] .peak-cell.l3 { background: rgba(255, 0, 255, 0.5); }
[data-theme="cyberpunk"] .peak-cell.l4 { background: rgba(255, 0, 255, 0.7); }
[data-theme="cyberpunk"] .peak-cell.l5 { background: #ff00ff; box-shadow: 0 0 6px rgba(255, 0, 255, 0.5); }

[data-theme="cyberpunk"] .top-bar {
  border-bottom: 1px solid #3d1a8f;
  box-shadow: 0 2px 20px rgba(255, 0, 255, 0.1);
}

[data-theme="cyberpunk"] .ticker-bar {
  border-top: 1px solid #3d1a8f;
  box-shadow: 0 -2px 20px rgba(255, 0, 255, 0.1);
}

[data-theme="cyberpunk"] .search-input:focus {
  border-color: #ff00ff;
  box-shadow: 0 0 8px rgba(255, 0, 255, 0.3);
}

[data-theme="cyberpunk"] .zoom-btn:hover {
  border-color: #ff00ff;
  box-shadow: 0 0 8px rgba(255, 0, 255, 0.3);
}

[data-theme="cyberpunk"] .theme-dropdown:focus {
  border-color: #ff00ff;
  box-shadow: 0 0 0 2px rgba(255, 0, 255, 0.3);
}

/* ═══════════════════════════════════════
   WORLD ON FIRE THEME
   ═══════════════════════════════════════ */
[data-theme="fire"] {
  --bg-primary: #1a0a00;
  --bg-secondary: #2a1000;
  --bg-card: #3d1800;
  --bg-hover: #4d2200;
  --border: #6b3000;
  --text-primary: #ffe0c0;
  --text-secondary: #d4a574;
  --text-muted: #a07040;
  --accent: #ff4500;
  --accent-glow: rgba(255, 69, 0, 0.3);
  --green: #ff8c00;
  --green-glow: rgba(255, 140, 0, 0.4);
  --orange: #ffaa00;
  --red: #ff2200;
  --purple: #ff6633;
  --cyan: #ffcc00;
}

[data-theme="fire"] .brand-name {
  background: linear-gradient(135deg, #ff4500, #ffcc00);
  -webkit-background-clip: text;
  text-shadow: 0 0 20px rgba(255, 69, 0, 0.5);
}

[data-theme="fire"] .overlay-value {
  background: linear-gradient(135deg, #ff4500, #ffcc00);
  -webkit-background-clip: text;
}

[data-theme="fire"] .nav-link.active {
  color: #ff4500;
  background: rgba(255, 69, 0, 0.15);
}

[data-theme="fire"] .btn-toggle.active {
  background: #ff4500;
  border-color: #ff4500;
  box-shadow: 0 0 10px rgba(255, 69, 0, 0.4);
}

[data-theme="fire"] .toggle-switch.active {
  background: rgba(255, 140, 0, 0.2);
  border-color: #ff8c00;
  color: #ff8c00;
  box-shadow: 0 0 6px rgba(255, 140, 0, 0.3);
}

[data-theme="fire"] .platform-btn.active {
  background: rgba(255, 69, 0, 0.1);
  border-color: #ff4500;
  color: #ff4500;
}

[data-theme="fire"] .panel-tab.active {
  color: #ff4500;
  border-bottom-color: #ff4500;
}

[data-theme="fire"] .stat-pill.live-pulse .dot {
  background: #ff4500;
  box-shadow: 0 0 10px rgba(255, 69, 0, 0.7);
  animation: firePulse 1.5s ease-in-out infinite;
}

@keyframes firePulse {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 6px rgba(255, 69, 0, 0.6); }
  50% { opacity: 0.7; transform: scale(1.2); box-shadow: 0 0 14px rgba(255, 69, 0, 0.9); }
}

[data-theme="fire"] .ticker-label {
  color: #ff4500;
  text-shadow: 0 0 10px rgba(255, 69, 0, 0.6);
}

[data-theme="fire"] .ticker-label .dot {
  background: #ff4500;
  box-shadow: 0 0 10px rgba(255, 69, 0, 0.8);
}

[data-theme="fire"] .ticker-item .ticker-pct { color: #ff8c00; }

[data-theme="fire"] .legend-dot.high { background: #ff4500; box-shadow: 0 0 8px rgba(255, 69, 0, 0.6); }
[data-theme="fire"] .legend-dot.med { background: #ff8c00; box-shadow: 0 0 6px rgba(255, 140, 0, 0.4); }
[data-theme="fire"] .legend-dot.low { background: #ffcc00; opacity: 0.7; }

[data-theme="fire"] .country-bar-fill {
  background: linear-gradient(90deg, #ff2200, #ff4500, #ffcc00);
}

[data-theme="fire"] .referral-count { color: #ff4500; }
[data-theme="fire"] .referral-pct { color: #ff8c00; }

[data-theme="fire"] .view-platform.linkedin { background: rgba(255, 69, 0, 0.15); color: #ff6633; }
[data-theme="fire"] .view-platform.github { background: rgba(255, 140, 0, 0.15); color: #ff8c00; }
[data-theme="fire"] .view-platform.portfolio { background: rgba(255, 204, 0, 0.15); color: #ffcc00; }
[data-theme="fire"] .view-platform.twitter { background: rgba(255, 34, 0, 0.15); color: #ff4422; }

[data-theme="fire"] .peak-cell.l1 { background: rgba(255, 69, 0, 0.15); }
[data-theme="fire"] .peak-cell.l2 { background: rgba(255, 69, 0, 0.3); }
[data-theme="fire"] .peak-cell.l3 { background: rgba(255, 69, 0, 0.5); }
[data-theme="fire"] .peak-cell.l4 { background: rgba(255, 69, 0, 0.7); }
[data-theme="fire"] .peak-cell.l5 { background: #ff4500; box-shadow: 0 0 8px rgba(255, 69, 0, 0.5); }

[data-theme="fire"] .top-bar {
  border-bottom: 1px solid #6b3000;
  box-shadow: 0 2px 20px rgba(255, 69, 0, 0.15);
}

[data-theme="fire"] .ticker-bar {
  border-top: 1px solid #6b3000;
  box-shadow: 0 -2px 20px rgba(255, 69, 0, 0.15);
}

[data-theme="fire"] .search-input:focus {
  border-color: #ff4500;
  box-shadow: 0 0 8px rgba(255, 69, 0, 0.3);
}

[data-theme="fire"] .zoom-btn:hover {
  border-color: #ff4500;
  box-shadow: 0 0 8px rgba(255, 69, 0, 0.3);
}

[data-theme="fire"] .theme-dropdown:focus {
  border-color: #ff4500;
  box-shadow: 0 0 0 2px rgba(255, 69, 0, 0.3);
}

/* ═══════════════════════════════════════
   ICED OVER THEME
   ═══════════════════════════════════════ */
[data-theme="ice"] {
  --bg-primary: #080e18;
  --bg-secondary: #0c1525;
  --bg-card: #111e35;
  --bg-hover: #192d4d;
  --border: #1e3a5f;
  --text-primary: #d0e8ff;
  --text-secondary: #8cb4d8;
  --text-muted: #5a8ab0;
  --accent: #4dc9f6;
  --accent-glow: rgba(77, 201, 246, 0.3);
  --green: #a0e8ff;
  --green-glow: rgba(160, 232, 255, 0.4);
  --orange: #7dd3fc;
  --red: #38bdf8;
  --purple: #93c5fd;
  --cyan: #e0f2fe;
}

[data-theme="ice"] .brand-name {
  background: linear-gradient(135deg, #a0e8ff, #e0f2fe);
  -webkit-background-clip: text;
  text-shadow: 0 0 20px rgba(160, 232, 255, 0.4);
}

[data-theme="ice"] .overlay-value {
  background: linear-gradient(135deg, #4dc9f6, #e0f2fe);
  -webkit-background-clip: text;
}

[data-theme="ice"] .nav-link.active {
  color: #4dc9f6;
  background: rgba(77, 201, 246, 0.1);
}

[data-theme="ice"] .btn-toggle.active {
  background: #4dc9f6;
  border-color: #4dc9f6;
  color: #080e18;
  box-shadow: 0 0 10px rgba(77, 201, 246, 0.3);
}

[data-theme="ice"] .toggle-switch.active {
  background: rgba(160, 232, 255, 0.15);
  border-color: #a0e8ff;
  color: #a0e8ff;
  box-shadow: 0 0 6px rgba(160, 232, 255, 0.2);
}

[data-theme="ice"] .platform-btn.active {
  background: rgba(77, 201, 246, 0.1);
  border-color: #4dc9f6;
  color: #4dc9f6;
}

[data-theme="ice"] .panel-tab.active {
  color: #4dc9f6;
  border-bottom-color: #4dc9f6;
}

[data-theme="ice"] .stat-pill.live-pulse .dot {
  background: #a0e8ff;
  box-shadow: 0 0 8px rgba(160, 232, 255, 0.6);
  animation: icePulse 3s ease-in-out infinite;
}

@keyframes icePulse {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); box-shadow: 0 0 12px rgba(160, 232, 255, 0.8); }
}

[data-theme="ice"] .ticker-label {
  color: #a0e8ff;
  text-shadow: 0 0 8px rgba(160, 232, 255, 0.4);
}

[data-theme="ice"] .ticker-label .dot {
  background: #a0e8ff;
  box-shadow: 0 0 8px rgba(160, 232, 255, 0.5);
}

[data-theme="ice"] .ticker-item .ticker-pct { color: #a0e8ff; }

[data-theme="ice"] .legend-dot.high { background: #e0f2fe; box-shadow: 0 0 8px rgba(224, 242, 254, 0.5); }
[data-theme="ice"] .legend-dot.med { background: #4dc9f6; }
[data-theme="ice"] .legend-dot.low { background: #1e3a5f; opacity: 0.8; }

[data-theme="ice"] .country-bar-fill {
  background: linear-gradient(90deg, #4dc9f6, #e0f2fe);
}

[data-theme="ice"] .referral-count { color: #4dc9f6; }
[data-theme="ice"] .referral-pct { color: #a0e8ff; }

[data-theme="ice"] .view-platform.linkedin { background: rgba(77, 201, 246, 0.15); color: #4dc9f6; }
[data-theme="ice"] .view-platform.github { background: rgba(147, 197, 253, 0.15); color: #93c5fd; }
[data-theme="ice"] .view-platform.portfolio { background: rgba(160, 232, 255, 0.15); color: #a0e8ff; }
[data-theme="ice"] .view-platform.twitter { background: rgba(224, 242, 254, 0.15); color: #e0f2fe; }

[data-theme="ice"] .peak-cell.l1 { background: rgba(77, 201, 246, 0.15); }
[data-theme="ice"] .peak-cell.l2 { background: rgba(77, 201, 246, 0.3); }
[data-theme="ice"] .peak-cell.l3 { background: rgba(77, 201, 246, 0.45); }
[data-theme="ice"] .peak-cell.l4 { background: rgba(77, 201, 246, 0.6); }
[data-theme="ice"] .peak-cell.l5 { background: #4dc9f6; box-shadow: 0 0 6px rgba(77, 201, 246, 0.4); }

[data-theme="ice"] .top-bar {
  border-bottom: 1px solid #1e3a5f;
  box-shadow: 0 2px 20px rgba(77, 201, 246, 0.08);
}

[data-theme="ice"] .ticker-bar {
  border-top: 1px solid #1e3a5f;
  box-shadow: 0 -2px 20px rgba(77, 201, 246, 0.08);
}

[data-theme="ice"] .search-input:focus {
  border-color: #4dc9f6;
  box-shadow: 0 0 8px rgba(77, 201, 246, 0.3);
}

[data-theme="ice"] .zoom-btn:hover {
  border-color: #4dc9f6;
  box-shadow: 0 0 8px rgba(77, 201, 246, 0.3);
}

[data-theme="ice"] .theme-dropdown:focus {
  border-color: #4dc9f6;
  box-shadow: 0 0 0 2px rgba(77, 201, 246, 0.3);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1200px) {
  .left-sidebar { width: 200px; }
  .right-panel { width: 260px; }
}

@media (max-width: 900px) {
  .left-sidebar { display: none; }
  .right-panel { width: 240px; }
  .top-stats { display: none; }
}
