@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600;800;900&family=Share+Tech+Mono&display=swap');

:root {
  /* Green Matrix (Default Theme) */
  --neon-primary: #00ff66;
  --neon-primary-glow: rgba(0, 255, 102, 0.4);
  --neon-secondary: #008833;
  --neon-secondary-glow: rgba(0, 136, 51, 0.2);
  --bg-color: #030a05;
  --bg-glass: rgba(5, 15, 8, 0.7);
  --border-color: rgba(0, 255, 102, 0.25);
  --text-color: #e0ffe8;
  --text-dim: #70b080;
  
  --font-cyber: 'Share Tech Mono', monospace;
  --font-hud: 'Orbitron', sans-serif;
  --scanline-color: rgba(0, 255, 102, 0.04);
}

/* Blue Cyber Theme */
body.theme-blue {
  --neon-primary: #00d2ff;
  --neon-primary-glow: rgba(0, 210, 255, 0.4);
  --neon-secondary: #0066b3;
  --neon-secondary-glow: rgba(0, 102, 179, 0.2);
  --bg-color: #020710;
  --bg-glass: rgba(4, 11, 24, 0.75);
  --border-color: rgba(0, 210, 255, 0.25);
  --text-color: #e0f8ff;
  --text-dim: #70aacc;
  --scanline-color: rgba(0, 210, 255, 0.04);
}

/* Neon Purple Theme */
body.theme-purple {
  --neon-primary: #bd00ff;
  --neon-primary-glow: rgba(189, 0, 255, 0.4);
  --neon-secondary: #67008f;
  --neon-secondary-glow: rgba(103, 0, 143, 0.2);
  --bg-color: #08020e;
  --bg-glass: rgba(12, 4, 20, 0.75);
  --border-color: rgba(189, 0, 255, 0.25);
  --text-color: #fae0ff;
  --text-dim: #b678cc;
  --scanline-color: rgba(189, 0, 255, 0.04);
}

/* Red Alert Theme */
body.theme-red {
  --neon-primary: #ff003c;
  --neon-primary-glow: rgba(255, 0, 60, 0.4);
  --neon-secondary: #990024;
  --neon-secondary-glow: rgba(153, 0, 36, 0.2);
  --bg-color: #0a0104;
  --bg-glass: rgba(16, 2, 6, 0.8);
  --border-color: rgba(255, 0, 60, 0.35);
  --text-color: #ffe5ea;
  --text-dim: #cc7889;
  --scanline-color: rgba(255, 0, 60, 0.06);
}

/* Night Vision Theme */
body.theme-vision {
  --neon-primary: #8bc34a;
  --neon-primary-glow: rgba(139, 195, 74, 0.3);
  --neon-secondary: #558b2f;
  --neon-secondary-glow: rgba(85, 139, 47, 0.15);
  --bg-color: #040902;
  --bg-glass: rgba(8, 16, 6, 0.8);
  --border-color: rgba(139, 195, 74, 0.2);
  --text-color: #f1f8e9;
  --text-dim: #9ccc65;
  --scanline-color: rgba(139, 195, 74, 0.03);
}

/* General Reset & Backgrounds */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-cyber);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  position: relative;
  transition: background-color 0.5s ease;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}
::-webkit-scrollbar-thumb {
  background: var(--neon-primary);
  box-shadow: 0 0 4px var(--neon-primary-glow);
  border-radius: 2px;
}

/* Core scanline overlay */
.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    var(--scanline-color) 50%, 
    rgba(0, 0, 0, 0.15) 50%
  );
  background-size: 100% 4px;
  z-index: 9999;
  pointer-events: none;
}

.scanlines::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.25) 50%
  ), linear-gradient(
    90deg, 
    rgba(255, 0, 0, 0.06), 
    rgba(0, 255, 0, 0.02), 
    rgba(0, 0, 255, 0.06)
  );
  background-size: 100% 3px, 6px 100%;
  pointer-events: none;
}

/* Simulated CRT Flicker */
@keyframes crt-flicker {
  0% { opacity: 0.985; }
  50% { opacity: 1; }
  100% { opacity: 0.985; }
}

.crt-flicker-effect {
  animation: crt-flicker 0.15s infinite;
}

/* Matrix Background Canvas */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
}

#overlay-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(18, 16, 16, 0) 0%, rgba(255, 255, 255, 0.007) 10%, rgba(255, 255, 255, 0.007) 90%, rgba(18, 16, 16, 0) 100%),
    linear-gradient(90deg, rgba(18, 16, 16, 0) 0%, rgba(255, 255, 255, 0.007) 10%, rgba(255, 255, 255, 0.007) 90%, rgba(18, 16, 16, 0) 100%);
  background-size: 20px 20px;
  z-index: -1;
  pointer-events: none;
  opacity: 0.4;
}

