* {
  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 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 shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes pill-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(123, 47, 247, 0.2); }
  50% { box-shadow: 0 0 16px rgba(123, 47, 247, 0.5); }
}

.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;
}

.prompt-pill {
  background: rgba(30, 30, 60, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(123, 47, 247, 0.2);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.prompt-pill:hover {
  border-color: rgba(123, 47, 247, 0.6);
  background: rgba(123, 47, 247, 0.15);
  box-shadow: 0 0 20px rgba(123, 47, 247, 0.25);
  transform: translateY(-2px) scale(1.02);
}

.prompt-pill:active {
  transform: translateY(0) scale(0.98);
}

.label-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}

.label-select {
  background: #0d0d1a;
  border: 1px solid rgba(123, 47, 247, 0.3);
  color: white;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-family: 'Space Grotesk', sans-serif;
  outline: none;
  cursor: pointer;
  transition: border-color 0.3s;
}

.label-select:focus {
  border-color: #7b2ff7;
  box-shadow: 0 0 12px rgba(123, 47, 247, 0.2);
}

.label-select option {
  background: #0d0d1a;
  color: white;
}

.prompt-scroll {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.prompt-scroll::-webkit-scrollbar {
  display: none;
}

.distribution-bar {
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  display: flex;
  background: rgba(255,255,255,0.05);
}

.distribution-segment {
  height: 100%;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 2px;
}

.filter-tab {
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  white-space: nowrap;
}

.filter-tab:hover {
  background: rgba(255,255,255,0.1);
}

.filter-tab.active {
  border-color: rgba(123, 47, 247, 0.5);
  background: rgba(123, 47, 247, 0.15);
}

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;
}

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

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

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

.tooltip-wrapper {
  position: relative;
}

.tooltip-wrapper .tooltip-text {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 20, 40, 0.95);
  border: 1px solid rgba(123, 47, 247, 0.3);
  color: rgba(255,255,255,0.8);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11px;
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
  transition: opacity 0.2s, visibility 0.2s;
  backdrop-filter: blur(8px);
}

.tooltip-wrapper:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

.custom-label-input {
  background: #0d0d1a;
  border: 1px solid rgba(123, 47, 247, 0.3);
  color: white;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  outline: none;
  width: 120px;
}

.custom-label-input:focus {
  border-color: #7b2ff7;
}