﻿/* =====================================================
   🎮 AdvancedGraphics.css - SYSTÈME D'EFFETS GRAPHIQUES MEGA WOW
   🎆 Styles pour Canvas effects, WebGL, animations CSS avancées
   🌟 Compatible avec AdvancedGraphics.js
   ===================================================== */

/* =====================================================
   🌟 EFFETS CSS GLOBAUX
   ===================================================== */
body {
    zoom: 0.9;
}
/* Glow Effect */
.glow-effect {
    filter: drop-shadow(0 0 calc(var(--glow-intensity, 1) * 10px) var(--glow-color, #00FFFF)) !important;
    animation: glowPulse 2s ease-in-out infinite !important;
}

@keyframes glowPulse {
    0%, 100% {
        filter: drop-shadow(0 0 calc(var(--glow-intensity, 1) * 10px) var(--glow-color, #00FFFF));
    }

    50% {
        filter: drop-shadow(0 0 calc(var(--glow-intensity, 1) * 20px) var(--glow-color, #00FFFF));
    }
}

/* Blink Effect */
.blink-effect {
    animation: blinkAnimation var(--blink-speed, 1s) step-end infinite !important;
}

@keyframes blinkAnimation {
    0%, 50% {
        opacity: 1;
    }

    51%, 100% {
        opacity: 0.3;
    }
}

/* Pulse Effect */
.pulse-effect {
    animation: pulseAnimation var(--pulse-speed, 2s) ease-in-out infinite !important;
}

@keyframes pulseAnimation {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(var(--pulse-scale, 1.1));
    }
}

/* Animation Effect (Float) */
.animation-effect {
    animation: floatAnimation var(--animation-speed, 3s) ease-in-out infinite !important;
}

@keyframes floatAnimation {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Shadow Effect */
.shadow-effect {
    box-shadow: 0 0 calc(var(--shadow-intensity, 1) * 20px) var(--shadow-color, #FF00FF), inset 0 0 calc(var(--shadow-intensity, 1) * 10px) var(--shadow-color, #FF00FF)40 !important;
    animation: shadowPulse 3s ease-in-out infinite !important;
}

@keyframes shadowPulse {
    0%, 100% {
        box-shadow: 0 0 calc(var(--shadow-intensity, 1) * 20px) var(--shadow-color, #FF00FF), inset 0 0 calc(var(--shadow-intensity, 1) * 10px) var(--shadow-color, #FF00FF)40;
    }

    50% {
        box-shadow: 0 0 calc(var(--shadow-intensity, 1) * 40px) var(--shadow-color, #FF00FF), inset 0 0 calc(var(--shadow-intensity, 1) * 20px) var(--shadow-color, #FF00FF)60;
    }
}

/* =====================================================
   🌈 MORPHING SHAPES
   ===================================================== */

#morphContainer {
    position: fixed;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -5;
    overflow: hidden;
    display: none;
}

    #morphContainer.active {
        display: block;
    }

.morph-shape {
    position: absolute;
    background: radial-gradient(circle, var(--primary-color, #00D9FF) 0%, transparent 70%);
    filter: blur(80px);
    opacity: 0.5;
    animation: morphAnimation 20s ease-in-out infinite;
}

.morph-1 {
    width: 600px;
    height: 600px;
    top: -200px;
    left: -200px;
    animation-duration: 25s;
}

.morph-2 {
    width: 800px;
    height: 800px;
    bottom: -300px;
    right: -300px;
    animation-duration: 30s;
    animation-delay: -10s;
}

.morph-3 {
    width: 500px;
    height: 500px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-duration: 20s;
    animation-delay: -5s;
}

@keyframes morphAnimation {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }

    25% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }

    50% {
        border-radius: 40% 60% 60% 40% / 70% 30% 40% 60%;
    }

    75% {
        border-radius: 70% 30% 30% 70% / 30% 70% 70% 30%;
    }
}

/* =====================================================
   🎆 GLITCH EFFECT
   ===================================================== */

.glitch-effect {
    position: relative;
    animation: glitchText 10s infinite;
}

    .glitch-effect::before,
    .glitch-effect::after {
        content: attr(data-text);
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        opacity: 0.8;
    }

    .glitch-effect::before {
        animation: glitchBefore 0.5s infinite;
        color: #00FFFF;
        z-index: -1;
    }

    .glitch-effect::after {
        animation: glitchAfter 0.5s infinite;
        color: #FF00FF;
        z-index: -1;
    }

@keyframes glitchBefore {
    0%, 100% {
        transform: translate(0);
    }

    20% {
        transform: translate(-2px, 2px);
    }

    40% {
        transform: translate(-2px, -2px);
    }

    60% {
        transform: translate(2px, 2px);
    }

    80% {
        transform: translate(2px, -2px);
    }
}

@keyframes glitchAfter {
    0%, 100% {
        transform: translate(0);
    }

    20% {
        transform: translate(2px, -2px);
    }

    40% {
        transform: translate(2px, 2px);
    }

    60% {
        transform: translate(-2px, -2px);
    }

    80% {
        transform: translate(-2px, 2px);
    }
}
@keyframes glitchText {
    0%, 95%, 100% { /* ✅ RÉDUIT de 90% à 95% */
        text-shadow: none;
        transform: translate(0);
    }

    96% { /* ✅ GLITCH MOINS FRÉQUENT */
        text-shadow: 1px 1px 0 rgba(255, 0, 0, 0.5), -1px -1px 0 rgba(0, 255, 0, 0.5);
        transform: translate(0.5px, -0.5px); /* ✅ MOUVEMENT RÉDUIT */
    }

    98% {
        text-shadow: -1px 1px 0 rgba(0, 0, 255, 0.5), 1px -1px 0 rgba(255, 255, 0, 0.5);
        transform: translate(-0.5px, 0.5px); /* ✅ MOUVEMENT RÉDUIT */
    }
}

/* =====================================================
   ✨ CURSOR TRAIL
   ===================================================== */

.cursor-trail {
    position: fixed;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, var(--primary-color, #00D9FF) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: screen;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* =====================================================
   🎵 AUDIO REACTIVE
   ===================================================== */

.audio-reactive {
    transition: all 0.1s ease;
    transform-origin: center;
}

    .audio-reactive.bass-hit {
        transform: scale(1.1) !important;
        filter: brightness(1.3);
    }

    .audio-reactive.mid-hit {
        transform: rotate(2deg) !important;
        filter: saturate(1.5);
    }

    .audio-reactive.treble-hit {
        transform: translateY(-2px) !important;
        filter: hue-rotate(10deg);
    }

/* =====================================================
   🌌 ÉTOILES ET MÉTÉORES
   ===================================================== */

#starsAndMeteorsContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -8;
    overflow: hidden;
}

/* Étoiles filantes */
.shooting-star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px white;
    animation: shootingStar 1s linear;
}

    .shooting-star::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100px;
        height: 2px;
        background: linear-gradient(90deg, white, transparent);
        transform: translateX(-100px);
    }

@keyframes shootingStar {
    0% {
        transform: translateX(0) translateY(0);
        opacity: 1;
    }

    100% {
        transform: translateX(300px) translateY(300px);
        opacity: 0;
    }
}

/* Météores */
.meteor {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #FF6B6B;
    border-radius: 50%;
    box-shadow: 0 0 20px #FF6B6B, 0 0 40px #FF6B6B;
    animation: meteor 2s ease-in;
}

    .meteor::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 200px;
        height: 4px;
        background: linear-gradient(90deg, #FF6B6B, transparent);
        transform: translateX(-200px);
    }

@keyframes meteor {
    0% {
        transform: translateX(0) translateY(0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translateX(500px) translateY(500px) scale(0.5);
        opacity: 0;
    }
}

/* Étoiles scintillantes */
.sparkling-star {
    position: absolute;
    width: 4px;
    height: 4px;
    background: white;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0);
    }

    50% {
        opacity: 1;
        transform: scale(1);
    }
}

/* =====================================================
   🎮 CANVAS CONTAINERS
   ===================================================== */

.canvas-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -10;
    opacity: 0;
    transition: opacity 1s ease;
}

    .canvas-bg.active {
        opacity: 1;
    }

/* =====================================================
   🎨 PRESETS VISUELS
   ===================================================== */

/* Minimal */
body.preset-minimal {
    --effect-intensity: 0.5;
    --animation-speed: 2s;
}

/* Balanced */
body.preset-balanced {
    --effect-intensity: 0.75;
    --animation-speed: 1.5s;
}

/* Cinematic */
body.preset-cinematic {
    --effect-intensity: 1;
    --animation-speed: 1s;
}

    body.preset-cinematic .feature-card,
    body.preset-cinematic .section-title {
        animation: cinematicEntry 2s ease-out;
    }

@keyframes cinematicEntry {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
        filter: blur(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* Cyberpunk */
body.preset-cyberpunk {
    --effect-intensity: 0.9;
    --animation-speed: 1.2s;
}

    body.preset-cyberpunk * {
        text-shadow: 0 0 10px currentColor !important;
    }

/* Matrix */
body.preset-matrix {
    --effect-intensity: 1;
    --animation-speed: 1s;
    color: #00FF00 !important;
}

/* Psychedelic */
body.preset-psychedelic {
    --effect-intensity: 1;
    --animation-speed: 0.8s;
}

    body.preset-psychedelic * {
        animation: psychedelicColors 5s linear infinite !important;
    }


/* =====================================================
   🌊 EFFETS CANVAS SPÉCIFIQUES
   ===================================================== */

/* Matrix Rain */
#matrixRainCanvas {
    background: rgba(0, 0, 0, 0.05);
    mix-blend-mode: screen;
}

/* Waveform */
#waveformCanvas {
    mix-blend-mode: lighten;
}

/* Particle Network */
#particleNetworkCanvas {
    mix-blend-mode: screen;
}

/* Audio Visualizer */
#audioVisualizerCanvas {
    mix-blend-mode: lighten;
}

/* Geometric */
#geometricCanvas {
    mix-blend-mode: overlay;
}

/* Fractal */
#fractalCanvas {
    mix-blend-mode: screen;
}

