/* ========================================
   OSAT ELECTRIC - ANIMATIONS ÉLECTRIQUES
   Style GTA 5 avec effets d'électricité
   ======================================== */

/* Animation d'éclairs électriques en arrière-plan */
@keyframes lightning {
    0%, 100% { opacity: 0; }
    10% { opacity: 1; }
    11% { opacity: 0; }
    20% { opacity: 0.8; }
    21% { opacity: 0; }
}

@keyframes electricPulse {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(0, 188, 212, 0.4);
        filter: brightness(1);
    }
    50% { 
        box-shadow: 0 0 40px rgba(0, 188, 212, 0.8), 0 0 60px rgba(0, 188, 212, 0.6);
        filter: brightness(1.2);
    }
}

@keyframes sparkle {
    0%, 100% { 
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% { 
        transform: scale(1) rotate(180deg);
        opacity: 1;
    }
}

@keyframes floatSpark {
    0% {
        transform: translateY(100vh) translateX(0) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) translateX(var(--float-x)) scale(1);
        opacity: 0;
    }
}

@keyframes electricLine {
    0%, 100% {
        transform: scaleX(0);
        opacity: 0;
    }
    50% {
        transform: scaleX(1);
        opacity: 1;
    }
}

/* Conteneur d'animations électriques */
.electric-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Éclairs électriques */
.lightning {
    position: absolute;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, 
        transparent 0%,
        rgba(0, 188, 212, 0.8) 30%,
        rgba(0, 188, 212, 1) 50%,
        rgba(0, 188, 212, 0.8) 70%,
        transparent 100%
    );
    animation: lightning 4s infinite;
    opacity: 0;
    filter: blur(2px);
}

.lightning:nth-child(1) { left: 10%; animation-delay: 0s; }
.lightning:nth-child(2) { left: 30%; animation-delay: 1.5s; }
.lightning:nth-child(3) { left: 50%; animation-delay: 3s; }
.lightning:nth-child(4) { left: 70%; animation-delay: 0.8s; }
.lightning:nth-child(5) { left: 90%; animation-delay: 2.2s; }

/* Particules électriques flottantes */
.electric-spark {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #00bcd4;
    border-radius: 50%;
    box-shadow: 0 0 10px #00bcd4, 0 0 20px #00bcd4;
    animation: floatSpark linear infinite;
}

/* Lignes d'énergie horizontales */
.energy-line {
    position: absolute;
    height: 1px;
    width: 100%;
    background: linear-gradient(to right,
        transparent,
        rgba(0, 188, 212, 0.3) 40%,
        rgba(0, 188, 212, 0.6) 50%,
        rgba(0, 188, 212, 0.3) 60%,
        transparent
    );
    animation: electricLine 3s ease-in-out infinite;
    transform-origin: center;
}

/* Grid électrique style cyberpunk */
.electric-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 188, 212, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 188, 212, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
}

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

/* Cercles d'énergie pulsants */
.energy-circle {
    position: absolute;
    border: 2px solid rgba(0, 188, 212, 0.3);
    border-radius: 50%;
    animation: energyPulse 4s ease-in-out infinite;
}

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

/* Effet de lueur électrique sur hover */
.electric-glow {
    transition: all 0.3s ease;
}

.electric-glow:hover {
    animation: electricPulse 1s ease-in-out infinite;
}

/* Nuages pour thème clair */
@keyframes cloudFloat {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100vw); }
}

.cloud {
    position: absolute;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.9) 0%, rgba(226, 226, 226, 0.7) 100%);
    border-radius: 100px;
    opacity: 0;
    transition: opacity 0.5s ease;
    box-shadow: 0 5px 15px rgba(133, 133, 133, 0.1);
}

[data-theme="light"] .cloud {
    opacity: 1;
}

.cloud::before,
.cloud::after {
    content: '';
    position: absolute;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.9) 0%, rgba(202, 202, 202, 0.7) 100%);
    border-radius: 100px;
}

.cloud-1 {
    width: 120px;
    height: 40px;
    top: 100px;
    animation: cloudFloat 30s linear infinite;
}

.cloud-1::before {
    width: 50px;
    height: 50px;
    top: -25px;
    left: 10px;
}

.cloud-1::after {
    width: 60px;
    height: 40px;
    top: -15px;
    right: 10px;
}

.cloud-2 {
    width: 150px;
    height: 50px;
    top: 200px;
    animation: cloudFloat 45s linear infinite;
    animation-delay: -15s;
}

.cloud-2::before {
    width: 60px;
    height: 60px;
    top: -30px;
    left: 20px;
}

.cloud-2::after {
    width: 70px;
    height: 50px;
    top: -20px;
    right: 20px;
}

/* Soleil pour thème clair */
@keyframes sunRise {
    from {
        transform: translateY(100px) rotate(0deg);
        opacity: 0;
    }
    to {
        transform: translateY(0) rotate(360deg);
        opacity: 1;
    }
}

