/* --- CSS Reset & Variables --- */
:root {
  --neon-cyan: #00f0ff;
  --neon-blue: #0088ff;
  --bg-dark: #020617;
  --bg-panel: rgba(2, 6, 23, 0.65);
  --border-cyan: rgba(0, 240, 255, 0.2);
  --border-cyan-glow: rgba(0, 240, 255, 0.4);
  --text-main: #e2e8f0;
  
  --font-mono: 'Share Tech Mono', monospace;
  --font-sans: 'Outfit', sans-serif;
  
  --glow-shadow: 0 0 15px rgba(0, 240, 255, 0.15);
  --inset-glow: inset 0 0 15px rgba(0, 240, 255, 0.08);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  background-image: radial-gradient(circle at center, #071731 0%, var(--bg-dark) 75%);
  color: var(--text-main);
  font-family: var(--font-sans);
  user-select: none;
}

/* --- Tech Aesthetics Grid Overlays --- */
.grid-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: 30px 30px;
  background-image: 
    linear-gradient(to right, rgba(0, 240, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 240, 255, 0.02) 1px, transparent 1px);
  z-index: 1;
  pointer-events: none;
}

.vignette {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, transparent 50%, rgba(2, 6, 23, 0.8) 100%);
  z-index: 2;
  pointer-events: none;
}

/* --- Main HUD Grid Layout --- */
.hud-container {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 16px;
}

/* --- Header Styling --- */
.hud-header {
  height: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border-cyan);
  border-radius: 4px;
  background: var(--bg-panel);
  padding: 0 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--neon-cyan);
  box-shadow: var(--glow-shadow), var(--inset-glow);
  text-shadow: 0 0 5px rgba(0, 240, 255, 0.5);
  will-change: transform;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--neon-cyan);
  box-shadow: 0 0 8px var(--neon-cyan);
}

.pulsing {
  animation: pulse 1.5s ease-in-out infinite;
}

/* --- Main Workspace --- */
.hud-main {
  flex: 1;
  display: flex;
  gap: 16px;
  height: calc(100% - 240px); /* Adjusts for header & footer space */
}

/* Sidebars */
.hud-left, .hud-right {
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  will-change: transform;
}

/* Glassmorphic Panel HUD styling */
.hud-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-cyan);
  border-radius: 4px;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.02), var(--inset-glow);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.hud-panel:hover {
  border-color: var(--border-cyan-glow);
}

/* Corner brackets decoration for high-tech feel */
.hud-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--neon-cyan);
  border-left: 2px solid var(--neon-cyan);
}

.hud-panel::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 8px;
  height: 8px;
  border-bottom: 2px solid var(--neon-cyan);
  border-right: 2px solid var(--neon-cyan);
}

.panel-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--neon-cyan);
  padding: 8px 12px 4px;
  letter-spacing: 1.5px;
  text-shadow: 0 0 5px rgba(0, 240, 255, 0.3);
  border-bottom: 1px solid rgba(0, 240, 255, 0.08);
  background: rgba(0, 240, 255, 0.02);
}

/* --- Left Panel Widgets --- */
.diagnostics-summary {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
  font-family: var(--font-mono);
}

.diag-line {
  display: flex;
  justify-content: space-between;
}

.diag-line .label {
  color: #70757a;
}

.diag-line .value.cyan {
  color: var(--neon-cyan);
  text-shadow: 0 0 4px rgba(0, 240, 255, 0.4);
}

/* Neural Stream Log Console */
.scroll-terminal-container {
  flex: 1;
}

.terminal-feed {
  flex: 1;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(0, 240, 255, 0.7);
  overflow-y: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  line-height: 1.4;
}

.terminal-line {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.terminal-line.success {
  color: var(--neon-cyan);
}

.terminal-line.warning {
  color: #ff9f00;
}

/* --- Right Panel Widgets --- */
.aux-visual, .telemetry-chart {
  padding: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
}

canvas {
  max-width: 100%;
  display: block;
}

/* --- Center Hologram Stage --- */
.hud-center {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  will-change: transform;
}

.hologram-stage {
  position: relative;
  width: 500px;
  height: 500px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Outer Spinning Halo / Aura */
.aura-outer, .aura-inner, .aura-glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.aura-outer {
  width: 440px;
  height: 440px;
  border: 1.5px dashed rgba(0, 240, 255, 0.25);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.05);
  animation: rotateCW 35s linear infinite;
}

.aura-inner {
  width: 400px;
  height: 400px;
  border: 1px dotted rgba(0, 136, 255, 0.35);
  animation: rotateCCW 25s linear infinite;
}

.aura-glow {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.08) 0%, transparent 70%);
  filter: blur(10px);
  animation: pulseGlow 4s ease-in-out infinite;
}

/* Cyborg Vector Container */
.cyborg-svg-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.cyborg-svg {
  width: 100%;
  height: 100%;
  z-index: 5;
  filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.15));
}

