* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: #7b2ff7 #1a1a2e;
}

body {
  background: #0a0a14;
  overflow-x: hidden;
}

@keyframes pulse-glow {
  0%, 100% { text-shadow: 0 0 20px rgba(123, 47, 247, 0.5), 0 0 40px rgba(0, 212, 255, 0.3); }
  50% { text-shadow: 0 0 30px rgba(123, 47, 247, 0.8), 0 0 60px rgba(0, 212, 255, 0.5); }
}

@keyframes brain-bounce {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.15) rotate(-5deg); }
  50% { transform: scale(1.05) rotate(0deg); }
  75% { transform: scale(1.15) rotate(5deg); }
}

@keyframes float-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scan-line {
  0% { top: -2px; }
  100% { top: 100%; }
}

@keyframes neuron-fire {
  0% { fill: #1a1a2e; filter: drop-shadow(0 0 0px #7b2ff7); }
  50% { fill: #7b2ff7; filter: drop-shadow(0 0 12px #7b2ff7); }
  100% { fill: #1a1a2e; filter: drop-shadow(0 0 0px #7b2ff7); }
}

@keyframes synapse-pulse {
  0% { stroke: #333; stroke-width: 1; }
  50% { stroke: #00d4ff; stroke-width: 2.5; }
  100% { stroke: #333; stroke-width: 1; }
}

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

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.glass-card {
  background: rgba(30, 30, 53, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(123, 47, 247, 0.15);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.glass-card:hover {
  border-color: rgba(123, 47, 247, 0.35);
  box-shadow: 0 0 30px rgba(123, 47, 247, 0.08);
}

.terminal-area {
  background: #0d0d1a;
  border: 1px solid #1a1a2e;
  font-family: 'JetBrains Mono', monospace;
  position: relative;
  overflow: hidden;
}

.terminal-area::before {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 170, 0.15), transparent);
  animation: scan-line 4s linear infinite;
  pointer-events: none;
  z-index: 1;
}

.btn-glow {
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
}

.btn-glow::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(45deg, #7b2ff7, #00d4ff, #7b2ff7);
  background-size: 200% 200%;
  animation: gradient-shift 3s ease infinite;
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s;
}

.btn-glow:hover::before {
  opacity: 1;
}

.btn-glow:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(123, 47, 247, 0.4);
}

.btn-glow:active {
  transform: translateY(0);
}

.training-active .btn-glow::before {
  opacity: 1;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: #1a1a2e;
  border-radius: 2px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #7b2ff7;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(123, 47, 247, 0.6);
  transition: transform 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #7b2ff7;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 8px rgba(123, 47, 247, 0.6);
}

textarea, input[type="text"], input[type="number"] {
  background: #0d0d1a;
  border: 1px solid rgba(123, 47, 247, 0.2);
  transition: border-color 0.3s, box-shadow 0.3s;
}

textarea:focus, input[type="text"]:focus, input[type="number"]:focus {
  border-color: #7b2ff7;
  box-shadow: 0 0 16px rgba(123, 47, 247, 0.2);
  outline: none;
}

.confidence-bar {
  height: 24px;
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}

.confidence-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%);
  animation: gradient-shift 2s ease infinite;
}

.epoch-input::-webkit-inner-spin-button,
.epoch-input::-webkit-outer-spin-button {
  opacity: 1;
  height: 28px;
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #0a0a14;
}

::-webkit-scrollbar-thumb {
  background: #7b2ff7;
  border-radius: 3px;
}