/* ========================================
🎵 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(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(6, 182, 212, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at center, rgba(236, 72, 153, 0.1) 0%, transparent 60%),
        linear-gradient(180deg, rgba(15, 15, 26, 0.95) 0%, rgba(15, 15, 26, 0.85) 50%, rgba(15, 15, 26, 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(139, 92, 246, 0.25) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(6, 182, 212, 0.25) 0%, transparent 50%),
        radial-gradient(ellipse at center, rgba(236, 72, 153, 0.2) 0%, transparent 60%),
        linear-gradient(180deg, rgba(10, 10, 20, 0.7) 0%, rgba(15, 15, 30, 0.6) 50%, rgba(10, 10, 20, 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: #a78bfa;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.9), rgba(139, 92, 246, 0.6), transparent 70%);
}

.particle[data-color="cyan"] {
    color: #22d3ee;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.9), rgba(6, 182, 212, 0.6), transparent 70%);
}

.particle[data-color="pink"] {
    color: #f472b6;
    background: radial-gradient(circle, rgba(244, 114, 182, 0.9), rgba(236, 72, 153, 0.6), transparent 70%);
}

.particle[data-color="green"] {
    color: #34d399;
    background: radial-gradient(circle, rgba(52, 211, 153, 0.9), rgba(16, 185, 129, 0.6), transparent 70%);
}

.particle[data-color="orange"] {
    color: #fb923c;
    background: radial-gradient(circle, rgba(251, 146, 60, 0.9), rgba(249, 115, 22, 0.6), transparent 70%);
}

.particle[data-color="blue"] {
    color: #60a5fa;
    background: radial-gradient(circle, rgba(96, 165, 250, 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(139, 92, 246, 0.3),
        rgba(6, 182, 212, 0.3),
        rgba(236, 72, 153, 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(139, 92, 246, 0.5),
        rgba(6, 182, 212, 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: #a78bfa;
    box-shadow: 
        0 0 20px rgba(167, 139, 250, 0.5),
        inset 0 0 20px rgba(167, 139, 250, 0.3);
}

.neon-shape[data-type="square"] {
    border-radius: 10px;
    border-color: #22d3ee;
    box-shadow: 
        0 0 20px rgba(34, 211, 238, 0.5),
        inset 0 0 20px rgba(34, 211, 238, 0.3);
}

.neon-shape[data-type="triangle"] {
    width: 0 !important;
    height: 0 !important;
    border: 30px solid transparent;
    border-bottom-color: #f472b6;
    box-shadow: 0 0 30px rgba(244, 114, 182, 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(139, 92, 246, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(6, 182, 212, 0.1) 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(139, 92, 246, 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: #00ff9d;
    --neon-secondary: #7b61ff;
    --neon-accent: #ff6b9d;
}

#visualizer-container[data-theme="sunset"] {
    --neon-primary: #ff6b6b;
    --neon-secondary: #feca57;
    --neon-accent: #ff9ff3;
}

#visualizer-container[data-theme="ocean"] {
    --neon-primary: #00d4ff;
    --neon-secondary: #7b68ee;
    --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(15, 15, 26, 0.95) 0%, rgba(15, 15, 26, 0.9) 100%);
    }
    
    .particle,
    .neon-wave,
    .neon-shape {
        display: none;
    }
}

/* === PERFORMANCE OPTIMIZATIONS === */
#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;
    }
}

/* === HOVER EFFECTS FOR INTERACTIVE ELEMENTS === */
#visualizer-container:hover .particle {
    animation-duration: 3s;
    filter: brightness(1.2);
}

/* === COLOR CYCLING FOR DYNAMIC EFFECT === */
@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;
}