/* Glassmorphism panels */
.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(10px) saturate(130%);
  -webkit-backdrop-filter: blur(10px) saturate(130%);
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5),
              inset 0 0 12px rgba(var(--neon-primary), 0.05);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.5s ease, box-shadow 0.5s ease;
}

.glass-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 12px;
  background-color: var(--neon-primary);
  box-shadow: 0 0 8px var(--neon-primary-glow);
}

.glass-panel::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 4px;
  background-color: var(--neon-primary);
  box-shadow: 0 0 8px var(--neon-primary-glow);
}

/* Neon Text Glow & Colors */
.glow-text {
  text-shadow: 0 0 5px var(--neon-primary-glow), 0 0 10px var(--neon-primary-glow);
}

.glow-text-bright {
  text-shadow: 0 0 5px var(--neon-primary-glow), 0 0 12px var(--neon-primary), 0 0 20px var(--neon-primary);
}

.glow-border {
  box-shadow: 0 0 10px var(--neon-primary-glow);
}

.glow-border-intense {
  box-shadow: 0 0 15px var(--neon-primary), inset 0 0 8px var(--neon-primary-glow);
}

/* Glitch Text Effect */
.glitch {
  position: relative;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
}

.glitch::before {
  left: 2px;
  text-shadow: -1px 0 #ff00c1;
  clip: rect(44px, 450px, 56px, 0);
  animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
  left: -2px;
  text-shadow: -1px 0 #00fff9, 0 1px #00fff9;
  clip: rect(85px, 450px, 140px, 0);
  animation: glitch-anim-2 5s infinite linear alternate-reverse;
}

/* Glitch Animations */
@keyframes glitch-anim {
  0% { clip: rect(15px, 9999px, 66px, 0); }
  5% { clip: rect(85px, 9999px, 5px, 0); }
  10% { clip: rect(34px, 9999px, 55px, 0); }
  15% { clip: rect(2px, 9999px, 98px, 0); }
  20% { clip: rect(54px, 9999px, 12px, 0); }
  25% { clip: rect(85px, 9999px, 40px, 0); }
  30% { clip: rect(10px, 9999px, 92px, 0); }
  35% { clip: rect(62px, 9999px, 18px, 0); }
  40% { clip: rect(45px, 9999px, 76px, 0); }
  45% { clip: rect(98px, 9999px, 5px, 0); }
  50% { clip: rect(10px, 9999px, 85px, 0); }
  55% { clip: rect(30px, 9999px, 40px, 0); }
  60% { clip: rect(75px, 9999px, 95px, 0); }
  65% { clip: rect(2px, 9999px, 60px, 0); }
  70% { clip: rect(90px, 9999px, 20px, 0); }
  75% { clip: rect(12px, 9999px, 82px, 0); }
  80% { clip: rect(58px, 9999px, 45px, 0); }
  85% { clip: rect(38px, 9999px, 90px, 0); }
  90% { clip: rect(6px, 9999px, 12px, 0); }
  95% { clip: rect(88px, 9999px, 75px, 0); }
  100% { clip: rect(25px, 9999px, 50px, 0); }
}

@keyframes glitch-anim-2 {
  0% { clip: rect(65px, 9999px, 100px, 0); }
  5% { clip: rect(5px, 9999px, 54px, 0); }
  10% { clip: rect(92px, 9999px, 3px, 0); }
  15% { clip: rect(12px, 9999px, 85px, 0); }
  20% { clip: rect(44px, 9999px, 60px, 0); }
  25% { clip: rect(75px, 9999px, 12px, 0); }
  30% { clip: rect(40px, 9999px, 95px, 0); }
  35% { clip: rect(90px, 9999px, 2px, 0); }
  40% { clip: rect(15px, 9999px, 70px, 0); }
  45% { clip: rect(55px, 9999px, 88px, 0); }
  50% { clip: rect(80px, 9999px, 25px, 0); }
  55% { clip: rect(5px, 9999px, 90px, 0); }
  60% { clip: rect(35px, 9999px, 45px, 0); }
  65% { clip: rect(72px, 9999px, 82px, 0); }
  70% { clip: rect(10px, 9999px, 15px, 0); }
  75% { clip: rect(85px, 9999px, 60px, 0); }
  80% { clip: rect(22px, 9999px, 92px, 0); }
  85% { clip: rect(60px, 9999px, 38px, 0); }
  90% { clip: rect(98px, 9999px, 50px, 0); }
  95% { clip: rect(48px, 9999px, 10px, 0); }
  100% { clip: rect(70px, 9999px, 80px, 0); }
}