/* Vortex */
#vortexCanvas {
    mix-blend-mode: lighten;
}

/* Plasma */
#plasmaCanvas {
    mix-blend-mode: color-dodge;
}

/* =====================================================
   ⚡ PERFORMANCE MODES
   ===================================================== */

/* Low Performance */
body.performance-low {
    --particle-count: 50;
    --animation-multiplier: 1.5;
}

    body.performance-low * {
        animation-play-state: paused !important;
    }

    body.performance-low .glow-effect,
    body.performance-low .shadow-effect {
        filter: none !important;
    }

/* Medium Performance */
body.performance-medium {
    --particle-count: 100;
    --animation-multiplier: 1.2;
}

body.performance-optimized {
    --particle-count: 150;
    --animation-multiplier: 1;
}

/* High Performance */
body.performance-high {
    --particle-count: 200;
    --animation-multiplier: 0.8;
}

/* Ultra Performance */
body.performance-ultra {
    --particle-count: 500;
    --animation-multiplier: 0.5;
}

    body.performance-ultra * {
        will-change: transform, opacity, filter;
    }

/* =====================================================
   🎯 ANIMATIONS ADDITIONNELLES
   ===================================================== */

/* Scale */
@keyframes scaleEffect {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

/* Shake */
@keyframes shakeEffect {
    0%, 100% {
        transform: translateX(0);
    }

    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }

    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* Swing */
@keyframes swingEffect {
    0%, 100% {
        transform: rotate(0deg);
    }

    20% {
        transform: rotate(15deg);
    }

    40% {
        transform: rotate(-10deg);
    }

    60% {
        transform: rotate(5deg);
    }

    80% {
        transform: rotate(-5deg);
    }
}

/* Bounce */
@keyframes bounceEffect {
    0%, 100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-30px);
    }

    60% {
        transform: translateY(-15px);
    }
}

