/* Animations CSS pour OnlyInvest
   Contient les animations de fond et éléments dynamiques
   pour toutes les pages du site */

/* Variables globales pour les animations */
:root {
    --animation-speed-slow: 20s;
    --animation-speed-medium: 15s;
    --animation-speed-fast: 10s;
    --animation-speed-very-fast: 5s;
}

/* ===== ANIMATIONS DE FOND ===== */

/* Animation de fond principal */
.animated-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

/* Formes animées */
.animated-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
}

/* Forme 1 - Cercle supérieur gauche */
.animated-shape.shape-1 {
    width: 500px;
    height: 500px;
    background: linear-gradient(45deg, #050505, #0f0f0f);
    top: -250px;
    left: -250px;
    animation: floatAnimation var(--animation-speed-slow) infinite alternate ease-in-out,
               colorPulse var(--animation-speed-medium) infinite alternate;
}

/* Forme 2 - Cercle supérieur droit */
.animated-shape.shape-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #111111, var(--accent-color));
    top: -200px;
    right: -200px;
    animation: floatAnimation var(--animation-speed-medium) infinite alternate-reverse ease-in-out,
               colorPulse var(--animation-speed-slow) infinite alternate-reverse;
}

/* Forme 3 - Cercle inférieur */
.animated-shape.shape-3 {
    width: 600px;
    height: 600px;
    background: linear-gradient(225deg, #0a0a0a, var(--accent-color));
    bottom: -300px;
    right: -200px;
    animation: floatAnimation var(--animation-speed-slow) infinite alternate ease-in-out,
               colorPulse var(--animation-speed-fast) infinite alternate;
}

/* Forme 4 - Cercle inférieur gauche */
.animated-shape.shape-4 {
    width: 450px;
    height: 450px;
    background: linear-gradient(315deg, #111111, #0a0a0a);
    bottom: -200px;
    left: -200px;
    animation: floatAnimation var(--animation-speed-medium) infinite alternate-reverse ease-in-out,
               colorPulse var(--animation-speed-slow) infinite alternate-reverse;
}

/* Forme 5 - Petite forme centrale */
.animated-shape.shape-5 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, var(--accent-color), transparent);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulseAnimation var(--animation-speed-fast) infinite alternate ease-in-out,
               rotateAnimation var(--animation-speed-medium) infinite linear;
}

/* Particules flottantes */
.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: var(--accent-color);
    border-radius: 50%;
    opacity: 0.3;
    animation: floatParticle var(--animation-speed-medium) infinite linear;
}

/* Particules avec positions et délais variés */
.particle:nth-child(1) { top: 10%; left: 20%; animation-delay: 0s; width: 3px; height: 3px; opacity: 0.2; }
.particle:nth-child(2) { top: 25%; left: 80%; animation-delay: 1s; width: 5px; height: 5px; opacity: 0.3; }
.particle:nth-child(3) { top: 40%; left: 35%; animation-delay: 2s; width: 4px; height: 4px; opacity: 0.2; }
.particle:nth-child(4) { top: 65%; left: 50%; animation-delay: 0.5s; width: 6px; height: 6px; opacity: 0.4; }
.particle:nth-child(5) { top: 75%; left: 15%; animation-delay: 1.5s; width: 3px; height: 3px; opacity: 0.2; }
.particle:nth-child(6) { top: 85%; left: 90%; animation-delay: 3s; width: 5px; height: 5px; opacity: 0.3; }
.particle:nth-child(7) { top: 15%; left: 60%; animation-delay: 2.5s; width: 4px; height: 4px; opacity: 0.25; }
.particle:nth-child(8) { top: 45%; left: 75%; animation-delay: 1.2s; width: 7px; height: 7px; opacity: 0.35; }
.particle:nth-child(9) { top: 55%; left: 5%; animation-delay: 0.8s; width: 3px; height: 3px; opacity: 0.2; }
.particle:nth-child(10) { top: 30%; left: 45%; animation-delay: 3.5s; width: 5px; height: 5px; opacity: 0.3; }
.particle:nth-child(11) { top: 70%; left: 65%; animation-delay: 2.8s; width: 4px; height: 4px; opacity: 0.25; }
.particle:nth-child(12) { top: 20%; left: 30%; animation-delay: 1.7s; width: 6px; height: 6px; opacity: 0.35; }
.particle:nth-child(13) { top: 50%; left: 85%; animation-delay: 0.3s; width: 3px; height: 3px; opacity: 0.2; }
.particle:nth-child(14) { top: 80%; left: 40%; animation-delay: 2.2s; width: 5px; height: 5px; opacity: 0.3; }
.particle:nth-child(15) { top: 35%; left: 55%; animation-delay: 1.9s; width: 4px; height: 4px; opacity: 0.25; }
.particle:nth-child(16) { top: 60%; left: 25%; animation-delay: 3.2s; width: 7px; height: 7px; opacity: 0.35; }
.particle:nth-child(17) { top: 5%; left: 70%; animation-delay: 0.7s; width: 3px; height: 3px; opacity: 0.2; }
.particle:nth-child(18) { top: 90%; left: 10%; animation-delay: 2.4s; width: 5px; height: 5px; opacity: 0.3; }
.particle:nth-child(19) { top: 95%; left: 95%; animation-delay: 1.3s; width: 4px; height: 4px; opacity: 0.25; }
.particle:nth-child(20) { top: 15%; left: 15%; animation-delay: 3.7s; width: 6px; height: 6px; opacity: 0.35; }