@keyframes sunPulse {
    0%, 100% {
        box-shadow: 
            0 0 40px rgba(255, 193, 7, 0.6),
            0 0 80px rgba(255, 193, 7, 0.4),
            0 0 120px rgba(255, 193, 7, 0.2);
    }
    50% {
        box-shadow: 
            0 0 60px rgba(255, 193, 7, 0.8),
            0 0 100px rgba(255, 193, 7, 0.6),
            0 0 140px rgba(255, 193, 7, 0.4);
    }
}

.sun {
    position: absolute;
    top: 80px;
    right: 100px;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, #ffc107 0%, #ff9800 100%);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.5s ease;
    animation: sunPulse 3s ease-in-out infinite;
}

[data-theme="light"] .sun {
    opacity: 1;
    animation: sunRise 1s ease-out, sunPulse 3s ease-in-out infinite 1s;
}

.sun::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: radial-gradient(circle, rgba(255, 193, 7, 0.3) 0%, transparent 70%);
    border-radius: 50%;
}

/* Rayons du soleil */
.sun-ray {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 40px;
    background: linear-gradient(to bottom, #ffc107, transparent);
    transform-origin: center -50px;
    animation: sunRayRotate 20s linear infinite;
}

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

.sun-ray:nth-child(1) { transform: rotate(0deg); }
.sun-ray:nth-child(2) { transform: rotate(45deg); }
.sun-ray:nth-child(3) { transform: rotate(90deg); }
.sun-ray:nth-child(4) { transform: rotate(135deg); }
.sun-ray:nth-child(5) { transform: rotate(180deg); }
.sun-ray:nth-child(6) { transform: rotate(225deg); }
.sun-ray:nth-child(7) { transform: rotate(270deg); }
.sun-ray:nth-child(8) { transform: rotate(315deg); }

/* Lune pour thème sombre */
@keyframes moonRise {
    from {
        transform: translateY(-100px) rotate(0deg);
        opacity: 0;
    }
    to {
        transform: translateY(0) rotate(30deg);
        opacity: 1;
    }
}

@keyframes moonGlow {
    0%, 100% {
        box-shadow: 
            0 0 40px rgba(189, 224, 254, 0.6),
            0 0 80px rgba(189, 224, 254, 0.4),
            0 0 120px rgba(189, 224, 254, 0.2);
    }
    50% {
        box-shadow: 
            0 0 60px rgba(189, 224, 254, 0.8),
            0 0 100px rgba(189, 224, 254, 0.6),
            0 0 140px rgba(189, 224, 254, 0.4);
    }
}

.moon {
    position: absolute;
    top: 80px;
    right: 100px;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle at 30% 30%, #e3f2fd 0%, #90caf9 100%);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.5s ease;
    animation: moonGlow 4s ease-in-out infinite;
    box-shadow: inset -20px -10px 0 rgba(100, 149, 237, 0.3);
}

[data-theme="dark"] .moon {
    opacity: 1;
    animation: moonRise 1s ease-out, moonGlow 4s ease-in-out infinite 1s;
}

/* Étoiles pour thème sombre */
@keyframes starTwinkle {
    0%, 100% { 
        opacity: 0.3;
        transform: scale(1);
    }
    50% { 
        opacity: 1;
        transform: scale(1.2);
    }
}

.star {
    position: absolute;
    width: 3px;
    height: 3px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    opacity: 0;
    transition: opacity 0.5s ease;
    animation: starTwinkle 3s ease-in-out infinite;
}

[data-theme="dark"] .star {
    opacity: 1;
}

/* Position aléatoire des étoiles */
.star:nth-child(1) { top: 10%; left: 20%; animation-delay: 0s; }
.star:nth-child(2) { top: 20%; left: 80%; animation-delay: 0.5s; }
.star:nth-child(3) { top: 15%; left: 50%; animation-delay: 1s; }
.star:nth-child(4) { top: 30%; left: 70%; animation-delay: 1.5s; }
.star:nth-child(5) { top: 25%; left: 30%; animation-delay: 2s; }
.star:nth-child(6) { top: 35%; left: 90%; animation-delay: 2.5s; }
.star:nth-child(7) { top: 40%; left: 15%; animation-delay: 3s; }
.star:nth-child(8) { top: 45%; left: 60%; animation-delay: 0.3s; }
.star:nth-child(9) { top: 50%; left: 40%; animation-delay: 0.8s; }
.star:nth-child(10) { top: 55%; left: 85%; animation-delay: 1.3s; }

/* Responsive */
@media (max-width: 768px) {
    .sun, .moon {
        width: 60px;
        height: 60px;
        top: 40px;
        right: 40px;
    }
    
    .cloud-1, .cloud-2 {
        transform: scale(0.6);
    }
    
    .lightning {
        width: 1px;
    }
}

