:root {
  --bg-deep: #0a0a1a;
  --bg-card: #12122a;
  --bg-card-hover: #1a1a3a;
  --border: #1a1a3a;
  --border-bright: #2a2a4a;
  --neon-green: #00ff88;
  --neon-blue: #00aaff;
  --neon-amber: #ffaa00;
  --neon-red: #ff4466;
  --neon-purple: #aa44ff;
  --text-primary: #e0e0f0;
  --text-secondary: #8888aa;
  --text-dim: #555577;
}

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

body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: 'Space Grotesk', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: 
    radial-gradient(ellipse at 20% 0%, rgba(0,170,255,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(0,255,136,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(170,68,255,0.02) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

#root { position: relative; z-index: 1; }

.font-mono { font-family: 'JetBrains Mono', monospace; }
.font-display { font-family: 'Space Grotesk', sans-serif; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--neon-blue); }

/* Glow effects */
.glow-green { box-shadow: 0 0 20px rgba(0,255,136,0.3), 0 0 60px rgba(0,255,136,0.1); }
.glow-blue { box-shadow: 0 0 20px rgba(0,170,255,0.3), 0 0 60px rgba(0,170,255,0.1); }
.glow-red { box-shadow: 0 0 20px rgba(255,68,102,0.3); }
.glow-amber { box-shadow: 0 0 20px rgba(255,170,0,0.3); }

.glow-green-subtle { box-shadow: 0 0 10px rgba(0,255,136,0.15); }
.glow-blue-subtle { box-shadow: 0 0 10px rgba(0,170,255,0.15); }

/* Neural pulse animation */
@keyframes neuralPulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

@keyframes neuralPulseActive {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  25% { opacity: 1; transform: scale(1.3); }
  50% { opacity: 0.8; transform: scale(1.1); }
  75% { opacity: 1; transform: scale(1.25); }
}

.pulse-idle { animation: neuralPulse 3s ease-in-out infinite; }
.pulse-training { animation: neuralPulseActive 0.8s ease-in-out infinite; }
.pulse-generating { animation: neuralPulseActive 1.2s ease-in-out infinite; }

/* Progress bar gradient */
.progress-gradient {
  background: linear-gradient(90deg, var(--neon-green), var(--neon-blue));
}

/* Glass card */
.glass-card {
  background: rgba(18, 18, 42, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.glass-card-hover:hover {
  border-color: var(--border-bright);
  background: rgba(26, 26, 58, 0.8);
}

/* Tab transition */
.tab-content {
  animation: fadeSlideIn 0.3s ease-out;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border-bright);
  transition: all 0.3s ease;
}

.drop-zone.drag-over {
  border-color: var(--neon-green);
  background: rgba(0,255,136,0.05);
  box-shadow: inset 0 0 30px rgba(0,255,136,0.05);
}

.drop-zone:hover {
  border-color: var(--neon-blue);
}

/* Canvas glow */
.canvas-glow {
  box-shadow: 0 0 30px rgba(0,255,136,0.2), 0 0 80px rgba(0,170,255,0.1);
  border: 2px solid var(--border-bright);
  border-radius: 8px;
}

/* Neon button base */
.neon-btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

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

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

/* Architecture diagram */
.arch-layer {
  background: rgba(0,170,255,0.1);
  border: 1px solid rgba(0,170,255,0.3);
  border-radius: 8px;
  padding: 8px 12px;
  text-align: center;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  transition: all 0.3s;
}

.arch-layer:hover {
  border-color: var(--neon-blue);
  background: rgba(0,170,255,0.2);
}

.arch-arrow {
  color: var(--neon-green);
  font-size: 18px;
  opacity: 0.6;
}

/* Toast animations */
@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

.toast-enter { animation: toastIn 0.3s ease-out; }
.toast-exit { animation: toastOut 0.3s ease-in; }

/* Latent space pad */
.latent-pad {
  background: repeating-linear-gradient(
    0deg,
    rgba(0,170,255,0.03) 0px,
    rgba(0,170,255,0.03) 1px,
    transparent 1px,
    transparent 20px
  ),
  repeating-linear-gradient(
    90deg,
    rgba(0,170,255,0.03) 0px,
    rgba(0,170,255,0.03) 1px,
    transparent 1px,
    transparent 20px
  );
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  cursor: crosshair;
}

/* Loss chart */
.loss-chart {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* Filmstrip */
.filmstrip {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 8px 0;
}

.filmstrip-frame {
  min-width: 64px;
  height: 64px;
  border: 1px solid var(--border);
  border-radius: 4px;
  object-fit: cover;
}

/* Mobile warning */
@media (max-width: 768px) {
  .mobile-warning { display: flex !important; }
  .desktop-content { display: none !important; }
}

@media (min-width: 769px) {
  .mobile-warning { display: none !important; }
}

/* Custom range slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
  width: 100%;
}

input[type="range"]::-webkit-slider-track {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--neon-green);
  border-radius: 50%;
  margin-top: -6px;
  box-shadow: 0 0 8px rgba(0,255,136,0.4);
}

input[type="range"]::-moz-range-track {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  border: none;
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--neon-green);
  border-radius: 50%;
  border: none;
  box-shadow: 0 0 8px rgba(0,255,136,0.4);
}

select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 6px;
  padding: 6px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}

select:focus {
  outline: none;
  border-color: var(--neon-blue);
}