/* Lignes de connexion */
.connection-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.2;
    background-image: 
        linear-gradient(to right, var(--accent-color) 1px, transparent 1px),
        linear-gradient(to bottom, var(--accent-color) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: moveGrid var(--animation-speed-slow) infinite linear;
}

/* Vagues de fond */
.wave-bg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: url('../images/wave.svg') repeat-x;
    background-size: 1000px 100px;
    animation: waveAnimation var(--animation-speed-medium) infinite linear;
    opacity: 0.1;
}

.wave-bg.wave-2 {
    bottom: 10px;
    opacity: 0.08;
    animation: waveAnimation var(--animation-speed-slow) infinite linear reverse;
}

.wave-bg.wave-3 {
    bottom: 20px;
    opacity: 0.05;
    animation: waveAnimation var(--animation-speed-fast) infinite linear;
}

/* Étoiles scintillantes */
.stars-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background-color: var(--accent-color);
    border-radius: 50%;
    animation: twinkle var(--animation-speed-fast) infinite ease-in-out;
}

/* Étoiles avec positions et délais variés */
.star:nth-child(1) { top: 5%; left: 10%; animation-delay: 0.2s; width: 2px; height: 2px; }
.star:nth-child(2) { top: 15%; left: 25%; animation-delay: 1.5s; width: 3px; height: 3px; }
.star:nth-child(3) { top: 25%; left: 40%; animation-delay: 0.7s; width: 1px; height: 1px; }
.star:nth-child(4) { top: 35%; left: 55%; animation-delay: 2.1s; width: 2px; height: 2px; }
.star:nth-child(5) { top: 45%; left: 70%; animation-delay: 1.3s; width: 3px; height: 3px; }
.star:nth-child(6) { top: 55%; left: 85%; animation-delay: 0.5s; width: 2px; height: 2px; }
.star:nth-child(7) { top: 65%; left: 15%; animation-delay: 1.8s; width: 1px; height: 1px; }
.star:nth-child(8) { top: 75%; left: 30%; animation-delay: 2.4s; width: 3px; height: 3px; }
.star:nth-child(9) { top: 85%; left: 45%; animation-delay: 0.9s; width: 2px; height: 2px; }
.star:nth-child(10) { top: 95%; left: 60%; animation-delay: 1.7s; width: 1px; height: 1px; }
.star:nth-child(11) { top: 8%; left: 75%; animation-delay: 2.2s; width: 2px; height: 2px; }
.star:nth-child(12) { top: 18%; left: 90%; animation-delay: 0.4s; width: 3px; height: 3px; }
.star:nth-child(13) { top: 28%; left: 5%; animation-delay: 1.1s; width: 2px; height: 2px; }
.star:nth-child(14) { top: 38%; left: 20%; animation-delay: 2.7s; width: 1px; height: 1px; }
.star:nth-child(15) { top: 48%; left: 35%; animation-delay: 0.8s; width: 2px; height: 2px; }
.star:nth-child(16) { top: 58%; left: 50%; animation-delay: 1.9s; width: 3px; height: 3px; }
.star:nth-child(17) { top: 68%; left: 65%; animation-delay: 0.3s; width: 2px; height: 2px; }
.star:nth-child(18) { top: 78%; left: 80%; animation-delay: 2.5s; width: 1px; height: 1px; }
.star:nth-child(19) { top: 88%; left: 95%; animation-delay: 1.2s; width: 2px; height: 2px; }
.star:nth-child(20) { top: 3%; left: 18%; animation-delay: 0.6s; width: 3px; height: 3px; }
.star:nth-child(21) { top: 13%; left: 33%; animation-delay: 2.3s; width: 2px; height: 2px; }
.star:nth-child(22) { top: 23%; left: 48%; animation-delay: 1.4s; width: 1px; height: 1px; }
.star:nth-child(23) { top: 33%; left: 63%; animation-delay: 0.1s; width: 2px; height: 2px; }
.star:nth-child(24) { top: 43%; left: 78%; animation-delay: 2.8s; width: 3px; height: 3px; }
.star:nth-child(25) { top: 53%; left: 93%; animation-delay: 1.6s; width: 2px; height: 2px; }
.star:nth-child(26) { top: 63%; left: 8%; animation-delay: 0.7s; width: 1px; height: 1px; }
.star:nth-child(27) { top: 73%; left: 23%; animation-delay: 2.0s; width: 2px; height: 2px; }
.star:nth-child(28) { top: 83%; left: 38%; animation-delay: 1.5s; width: 3px; height: 3px; }
.star:nth-child(29) { top: 93%; left: 53%; animation-delay: 0.2s; width: 2px; height: 2px; }
.star:nth-child(30) { top: 7%; left: 68%; animation-delay: 2.6s; width: 1px; height: 1px; }

