/* ============================================
   Q LEAP INDUSTRIES - ATOMIC AGE THEME
   Retro-Futuristic Educational Platform
   1950s Laboratory Console Aesthetic
   ============================================ */

/* Design Tokens */
:root {
  /* Core Atomic Age Colors */
  --space-dark: #0b1220;
  --panel: rgba(15, 26, 47, 0.9);
  --neon-cyan: #00F0FF;
  --neon-purple: #A64DFF;
  --atomic-green: #00FF88;
  --warning-red: #FF2D55;
  --text-primary: #EAF2FF;
  --text-secondary: #9BB3CC;
  
  /* Component Surfaces */
  --panel-bg: linear-gradient(135deg, rgba(15, 26, 47, 0.95), rgba(26, 42, 68, 0.9));
  --panel-border: var(--neon-cyan);
  --panel-glow: 0 0 20px rgba(0, 240, 255, 0.3), inset 0 0 30px rgba(0, 240, 255, 0.05);
  
  /* Interactive States */
  --hover-glow: 0 0 25px rgba(0, 240, 255, 0.6);
  --active-glow: 0 0 30px rgba(166, 77, 255, 0.7);
  --focus-ring: 0 0 0 3px rgba(0, 240, 255, 0.4);
  
  /* Typography */
  --font-display: 'Orbitron', monospace;
  --font-body: 'Exo 2', system-ui, sans-serif;
  --letter-spacing-tight: -0.02em;
  --letter-spacing-wide: 0.05em;
}

/* Global Theme Application */
body.theme-atomic {
  background: var(--space-dark);
  color: var(--text-primary);
  font-family: var(--font-body);
  position: relative;
}

/* Background Layers */
.starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -2;
  background-image: 
    radial-gradient(2px 2px at 10% 20%, white, transparent),
    radial-gradient(1px 1px at 30% 40%, white, transparent),
    radial-gradient(2px 2px at 50% 10%, white, transparent),
    radial-gradient(1px 1px at 70% 60%, white, transparent),
    radial-gradient(1px 1px at 90% 30%, white, transparent);
  background-size: 300px 300px;
  animation: starDrift 120s linear infinite;
  opacity: 0.7;
}

@keyframes starDrift {
  from { transform: translateY(0); }
  to { transform: translateY(-300px); }
}

.retro-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  background-image: 
    linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: gridPulse 8s ease-in-out infinite;
}

@keyframes gridPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.5; }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .starfield,
  .retro-grid {
    animation: none;
  }
  
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Header/Logo Bar Theming */
.theme-atomic .header,
.theme-atomic .recruit-mode-header {
  background: var(--panel-bg);
  border: 2px solid var(--panel-border);
  box-shadow: var(--panel-glow);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  margin: 1rem;
}

.theme-atomic .logo,
.theme-atomic .qleap-text {
  font-family: var(--font-display);
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  text-shadow: 0 0 30px currentColor;
}

/* Panel/Monitor Styling */
.theme-atomic .game-container,
.theme-atomic .monitor-container,
.theme-atomic .card,
.theme-atomic .modal-content {
  background: var(--panel-bg);
  border: 2px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: var(--panel-glow);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

/* Scanline Effect for Panels */
.theme-atomic .game-container::before,
.theme-atomic .monitor-container::before {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    transparent 0%,
    rgba(0, 240, 255, 0.03) 50%,
    transparent 100%
  );
  animation: scanline 12s linear infinite;
  pointer-events: none;
}

@keyframes scanline {
  0% { top: -100%; }
  100% { top: 100%; }
}

/* Button Styling - Lit Controls */
.theme-atomic .btn,
.theme-atomic button {
  background: linear-gradient(135deg, rgba(15, 26, 47, 0.9), rgba(26, 42, 68, 0.8));
  color: var(--neon-cyan);
  border: 2px solid var(--neon-cyan);
  border-radius: 8px;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  padding: 0.75rem 1.5rem;
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
  cursor: pointer;
}

