/* ========================================
🎵 AUDIO VISUALIZER STYLES — NEON INNOVATION v2.0
======================================== */
#visualizer-container {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  background: radial-gradient(ellipse at bottom, #0a0a1a 0%, #050510 100%);
}

#visualizer-canvas {
  width: 100%;
  height: 100%;
  display: block;
  filter: blur(0.5px) contrast(1.1);
  transform: translateZ(0);
  will-change: transform;
}

/* === НЕОНОВЫЙ ОВЕРЛЕЙ С ГРАДИЕНТОМ === */
#visualizer-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(255, 42, 109, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(0, 212, 255, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at center, rgba(188, 19, 254, 0.08) 0%, transparent 60%),
    linear-gradient(180deg, rgba(5, 5, 10, 0.95) 0%, rgba(5, 5, 10, 0.85) 50%, rgba(5, 5, 10, 0.95) 100%);
  pointer-events: none;
  animation: overlayShift 20s ease-in-out infinite;
}

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

#visualizer-container.active { background: transparent; }

#visualizer-container.active #visualizer-overlay {
  background:
    radial-gradient(ellipse at 20% 80%, rgba(255, 42, 109, 0.2) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(0, 212, 255, 0.2) 0%, transparent 50%),
    radial-gradient(ellipse at center, rgba(188, 19, 254, 0.15) 0%, transparent 60%),
    linear-gradient(180deg, rgba(5, 5, 10, 0.7) 0%, rgba(10, 10, 20, 0.6) 50%, rgba(5, 5, 10, 0.8) 100%);
  animation: overlayPulse 8s ease-in-out infinite;
}

@keyframes overlayPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

/* === НЕОНОВЫЕ ЧАСТИЦЫ === */
.particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  mix-blend-mode: screen;
  animation: particleFloat 6s ease-in-out infinite, particleGlow 2s ease-in-out infinite alternate;
  box-shadow: 0 0 10px currentColor, 0 0 20px currentColor, 0 0 40px currentColor, 0 0 80px currentColor;
}

.particle[data-color="purple"] {
  color: #bc13fe;
  background: radial-gradient(circle, rgba(188, 19, 254, 0.9), rgba(139, 92, 246, 0.6), transparent 70%);
}
.particle[data-color="cyan"] {
  color: #00d4ff;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.9), rgba(6, 182, 212, 0.6), transparent 70%);
}
.particle[data-color="pink"] {
  color: #ff2a6d;
  background: radial-gradient(circle, rgba(255, 42, 109, 0.9), rgba(236, 72, 153, 0.6), transparent 70%);
}
.particle[data-color="green"] {
  color: #00ffaa;
  background: radial-gradient(circle, rgba(0, 255, 170, 0.9), rgba(16, 185, 129, 0.6), transparent 70%);
}
.particle[data-color="orange"] {
  color: #ff9f1c;
  background: radial-gradient(circle, rgba(255, 159, 28, 0.9), rgba(249, 115, 22, 0.6), transparent 70%);
}
.particle[data-color="blue"] {
  color: #3b82f6;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.9), rgba(37, 99, 235, 0.6), transparent 70%);
}

@keyframes particleFloat {
  0%, 100% { transform: translateY(0) translateX(0) scale(1); }
  25% { transform: translateY(-30px) translateX(15px) scale(1.1); }
  50% { transform: translateY(-60px) translateX(0) scale(0.9); }
  75% { transform: translateY(-30px) translateX(-15px) scale(1.05); }
}

@keyframes particleGlow {
  0% { box-shadow: 0 0 10px currentColor, 0 0 20px currentColor, 0 0 40px currentColor; opacity: 0.7; }
  100% { box-shadow: 0 0 20px currentColor, 0 0 40px currentColor, 0 0 80px currentColor, 0 0 120px currentColor; opacity: 1; }
}

/* === НЕОНОВЫЕ ВОЛНЫ === */
.neon-wave {
  position: absolute;
  bottom: 0; left: 0; width: 200%; height: 150px;
  background: linear-gradient(90deg, transparent, rgba(255, 42, 109, 0.3), rgba(0, 212, 255, 0.3), rgba(188, 19, 254, 0.3), transparent);
  border-radius: 50% 50% 0 0;
  filter: blur(20px);
  animation: waveMove 4s linear infinite;
  opacity: 0.6;
}

.neon-wave::before {
  content: '';
  position: absolute;
  top: -20px; left: 0; width: 100%; height: 40px;
  background: linear-gradient(to top, rgba(255, 42, 109, 0.5), rgba(0, 212, 255, 0.5), transparent);
  filter: blur(10px);
}