/* ===== KEYFRAMES POUR LES ANIMATIONS ===== */

/* Animation flottante pour les formes */
@keyframes floatAnimation {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(30px, 30px);
    }
}

/* Animation de pulsation de couleur */
@keyframes colorPulse {
    0% {
        filter: hue-rotate(0deg) blur(60px);
    }
    100% {
        filter: hue-rotate(90deg) blur(70px);
    }
}

/* Animation de pulsation pour les formes */
@keyframes pulseAnimation {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.3;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.5;
    }
}

/* Animation de rotation */
@keyframes rotateAnimation {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Animation pour les particules flottantes */
@keyframes floatParticle {
    0% {
        transform: translateY(0) rotate(0deg);
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
    }
}

/* Animation pour la grille */
@keyframes moveGrid {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 40px 40px;
    }
}

/* Animation pour les vagues */
@keyframes waveAnimation {
    0% {
        background-position-x: 0;
    }
    100% {
        background-position-x: 1000px;
    }
}

/* Animation pour les étoiles scintillantes */
@keyframes twinkle {
    0%, 100% {
        opacity: 0.1;
        transform: scale(0.8);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

/* ===== ANIMATIONS SPÉCIFIQUES AUX PAGES ===== */

/* Page d'accueil */
.home-bg .animated-shape.shape-1 {
    background: linear-gradient(45deg, #1a1a1a, #2a2a2a);
}

.home-bg .animated-shape.shape-3 {
    background: linear-gradient(225deg, #1a1a1a, #d4af37);
}

/* Page formation */
.formation-bg .animated-shape.shape-1 {
    background: linear-gradient(45deg, #1a1a1a, #d4af37);
}

.formation-bg .animated-shape.shape-2 {
    background: linear-gradient(135deg, #2a2a2a, #d4af37);
}

/* Page copy trading */
.copy-trading-bg .animated-shape.shape-2 {
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
}

.copy-trading-bg .animated-shape.shape-3 {
    background: linear-gradient(225deg, #1a1a1a, #d4af37);
}

/* Page algorithme */
.algorithme-bg .animated-shape.shape-1 {
    background: linear-gradient(45deg, #2a2a2a, #d4af37);
}

.algorithme-bg .animated-shape.shape-3 {
    background: linear-gradient(225deg, #1a1a1a, #2a2a2a);
}

/* Page IA Factory */
.ia-factory-bg .animated-shape.shape-2 {
    background: linear-gradient(135deg, #1a1a1a, #d4af37);
}

.ia-factory-bg .animated-shape.shape-3 {
    background: linear-gradient(225deg, #2a2a2a, #1a1a1a);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .animated-shape {
        opacity: 0.3;
        filter: blur(40px);
    }
    
    .animated-shape.shape-1,
    .animated-shape.shape-2,
    .animated-shape.shape-3,
    .animated-shape.shape-4 {
        width: 300px;
        height: 300px;
    }
    
    .connection-lines {
        background-size: 20px 20px;
    }
    
    .wave-bg {
        height: 50px;
        background-size: 500px 50px;
    }
}

/* Préférence de réduction de mouvement */
@media (prefers-reduced-motion) {
    .animated-shape,
    .particle,
    .star,
    .wave-bg,
    .connection-lines {
        animation: none;
    }
}