.theme-atomic .btn:hover,
.theme-atomic button:hover {
  box-shadow: var(--hover-glow);
  transform: translateY(-2px);
  border-color: var(--atomic-green);
  color: var(--atomic-green);
}

.theme-atomic .btn:active,
.theme-atomic button:active {
  transform: translateY(0);
  box-shadow: var(--active-glow);
}

.theme-atomic .btn-primary {
  border-color: var(--atomic-green);
  color: var(--atomic-green);
}

.theme-atomic .btn-danger {
  border-color: var(--warning-red);
  color: var(--warning-red);
}

.theme-atomic .btn-secondary {
  border-color: var(--neon-purple);
  color: var(--neon-purple);
}

/* Focus States */
.theme-atomic button:focus,
.theme-atomic .btn:focus,
.theme-atomic input:focus,
.theme-atomic select:focus,
.theme-atomic textarea:focus {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Progress Bar as Fuel Gauge */
.theme-atomic .progress-bar,
.theme-atomic .timer-fill {
  background: linear-gradient(90deg, 
    var(--atomic-green) 0%, 
    var(--neon-cyan) 50%, 
    var(--atomic-green) 100%);
  box-shadow: 0 0 20px var(--atomic-green);
  position: relative;
  overflow: hidden;
}

.theme-atomic .progress-bar::before,
.theme-atomic .timer-fill::before {
  content: 'FUEL GAUGE';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.3);
  pointer-events: none;
}

.theme-atomic .progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.3), 
    transparent);
  animation: fuelShimmer 2s linear infinite;
}

@keyframes fuelShimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Stats Display - Nixie Tube Style */
.theme-atomic .score-display,
.theme-atomic .timer-display,
.theme-atomic .stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  background: linear-gradient(135deg, var(--atomic-green), var(--neon-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 
    0 0 10px currentColor,
    0 0 20px currentColor,
    0 0 30px currentColor;
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
}

/* Drag & Drop Enhancements */
.theme-atomic .answer-zone,
.theme-atomic .word-bank {
  border: 2px dashed var(--neon-purple);
  background: rgba(166, 77, 255, 0.05);
  transition: all 0.3s ease;
}

.theme-atomic .answer-zone:hover,
.theme-atomic .word-bank:hover {
  border-color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.08);
  box-shadow: inset 0 0 20px rgba(0, 240, 255, 0.2);
}

.theme-atomic .answer-zone.drag-over,
.theme-atomic .word-bank.drag-over {
  border-color: var(--atomic-green);
  background: rgba(0, 255, 136, 0.1);
  box-shadow: 
    inset 0 0 30px rgba(0, 255, 136, 0.3),
    0 0 20px rgba(0, 255, 136, 0.2);
  animation: quantumPulse 0.5s ease infinite;
}

@keyframes quantumPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.theme-atomic .word-tile {
  background: var(--panel-bg);
  border: 2px solid var(--neon-purple);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.theme-atomic .word-tile:hover {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.5);
  transform: translateY(-2px);
}

.theme-atomic .word-tile.dragging {
  border-color: var(--atomic-green);
  box-shadow: 0 0 25px var(--atomic-green);
  opacity: 0.8;
  transform: scale(1.1);
}

/* Modal as Console Popup */
.theme-atomic .modal {
  background: rgba(11, 18, 32, 0.95);
  backdrop-filter: blur(20px);
}

.theme-atomic .modal-content {
  animation: consoleSlideIn 0.3s ease;
  border-color: var(--atomic-green);
}

@keyframes consoleSlideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Success/Error States */
.theme-atomic .success {
  color: var(--atomic-green);
  text-shadow: 0 0 10px var(--atomic-green);
}

.theme-atomic .error {
  color: var(--warning-red);
  text-shadow: 0 0 10px var(--warning-red);
}

