/* Neural CSS Engine Pro - Core Styles
 * ============================
 * Iridescent Materials | Path Tracing | Morphing Backgrounds | Vencord Discord
 */

/* ========================
   CSS CUSTOM PROPERTIES
   ======================== */

:root {
    /* Core Neural Engine */
    --neural-enabled: false;
    --neural-scene-type: default;
    --neural-quality: medium;
    --neural-scale: 1.0;
    
    /* Path Tracing */
    --neural-path-trace: false;
    --neural-path-trace-samples: 4;
    --neural-path-trace-bounces: 4;
    
    /* Iridescent Effect */
    --neural-iridescent: false;
    --neural-iridescent-strength: 0.8;
    --neural-iridescent-color-1: rgb(255, 0, 128);
    --neural-iridescent-color-2: rgb(0, 255, 255);
    --neural-iridescent-color-3: rgb(128, 0, 255);
    --neural-iridescent-color-4: rgb(255, 255, 0);
    --neural-iridescent-color-5: rgb(0, 255, 128);
    --neural-iridescent-color-6: rgb(255, 128, 0);
    --neural-iridescent-color-7: rgb(0, 128, 255);
    --neural-fresnel-power: 3.0;
    
    /* Morphing Background */
    --neural-morph-bg-1: none;
    --neural-morph-bg-2: none;
    --neural-morph-strength: 0.5;
    --neural-morph-offset: 0.1;
    
    /* Chromatic Aberration */
    --neural-chromatic-aberration: 0.5;
    
    /* Wave Effects */
    --neural-wave-speed: 2.0;
    --neural-wave-amplitude: 0.1;
    --neural-wave-frequency: 15.0;
    
    /* View Angle (for iridescent/morph) */
    --neural-view-angle-x: 0;
    --neural-view-angle-y: 0;
    --neural-view-angle-z: 0;
    --neural-view-auto-animate: true;
    --neural-view-animation-speed: 1.0;
    
    /* Evolution (time-based morphing) */
    --neural-evolve: false;
    --neural-evolve-speed: 1.0;
    --neural-evolve-morph: true;
    
    /* Lighting */
    --neural-light-dir: 1 2 1;
    --neural-light-color: rgb(255, 255, 255);
    --neural-light-intensity: 1.0;
    --neural-ambient-color: rgb(26, 26, 46);
    --neural-bg-color: rgb(5, 5, 13);
    
    /* Grid */
    --neural-grid-color: rgb(0, 200, 255);
    --neural-grid-size: 1.0;
    --neural-grid-opacity: 0.3;
    
    /* Camera */
    --neural-camera-pos: 0 2 8;
    --neural-camera-fov: 1.5;
    --neural-camera-auto-rotate: false;
    --neural-camera-rotate-speed: 0.5;
    
    /* Vencord/Discord specific */
    --neural-overlay-opacity: 0.15;
    --neural-blend-mode: screen;
    --neural-animate-smooth: true;
}

/* ========================
   ACTIVATION CLASSES
   ======================== */

/* Add to any element to activate neural engine */
.neural-activated {
    --neural-enabled: true;
}

/* Add to body or Discord app wrapper for full overlay */
.neural-vencord {
    --neural-enabled: true;
    --neural-iridescent: true;
    --neural-overlay-opacity: 0.15;
    --neural-blend-mode: screen;
}

/* Iridescent effect class */
.neural-iridescent {
    --neural-iridescent: true;
    --neural-iridescent-strength: 0.8;
}

/* Path trace effect class */
.neural-path-trace {
    --neural-path-trace: true;
    --neural-path-trace-samples: 4;
}

/* Morphing background class */
.neural-morph-bg {
    --neural-morph-bg-1: var(--morph-bg-1-image);
    --neural-morph-bg-2: var(--morph-bg-2-image);
    --neural-morph-strength: 0.5;
}

/* Evolving scene class */
.neural-evolve {
    --neural-evolve: true;
    --neural-evolve-speed: 1.0;
}

/* ========================
   ANIMATED BACKGROUNDS
   ======================== */

/* Iridescent animated background */
.neural-bg-iridescent {
    background: linear-gradient(
        135deg,
        var(--neural-iridescent-color-1),
        var(--neural-iridescent-color-2),
        var(--neural-iridescent-color-3),
        var(--neural-iridescent-color-4),
        var(--neural-iridescent-color-5),
        var(--neural-iridescent-color-6),
        var(--neural-iridescent-color-7)
    );
    background-size: 400% 400%;
    animation: neuralIridescentBG 8s ease infinite;
}

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

/* Fresnel glow effect */
.neural-fresnel-glow {
    position: relative;
    overflow: hidden;
}

.neural-fresnel-glow::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(0, 200, 255, 0.3),
        rgba(128, 0, 255, 0.2),
        transparent 60%
    );
    mix-blend-mode: screen;
    animation: neuralFresnelPulse 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes neuralFresnelPulse {
    0%, 100% { opacity: var(--neural-overlay-opacity, 0.15); transform: scale(1); }
    50% { opacity: calc(var(--neural-overlay-opacity, 0.15) * 1.5); transform: scale(1.05); }
}

/* Wave distortion overlay */
.neural-wave-overlay {
    position: relative;
}

.neural-wave-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 200, 255, 0.03) 2px,
        rgba(0, 200, 255, 0.03) 4px
    );
    animation: neuralWaveMove 2s linear infinite;
    pointer-events: none;
}

@keyframes neuralWaveMove {
    0% { transform: translateY(0); }
    100% { transform: translateY(20px); }
}

/* ========================
   VENCORD DISCORD THEMES
   ======================== */

/* Dark theme iridescent accents */
.theme-dark.neural-vencord {
    --neural-bg-color: rgb(10, 10, 15);
    --neural-ambient-color: rgb(20, 20, 35);
}

/* Light theme iridescent accents */
.theme-light.neural-vencord {
    --neural-bg-color: rgb(240, 240, 250);
    --neural-ambient-color: rgb(255, 255, 255);
    --neural-overlay-opacity: 0.08;
}

/* Iridescent scrollbar for Discord */
.neural-vencord ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.neural-vencord ::-webkit-scrollbar-track {
    background: var(--neural-bg-color);
}

.neural-vencord ::-webkit-scrollbar-thumb {
    background: linear-gradient(
        180deg,
        var(--neural-iridescent-color-1),
        var(--neural-iridescent-color-3),
        var(--neural-iridescent-color-5)
    );
    border-radius: 5px;
}

/* Iridescent buttons */
.neural-vencord button:not([class*="button"]),
.neural-vencord .button:not(.neural-off) {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.neural-vencord button::before,
.neural-vencord .button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.neural-vencord button:hover::before,
.neural-vencord .button:hover::before {
    transform: translateX(100%);
}

/* Iridescent borders on focus */
.neural-vencord *:focus-visible {
    outline: 2px solid transparent;
    box-shadow: 0 0 0 2px var(--neural-iridescent-color-2);
}

/* ========================
   RESPONSIVE SCALE
   ======================== */

@media (max-width: 768px) {
    :root {
        --neural-scale: 0.75;
        --neural-overlay-opacity: 0.1;
    }
}

@media (max-width: 480px) {
    :root {
        --neural-scale: 0.5;
        --neural-overlay-opacity: 0.05;
    }
}

/* High DPI scaling */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    :root {
        --neural-quality: high;
    }
}
