/* ============================================================
   ARIA COMMAND CENTER — HUD BASE STYLES
   Deep space aesthetic. Futuristic. No dungeon.
   ============================================================ */

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

:root {
  --bg-void: #020409;
  --bg-panel: rgba(5, 12, 30, 0.85);
  --bg-panel-light: rgba(10, 22, 50, 0.7);
  --cyan: #00f5ff;
  --cyan-dim: rgba(0, 245, 255, 0.15);
  --cyan-glow: rgba(0, 245, 255, 0.4);
  --amber: #ffb700;
  --amber-dim: rgba(255, 183, 0, 0.15);
  --amber-glow: rgba(255, 183, 0, 0.4);
  --green: #00ff88;
  --green-dim: rgba(0, 255, 136, 0.15);
  --red: #ff3366;
  --red-dim: rgba(255, 51, 102, 0.15);
  --purple: #b800ff;
  --text-primary: #e8f4ff;
  --text-dim: rgba(180, 210, 255, 0.55);
  --text-label: rgba(0, 245, 255, 0.7);
  --border-glow: rgba(0, 245, 255, 0.2);
  --border-solid: rgba(0, 245, 255, 0.35);
  --font-hud: 'Orbitron', sans-serif;
  --font-data: 'Inter', sans-serif;
  --panel-radius: 4px;
  --scan-speed: 8s;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-data);
}

/* ---- STARFIELD BACKGROUND ---- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0, 80, 140, 0.18) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 20% 80%, rgba(0, 20, 80, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse 30% 30% at 80% 20%, rgba(60, 0, 100, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Scanline overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.04) 2px,
    rgba(0, 0, 0, 0.04) 4px
  );
  pointer-events: none;
  z-index: 1000;
  animation: scanlines var(--scan-speed) linear infinite;
}

@keyframes scanlines {
  0% { background-position: 0 0; }
  100% { background-position: 0 100px; }
}

/* ---- HUD LAYOUT GRID ---- */
#hud-root {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: 56px 1fr 48px;
  grid-template-columns: 1fr;
  gap: 0;
  z-index: 10;
  padding: 0;
}

/* ---- TOP NAV BAR ---- */
#hud-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-glow);
  background: rgba(2, 6, 18, 0.9);
  backdrop-filter: blur(12px);
  z-index: 100;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-brand .brand-name {
  font-family: var(--font-hud);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.25em;
  color: var(--cyan);
  text-transform: uppercase;
}

.topbar-brand .brand-tagline {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

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

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

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.topbar-time {
  font-family: var(--font-hud);
  font-size: 13px;
  color: var(--amber);
  letter-spacing: 0.1em;
}

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

/* ---- MAIN CONTENT AREA ---- */
#hud-main {
  display: grid;
  grid-template-columns: 320px 1fr 280px;
  grid-template-rows: 1fr;
  gap: 1px;
  overflow: hidden;
  background: rgba(0, 245, 255, 0.06);
}

/* ---- COLUMNS ---- */
.hud-col-left,
.hud-col-center,
.hud-col-right {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--cyan-dim) transparent;
}

.hud-col-left { background: rgba(2, 6, 18, 0.92); }
.hud-col-center { background: rgba(2, 6, 18, 0.88); gap: 1px; }
.hud-col-right { background: rgba(2, 6, 18, 0.92); }

/* ---- PANELS ---- */
.hud-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-glow);
  border-radius: var(--panel-radius);
  padding: 16px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

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

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

.panel-title {
  font-family: var(--font-hud);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.3em;
  color: var(--text-label);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-title::before {
  content: '';
  width: 3px;
  height: 12px;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  border-radius: 2px;
  flex-shrink: 0;
}

.panel-badge {
  font-family: var(--font-hud);
  font-size: 8px;
  padding: 2px 8px;
  border: 1px solid currentColor;
  border-radius: 2px;
  letter-spacing: 0.15em;
}

.badge-live { color: var(--green); }
.badge-amber { color: var(--amber); }
.badge-red { color: var(--red); }

/* ---- BOTTOM STATUS BAR ---- */
#hud-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-top: 1px solid var(--border-glow);
  background: rgba(2, 6, 18, 0.9);
  backdrop-filter: blur(12px);
  z-index: 100;
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  font-family: var(--font-hud);
}

.status-bar-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---- GLOW TEXT UTILS ---- */
.glow-cyan {
  color: var(--cyan);
  text-shadow: 0 0 10px var(--cyan-glow);
}

.glow-amber {
  color: var(--amber);
  text-shadow: 0 0 10px var(--amber-glow);
}

.glow-green {
  color: var(--green);
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

/* ---- CORNER DECORATIONS ---- */
.corner-tl,
.corner-tr,
.corner-bl,
.corner-br {
  position: absolute;
  width: 12px;
  height: 12px;
  z-index: 1;
  pointer-events: none;
}
.corner-tl { top: 0; left: 0; border-top: 1px solid var(--cyan); border-left: 1px solid var(--cyan); }
.corner-tr { top: 0; right: 0; border-top: 1px solid var(--cyan); border-right: 1px solid var(--cyan); }
.corner-bl { bottom: 0; left: 0; border-bottom: 1px solid var(--cyan); border-left: 1px solid var(--cyan); }
.corner-br { bottom: 0; right: 0; border-bottom: 1px solid var(--cyan); border-right: 1px solid var(--cyan); }

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--cyan-dim); border-radius: 2px; }

/* ---- TOOLTIPS ---- */
[data-tip] {
  position: relative;
  cursor: default;
}
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 10, 30, 0.95);
  border: 1px solid var(--border-glow);
  color: var(--text-primary);
  font-family: var(--font-data);
  font-size: 10px;
  padding: 4px 8px;
  white-space: nowrap;
  border-radius: 2px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 9999;
}

/* ---- MOBILE RESPONSIVE ---- */
@media (max-width: 768px) {
  /* Unlock scrolling */
  html, body {
    overflow-y: auto !important;
    height: auto !important;
  }

  /* Make root scrollable instead of fixed */
  #hud-root {
    position: relative !important;
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    overflow-y: visible;
  }

  /* Compact top bar */
  #hud-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0 10px;
    flex-shrink: 0;
  }

  .brand-tagline { display: none; }
  .brand-name { font-size: 10px !important; letter-spacing: 0.08em !important; }
  .topbar-center { gap: 8px; }
  .topbar-time { font-size: 11px !important; }

  /* Stack columns vertically */
  #hud-main {
    display: flex !important;
    flex-direction: column !important;
    overflow: visible !important;
    height: auto !important;
    flex: 1;
  }

  /* Each column: natural height, no internal scroll traps */
  .hud-col-left,
  .hud-col-center,
  .hud-col-right {
    overflow: visible !important;
    height: auto !important;
    min-height: unset !important;
    flex: none !important;
  }

  /* Panels: natural height */
  .hud-panel {
    padding: 12px !important;
    flex: none !important;
    overflow: visible !important;
  }

  /* Revenue rows: wrap instead of cut off */
  .rev-row {
    flex-wrap: wrap;
    gap: 4px;
  }

  /* Status bar: wrap on small screens */
  #hud-statusbar {
    flex-wrap: wrap;
    height: auto !important;
    padding: 6px 10px;
    gap: 4px;
  }
}
[data-tip]:hover::after { opacity: 1; }
