* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: #0a0a0f; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #12121a; }
::-webkit-scrollbar-thumb { background: #2a2a3e; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a5e; }

/* Glitch Title Animation */
@keyframes glitch {
  0%, 100% { text-shadow: 2px 0 #ff3355, -2px 0 #00d4ff; }
  20% { text-shadow: -3px 0 #ff3355, 3px 0 #00d4ff; }
  40% { text-shadow: 3px 0 #ff3355, -3px 0 #00d4ff; clip-path: inset(20% 0 30% 0); }
  41% { clip-path: inset(0); }
  60% { text-shadow: -2px 0 #ff3355, 2px 0 #00d4ff; }
  80% { text-shadow: 5px 0 #ff3355, -5px 0 #00d4ff; clip-path: inset(60% 0 10% 0); }
  81% { clip-path: inset(0); }
}

@keyframes glitchJitter {
  0%, 95%, 100% { transform: translate(0); }
  96% { transform: translate(-4px, 1px); }
  97% { transform: translate(2px, -1px); }
  98% { transform: translate(-1px, 2px); }
  99% { transform: translate(3px, 0); }
}

.glitch-title {
  animation: glitch 3s infinite, glitchJitter 4s infinite;
  font-family: 'Rajdhani', sans-serif;
}

/* VHS Tracking Line */
@keyframes vhsTrack {
  0% { top: -4px; opacity: 0; }
  5% { opacity: 0.8; }
  50% { opacity: 0.6; }
  95% { opacity: 0.8; }
  100% { top: calc(100% + 4px); opacity: 0; }
}

.vhs-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), rgba(0,212,255,0.4), rgba(255,255,255,0.3), transparent);
  animation: vhsTrack 4s linear infinite;
  pointer-events: none;
  z-index: 50;
}

/* Scanline overlay */
.scanlines {
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.15) 2px,
    rgba(0,0,0,0.15) 4px
  );
  pointer-events: none;
}

/* Neon glow effects */
.glow-green { box-shadow: 0 0 10px rgba(0,255,136,0.3), inset 0 0 10px rgba(0,255,136,0.05); }
.glow-purple { box-shadow: 0 0 10px rgba(180,77,255,0.3), inset 0 0 10px rgba(180,77,255,0.05); }
.glow-cyan { box-shadow: 0 0 10px rgba(0,212,255,0.3), inset 0 0 10px rgba(0,212,255,0.05); }
.glow-red { box-shadow: 0 0 10px rgba(255,51,85,0.3); }

/* Pulsing glow for active buttons */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(0,255,136,0.4); }
  50% { box-shadow: 0 0 25px rgba(0,255,136,0.7), 0 0 50px rgba(0,255,136,0.3); }
}

.pulse-glow { animation: pulseGlow 2s ease-in-out infinite; }

@keyframes pulseSoft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
.pulse-soft { animation: pulseSoft 1.5s ease-in-out infinite; }

/* Custom range slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: #1a1a2e;
  border-radius: 3px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #b44dff;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(180,77,255,0.5);
}
input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #b44dff;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 8px rgba(180,77,255,0.5);
}

/* Custom toggle switch */
.toggle-track {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: #1a1a2e;
  position: relative;
  cursor: pointer;
  transition: background 0.3s;
}
.toggle-track.active { background: #00ff88; }
.toggle-track .toggle-knob {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: left 0.3s;
}
.toggle-track.active .toggle-knob { left: 23px; }

/* Progress bar stripes */
@keyframes progressStripe {
  0% { background-position: 0 0; }
  100% { background-position: 40px 0; }
}

.progress-stripe {
  background-image: linear-gradient(
    45deg,
    rgba(255,255,255,0.1) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255,255,255,0.1) 50%,
    rgba(255,255,255,0.1) 75%,
    transparent 75%
  );
  background-size: 40px 40px;
  animation: progressStripe 1s linear infinite;
}

/* Timeline clip animation */
@keyframes clipSlide {
  0% { transform: scaleX(0); opacity: 0; }
  100% { transform: scaleX(1); opacity: 1; }
}

.clip-block {
  animation: clipSlide 0.3s ease-out forwards;
  transform-origin: left;
}

/* Beat dot pulse */
@keyframes beatPulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  10% { transform: scale(1.8); opacity: 1; }
}

/* Confetti */
@keyframes confettiFall {
  0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

.confetti-piece {
  position: fixed;
  width: 10px;
  height: 10px;
  top: 0;
  animation: confettiFall 3s ease-in forwards;
  z-index: 9999;
  pointer-events: none;
}

/* Drop zone */
.drop-zone {
  border: 2px dashed #2a2a3e;
  transition: all 0.3s;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: #00ff88;
  background: rgba(0,255,136,0.05);
}

/* Mode button */
.mode-btn {
  transition: all 0.3s;
  border: 1px solid #2a2a3e;
}
.mode-btn:hover {
  border-color: #b44dff;
  background: rgba(180,77,255,0.1);
}
.mode-btn.active {
  border-color: #b44dff;
  background: rgba(180,77,255,0.15);
  box-shadow: 0 0 20px rgba(180,77,255,0.3), inset 0 0 20px rgba(180,77,255,0.1);
}

/* Tooltip */
.tooltip-wrap { position: relative; }
.tooltip-wrap .tooltip-text {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a2e;
  color: #00d4ff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  border: 1px solid #2a2a3e;
  z-index: 100;
  transition: opacity 0.2s;
  pointer-events: none;
}
.tooltip-wrap:hover .tooltip-text { visibility: visible; opacity: 1; }

/* Panel styling */
.editor-panel {
  background: #12121a;
  border: 1px solid #1a1a2e;
  border-radius: 8px;
}

/* VU Meter */
@keyframes vuBounce {
  0%, 100% { height: 30%; }
  25% { height: 80%; }
  50% { height: 50%; }
  75% { height: 90%; }
}

/* Mobile responsive */
@media (max-width: 1024px) {
  .three-col { flex-direction: column !important; }
  .three-col > div { width: 100% !important; }
}