/* SVG Circuit Path Animations */
.draw-path {
  stroke-dashoffset: 0;
  animation: drawLine 8s ease-in-out infinite alternate;
}

.flow-line {
  stroke-dasharray: 12 180;
  stroke-dashoffset: 192;
  animation: flowCurrent 4s linear infinite;
}

/* Glowing Third Eye Assembly */
.third-eye {
  position: absolute;
  top: 142px; /* Placed exactly inside the SVG forehead hex */
  left: 250px;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
}

.third-eye-lens {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #ffffff;
  box-shadow: 
    0 0 10px #ffffff,
    0 0 20px var(--neon-cyan),
    0 0 35px var(--neon-cyan);
  animation: eyePulse 2.5s ease-in-out infinite;
}

.third-eye-flare {
  position: absolute;
  width: 2px;
  height: 22px;
  background: linear-gradient(to bottom, transparent, #ffffff, transparent);
  box-shadow: 0 0 8px var(--neon-cyan);
  transform: rotate(45deg);
  opacity: 0.6;
  animation: flareSpin 12s linear infinite;
}

.third-eye::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 2px;
  background: linear-gradient(to right, transparent, #ffffff, transparent);
  box-shadow: 0 0 8px var(--neon-cyan);
  transform: rotate(45deg);
  opacity: 0.6;
  animation: flareSpin 12s linear infinite;
}

/* Vertical Laser Scanning Bar */
.scan-bar {
  position: absolute;
  left: 10%;
  width: 80%;
  height: 3px;
  background: linear-gradient(to right, transparent 5%, var(--neon-cyan) 50%, transparent 95%);
  box-shadow: 
    0 0 12px var(--neon-cyan),
    0 0 6px var(--neon-cyan);
  opacity: 0.45;
  z-index: 8;
  pointer-events: none;
  animation: verticalScan 6s linear infinite;
}

/* --- Bottom Footer HUD --- */
.hud-bottom {
  height: 160px;
  display: flex;
  gap: 16px;
  will-change: transform;
}

.bottom-widget {
  height: 100%;
}

.radar-widget {
  width: 160px;
}

.radar-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
  height: calc(100% - 25px);
}

.oscilloscope-widget {
  flex: 1;
}

.oscilloscope-container {
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.2);
  height: calc(100% - 25px);
  display: flex;
  justify-content: center;
  align-items: center;
}

.stat-bars-widget {
  width: 360px;
}

.stat-meters {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: center;
  height: calc(100% - 25px);
}

.meter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meter-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--neon-blue);
  letter-spacing: 0.5px;
}

.meter-bar-wrapper {
  width: 100%;
  height: 8px;
  background: rgba(0, 240, 255, 0.05);
  border: 1px solid rgba(0, 240, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.meter-bar {
  height: 100%;
  background: linear-gradient(to right, var(--neon-blue), var(--neon-cyan));
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
  transition: width 0.4s ease;
}

/* --- Keyframe Animations --- */
@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

@keyframes rotateCW {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes rotateCCW {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(0.95); opacity: 0.6; }
  50% { transform: scale(1.05); opacity: 1; }
}

@keyframes drawLine {
  0% { stroke-dashoffset: 1000; }
  100% { stroke-dashoffset: 0; }
}

@keyframes flowCurrent {
  from { stroke-dashoffset: 192; }
  to { stroke-dashoffset: 0; }
}

@keyframes eyePulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 10px #fff, 0 0 20px var(--neon-cyan), 0 0 35px var(--neon-cyan); }
  50% { transform: scale(1.2); box-shadow: 0 0 15px #fff, 0 0 30px var(--neon-cyan), 0 0 55px var(--neon-cyan); }
}

@keyframes flareSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes verticalScan {
  0% { top: 5%; }
  50% { top: 90%; }
  100% { top: 5%; }
}

@keyframes glitch {
  0%, 100% { transform: translate(0); }
  92% { transform: translate(0); }
  93% { transform: translate(-2px, 1px); filter: hue-rotate(90deg); }
  94% { transform: translate(2px, -1px); filter: hue-rotate(180deg); }
  95% { transform: translate(0); }
}

.glitch-anim {
  animation: glitch 8s linear infinite;
}

/* Screen flickers */
@keyframes flicker {
  0%, 100% { opacity: 0.98; }
  25% { opacity: 0.99; }
  45% { opacity: 0.95; }
  55% { opacity: 0.99; }
  78% { opacity: 0.97; }
  90% { opacity: 0.99; }
}

body::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 240, 255, 0.003);
  pointer-events: none;
  z-index: 100;
  animation: flicker 0.15s infinite;
}

/* Media Query scaling adjustments */
@media (max-width: 1200px) {
  .hud-left, .hud-right {
    width: 250px;
  }
}