/* Radar & Signal Scan Sweeper */
.radar-grid {
  border: 1px solid rgba(0, 255, 102, 0.1);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Red Alert Full-Screen Pulse */
@keyframes red-alert-pulse {
  0% { box-shadow: inset 0 0 10px rgba(255, 0, 60, 0.1); }
  50% { box-shadow: inset 0 0 80px rgba(255, 0, 60, 0.4); }
  100% { box-shadow: inset 0 0 10px rgba(255, 0, 60, 0.1); }
}

body.theme-red.red-alert-active {
  animation: red-alert-pulse 1.5s infinite ease-in-out;
}

/* Cyber Button Controls */
.cyber-btn {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
  font-family: var(--font-hud);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.cyber-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.15),
    transparent
  );
  transition: all 0.6s ease;
}

.cyber-btn:hover::before {
  left: 100%;
}

.cyber-btn:hover {
  background: var(--neon-primary);
  color: var(--bg-color);
  box-shadow: 0 0 15px var(--neon-primary-glow);
  border-color: var(--neon-primary);
  transform: translateY(-2px);
}

.cyber-btn:active {
  transform: translateY(1px);
}

.cyber-btn.active {
  background: var(--neon-primary);
  color: var(--bg-color);
  box-shadow: 0 0 20px var(--neon-primary);
  border-color: var(--neon-primary);
}

/* Boot Sequence Styling */
#boot-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #010502;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-family: var(--font-cyber);
  padding: 40px;
}

.boot-terminal-box {
  width: 100%;
  max-width: 800px;
  height: 400px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid var(--neon-primary);
  border-radius: 4px;
  box-shadow: 0 0 20px rgba(0, 255, 102, 0.1);
  padding: 20px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
}

.boot-progress-container {
  width: 100%;
  max-width: 800px;
  margin-bottom: 12px;
}

.boot-progress-bar {
  width: 0%;
  height: 8px;
  background-color: var(--neon-primary);
  box-shadow: 0 0 10px var(--neon-primary);
  border-radius: 4px;
  transition: width 0.1s linear;
}

/* Typing cursor animation */
.cursor::after {
  content: "█";
  animation: cursor-blink 0.8s infinite steps(2, start);
  color: var(--neon-primary);
  text-shadow: 0 0 5px var(--neon-primary-glow);
}

@keyframes cursor-blink {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

/* HUD Panels Structure */
.hud-header {
  border-bottom: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.4);
  position: relative;
}

.hud-panel-title {
  font-family: var(--font-hud);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--neon-primary);
}

/* Status dots */
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--neon-primary);
  box-shadow: 0 0 6px var(--neon-primary);
  display: inline-block;
}

.status-dot.blink {
  animation: status-blink 1s infinite alternate;
}

@keyframes status-blink {
  0% { opacity: 0.2; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1.1); }
}

/* Mode toggles animations speed control */
.paused *,
.paused::before,
.paused::after {
  animation-play-state: paused !important;
  transition-duration: 0s !important;
}

/* Interactive elements */
.interactive-panel {
  transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.interactive-panel:hover {
  transform: scale(1.005);
  border-color: var(--neon-primary);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), inset 0 0 16px rgba(var(--neon-primary), 0.08);
}

/* Hexagon SVG Grid Background overlay */
.hex-pattern-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cpath fill='%2300ff66' fill-opacity='0.5' fill-rule='evenodd' d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l11 6.35 11-6.35V17.9L14 11.55 3 17.9z'/%3E%3C/svg%3E");
  pointer-events: none;
}

body.theme-blue .hex-pattern-bg {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cpath fill='%2300d2ff' fill-opacity='0.5' fill-rule='evenodd' d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l11 6.35 11-6.35V17.9L14 11.55 3 17.9z'/%3E%3C/svg%3E");
}

body.theme-purple .hex-pattern-bg {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cpath fill='%23bd00ff' fill-opacity='0.5' fill-rule='evenodd' d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l11 6.35 11-6.35V17.9L14 11.55 3 17.9z'/%3E%3C/svg%3E");
}

body.theme-red .hex-pattern-bg {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cpath fill='%23ff003c' fill-opacity='0.5' fill-rule='evenodd' d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l11 6.35 11-6.35V17.9L14 11.55 3 17.9z'/%3E%3C/svg%3E");
}

body.theme-vision .hex-pattern-bg {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cpath fill='%238bc34a' fill-opacity='0.5' fill-rule='evenodd' d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l11 6.35 11-6.35V17.9L14 11.55 3 17.9z'/%3E%3C/svg%3E");
}