/* Wobble */
@keyframes wobbleEffect {
    0%, 100% {
        transform: translateX(0) rotate(0deg);
    }

    15% {
        transform: translateX(-10px) rotate(-5deg);
    }

    30% {
        transform: translateX(10px) rotate(3deg);
    }

    45% {
        transform: translateX(-5px) rotate(-3deg);
    }

    60% {
        transform: translateX(5px) rotate(2deg);
    }

    75% {
        transform: translateX(-2px) rotate(-1deg);
    }
}

/* Fade */
@keyframes fadeEffect {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* Slide */
@keyframes slideEffect {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* Zoom */
@keyframes zoomEffect {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

/* =====================================================
   🌟 CLASSES UTILITAIRES
   ===================================================== */

.no-animation {
    animation: none !important;
    transition: none !important;
}

.fast-animation {
    animation-duration: calc(var(--animation-speed, 1s) * 0.5) !important;
}

.slow-animation {
    animation-duration: calc(var(--animation-speed, 1s) * 2) !important;
}

.infinite-animation {
    animation-iteration-count: infinite !important;
}

.reverse-animation {
    animation-direction: reverse !important;
}

.paused-animation {
    animation-play-state: paused !important;
}

/* =====================================================
   📱 RESPONSIVE
   ===================================================== */

@media (max-width: 768px) {
    .morph-shape {
        filter: blur(60px);
    }

    .morph-1 {
        width: 400px;
        height: 400px;
    }

    .morph-2 {
        width: 500px;
        height: 500px;
    }

    .morph-3 {
        width: 300px;
        height: 300px;
    }

    .cursor-trail {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =====================================================
   🔧 COMPATIBILITÉ
   ===================================================== */

/* Fallback pour les navigateurs sans support CSS custom properties */
@supports not (--css: variables) {
    .glow-effect {
        filter: drop-shadow(0 0 10px #00FFFF);
    }

    .shadow-effect {
        box-shadow: 0 0 20px #FF00FF;
    }

    .pulse-effect {
        animation: pulseAnimation 2s ease-in-out infinite;
    }
}

/* =====================================================
   🎭 MODES SPÉCIAUX (PARTY & CHAOS)
   ===================================================== */

/* Ces styles sont injectés dynamiquement par AdvancedGraphics.js
   mais sont inclus ici pour référence */

.party-mode-element {
    transform-origin: center !important;
    transition: all 0.3s ease !important;
}

.chaos-mode-element {
    transform-origin: center !important;
    will-change: transform, filter;
}

/* =====================================================
   FIN DU FICHIER AdvancedGraphics.css
   ===================================================== */