/* Form Controls */
.theme-atomic input,
.theme-atomic select,
.theme-atomic textarea {
  background: rgba(15, 26, 47, 0.8);
  border: 2px solid var(--neon-purple);
  color: var(--text-primary);
  font-family: var(--font-body);
  padding: 0.75rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.theme-atomic input:hover,
.theme-atomic select:hover,
.theme-atomic textarea:hover {
  border-color: var(--neon-cyan);
}

.theme-atomic input:focus,
.theme-atomic select:focus,
.theme-atomic textarea:focus {
  border-color: var(--atomic-green);
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

/* Typography Hierarchy */
.theme-atomic h1,
.theme-atomic h2,
.theme-atomic h3 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Quantum Glitch Effect (for special events) */
@keyframes quantumGlitch {
  0%, 100% { 
    transform: translateX(0);
    filter: hue-rotate(0deg);
  }
  20% { 
    transform: translateX(-2px);
    filter: hue-rotate(90deg);
  }
  40% { 
    transform: translateX(2px);
    filter: hue-rotate(180deg);
  }
  60% { 
    transform: translateX(-1px);
    filter: hue-rotate(270deg);
  }
  80% { 
    transform: translateX(1px);
    filter: hue-rotate(360deg);
  }
}

.theme-atomic .quantum-glitch {
  animation: quantumGlitch 0.3s ease;
}

/* Decorative Elements */
.theme-atomic .atomic-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--atomic-green);
  box-shadow: 0 0 10px var(--atomic-green);
  animation: atomicBlink 2s ease infinite;
  margin: 0 0.5rem;
}

@keyframes atomicBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Game Selection Cards */
.theme-atomic .game-selection {
  background: transparent;
}

.theme-atomic .game-card {
  background: var(--panel-bg);
  border: 2px solid var(--neon-purple);
  box-shadow: 0 0 15px rgba(166, 77, 255, 0.2);
}

.theme-atomic .game-card:hover {
  border-color: var(--neon-cyan);
  box-shadow: var(--hover-glow);
  transform: translateY(-5px);
}

/* Storage Status Dropdown */
.theme-atomic .storage-status-dropdown {
  background: var(--panel-bg);
  border: 2px solid var(--panel-border);
  border-radius: 8px;
}

.theme-atomic .storage-status-button {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--neon-purple);
}

.theme-atomic .storage-dropdown-content {
  background: var(--panel-bg);
  border: 2px solid var(--neon-cyan);
  box-shadow: var(--panel-glow);
}

/* Tab Navigation */
.theme-atomic .tab {
  background: rgba(15, 26, 47, 0.6);
  border: 2px solid var(--neon-purple);
  color: var(--text-secondary);
}

.theme-atomic .tab.active {
  background: var(--panel-bg);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

/* Game Info Display */
.theme-atomic .game-info {
  background: rgba(15, 26, 47, 0.8);
  border: 2px solid var(--neon-purple);
  color: var(--text-primary);
}

.theme-atomic .level-indicator {
  background: var(--panel-bg);
  border: 2px solid var(--atomic-green);
  color: var(--atomic-green);
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Score and Timer Containers */
.theme-atomic .score-timer {
  background: var(--panel-bg);
  border: 2px solid var(--neon-purple);
  box-shadow: inset 0 0 20px rgba(166, 77, 255, 0.1);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .theme-atomic .header {
    margin: 0.5rem;
    padding: 0.75rem;
  }
  
  .theme-atomic h1 { font-size: 1.5rem; }
  .theme-atomic h2 { font-size: 1.25rem; }
  .theme-atomic h3 { font-size: 1.1rem; }
  
  .retro-grid {
    background-size: 30px 30px;
  }
}

/* Print Styles */
@media print {
  .starfield,
  .retro-grid,
  .theme-atomic *::before,
  .theme-atomic *::after {
    display: none !important;
  }
  
  .theme-atomic * {
    background: white !important;
    color: black !important;
    border-color: black !important;
    box-shadow: none !important;
  }
}