@keyframes waveMove {
  0% { transform: translateX(-50%) scaleY(1); }
  50% { transform: translateX(-50%) scaleY(1.2); }
  100% { transform: translateX(-50%) scaleY(1); }
}

/* === ГЕОМЕТРИЧЕСКИЕ ЭФФЕКТЫ === */
.neon-shape {
  position: absolute;
  border: 2px solid;
  border-radius: 50%;
  pointer-events: none;
  animation: shapePulse 3s ease-in-out infinite, shapeRotate 20s linear infinite;
  opacity: 0.3;
}

.neon-shape[data-type="circle"] {
  border-color: #bc13fe;
  box-shadow: 0 0 20px rgba(188, 19, 254, 0.5), inset 0 0 20px rgba(188, 19, 254, 0.3);
}
.neon-shape[data-type="square"] {
  border-radius: 10px;
  border-color: #00d4ff;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.5), inset 0 0 20px rgba(0, 212, 255, 0.3);
}
.neon-shape[data-type="triangle"] {
  width: 0 !important; height: 0 !important;
  border: 30px solid transparent;
  border-bottom-color: #ff2a6d;
  box-shadow: 0 0 30px rgba(255, 42, 109, 0.5);
}

@keyframes shapePulse {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

@keyframes shapeRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* === ЭФФЕКТ "ENERGY BURST" === */
.energy-burst {
  position: absolute;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, white, currentColor, transparent 70%);
  pointer-events: none;
  animation: burstExpand 1.5s ease-out forwards;
  box-shadow: 0 0 20px currentColor, 0 0 40px currentColor, 0 0 80px currentColor;
}

@keyframes burstExpand {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(50); opacity: 0; }
}

/* === НЕОНОВАЯ СЕТКА === */
.neon-grid {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-image:
    linear-gradient(rgba(255, 42, 109, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.08) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: gridMove 20s linear infinite;
  opacity: 0.4;
  pointer-events: none;
}

@keyframes gridMove {
  0% { transform: perspective(500px) rotateX(60deg) translateY(0); }
  100% { transform: perspective(500px) rotateX(60deg) translateY(50px); }
}

/* === GLASSMORPHISM ЭФФЕКТ === */
.glass-panel {
  position: absolute;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 60px rgba(188, 19, 254, 0.1);
  animation: glassFloat 8s ease-in-out infinite;
}

@keyframes glassFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(1deg); }
}

/* === ЦВЕТОВЫЕ ТЕМЫ ДЛЯ ВИЗУАЛИЗАТОРА === */
#visualizer-container[data-theme="cyberpunk"] {
  --neon-primary: #ff00ff;
  --neon-secondary: #00ffff;
  --neon-accent: #ffff00;
}
#visualizer-container[data-theme="aurora"] {
  --neon-primary: #00ffaa;
  --neon-secondary: #bc13fe;
  --neon-accent: #ff2a6d;
}
#visualizer-container[data-theme="sunset"] {
  --neon-primary: #ff2a6d;
  --neon-secondary: #ff9f1c;
  --neon-accent: #ff6b9d;
}
#visualizer-container[data-theme="ocean"] {
  --neon-primary: #00d4ff;
  --neon-secondary: #3b82f6;
  --neon-accent: #00ffaa;
}

/* === АДАПТИВНОСТЬ И ПРОИЗВОДИТЕЛЬНОСТЬ === */
@media (max-width: 768px) {
  #visualizer-container { opacity: 0.7; }
  .particle { animation-duration: 4s; }
  .neon-wave { height: 100px; filter: blur(15px); }
}

@media (max-width: 480px) {
  #visualizer-container { opacity: 0.5; }
  #visualizer-overlay { background: linear-gradient(180deg, rgba(5, 5, 10, 0.95) 0%, rgba(5, 5, 10, 0.9) 100%); }
  .particle, .neon-wave, .neon-shape { display: none; }
}

#visualizer-container.paused * { animation-play-state: paused !important; }

@media (prefers-reduced-motion: reduce) {
  #visualizer-container *, .particle, .neon-wave, .neon-shape, .energy-burst {
    animation: none !important;
    transition: none !important;
  }
}

#visualizer-container:hover .particle {
  animation-duration: 3s;
  filter: brightness(1.2);
}

@keyframes colorCycle {
  0% { filter: hue-rotate(0deg); }
  25% { filter: hue-rotate(90deg); }
  50% { filter: hue-rotate(180deg); }
  75% { filter: hue-rotate(270deg); }
  100% { filter: hue-rotate(360deg); }
}

#visualizer-container.active .particle {
  animation: particleFloat 6s ease-in-out infinite, particleGlow 2s ease-in-out infinite alternate, colorCycle 30s linear infinite;
}