/* 
 * MOONLIGHT ANALYTICA ADVANCED ANIMATION STANDARDS
 * Quantum Fields, DNA Helix, Holographic Projections, and More
 */

/* 🌌 QUANTUM FIELD EFFECTS */
.quantum-field {
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at 30% 40%, rgba(0, 191, 255, 0.1), transparent),
                radial-gradient(circle at 70% 60%, rgba(135, 206, 235, 0.08), transparent);
    animation: quantumFieldShift 8s infinite ease-in-out;
}

@keyframes quantumFieldShift {
    0%, 100% { 
        background-position: 0% 0%, 100% 100%;
        filter: hue-rotate(0deg);
    }
    50% { 
        background-position: 100% 100%, 0% 0%;
        filter: hue-rotate(60deg);
    }
}

.quantum-particles {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #00bfff;
    border-radius: 50%;
    opacity: 0;
    animation: quantumParticle 6s infinite;
}

.quantum-particles:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; }
.quantum-particles:nth-child(2) { left: 30%; top: 70%; animation-delay: 1s; }
.quantum-particles:nth-child(3) { left: 60%; top: 40%; animation-delay: 2s; }
.quantum-particles:nth-child(4) { left: 80%; top: 80%; animation-delay: 3s; }

@keyframes quantumParticle {
    0%, 100% { opacity: 0; transform: scale(0.5); }
    25% { opacity: 1; transform: scale(1.2); }
    50% { opacity: 0.7; transform: scale(0.8) translateY(-20px); }
    75% { opacity: 0.9; transform: scale(1) translateY(-10px); }
}

/* 🧬 DNA HELIX ANIMATIONS */
.dna-helix {
    position: relative;
    height: 200px;
    width: 100px;
    margin: 0 auto;
    perspective: 1000px;
}

.dna-strand {
    position: absolute;
    width: 100%;
    height: 100%;
    animation: dnaRotate 4s linear infinite;
}

.dna-strand:nth-child(1) {
    animation-delay: 0s;
}

.dna-strand:nth-child(2) {
    animation-delay: 2s;
}

.dna-base {
    position: absolute;
    width: 12px;
    height: 12px;
    background: linear-gradient(45deg, #00bfff, #87ceeb);
    border-radius: 50%;
    left: 50%;
    transform-origin: 50px 0px;
}

.dna-base:nth-child(1) { top: 10%; animation: dnaBasePulse 2s infinite; }
.dna-base:nth-child(2) { top: 30%; animation: dnaBasePulse 2s infinite 0.5s; }
.dna-base:nth-child(3) { top: 50%; animation: dnaBasePulse 2s infinite 1s; }
.dna-base:nth-child(4) { top: 70%; animation: dnaBasePulse 2s infinite 1.5s; }

@keyframes dnaRotate {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

@keyframes dnaBasePulse {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.3); }
}

/* 🌐 HOLOGRAPHIC PROJECTIONS */
.holographic {
    position: relative;
    background: linear-gradient(45deg, transparent 30%, rgba(0, 191, 255, 0.1) 50%, transparent 70%);
    background-size: 20px 20px;
    animation: holographicScan 3s infinite;
    border: 1px solid rgba(0, 191, 255, 0.3);
}

.holographic::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(135, 206, 235, 0.6), transparent);
    animation: holographicSweep 2s infinite;
}

.holographic::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 191, 255, 0.1) 2px,
            rgba(0, 191, 255, 0.1) 4px
        );
    pointer-events: none;
    animation: holographicLines 1.5s infinite;
}

@keyframes holographicScan {
    0%, 100% { filter: hue-rotate(0deg) brightness(1); }
    50% { filter: hue-rotate(30deg) brightness(1.2); }
}

@keyframes holographicSweep {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes holographicLines {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* ⚡ MAGNETIC FIELD LINES */
.magnetic-field {
    position: relative;
    overflow: hidden;
    background: radial-gradient(ellipse at center, rgba(0, 191, 255, 0.05), transparent);
}

.field-line {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00bfff, transparent);
    border-radius: 1px;
    animation: magneticPulse 3s infinite ease-in-out;
}

.field-line:nth-child(1) {
    top: 20%;
    left: 10%;
    width: 80%;
    transform: rotate(-15deg);
    animation-delay: 0s;
}

.field-line:nth-child(2) {
    top: 40%;
    left: 5%;
    width: 90%;
    transform: rotate(5deg);
    animation-delay: 1s;
}

.field-line:nth-child(3) {
    top: 60%;
    left: 8%;
    width: 85%;
    transform: rotate(-8deg);
    animation-delay: 2s;
}

.field-line:nth-child(4) {
    top: 80%;
    left: 12%;
    width: 75%;
    transform: rotate(12deg);
    animation-delay: 1.5s;
}

@keyframes magneticPulse {
    0%, 100% { opacity: 0.3; transform: scaleX(0.8); }
    50% { opacity: 1; transform: scaleX(1.1); }
}

/* 🌊 NEURAL NETWORK SYNAPSES */
.neural-network {
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at 20% 30%, rgba(0, 191, 255, 0.05), transparent),
                radial-gradient(circle at 80% 70%, rgba(135, 206, 235, 0.03), transparent);
}

.neural-node {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #00bfff;
    border-radius: 50%;
    animation: neuralPulse 2s infinite;
    box-shadow: 0 0 10px rgba(0, 191, 255, 0.5);
}

.neural-connection {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, #00bfff, #87ceeb, #00bfff);
    animation: neuralSignal 3s infinite;
    transform-origin: left center;
}

.neural-node:nth-child(1) { top: 20%; left: 15%; animation-delay: 0s; }
.neural-node:nth-child(2) { top: 60%; left: 25%; animation-delay: 0.5s; }
.neural-node:nth-child(3) { top: 40%; left: 70%; animation-delay: 1s; }
.neural-node:nth-child(4) { top: 75%; left: 80%; animation-delay: 1.5s; }

@keyframes neuralPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.5); opacity: 1; box-shadow: 0 0 20px rgba(0, 191, 255, 0.8); }
}

@keyframes neuralSignal {
    0% { width: 0; opacity: 0; }
    25% { width: 100px; opacity: 1; }
    75% { width: 100px; opacity: 0.6; }
    100% { width: 120px; opacity: 0; }
}

/* 🌪️ WORMHOLE PORTAL EFFECTS */
.wormhole {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto;
    perspective: 1000px;
    overflow: hidden;
}

.wormhole-ring {
    position: absolute;
    border: 2px solid rgba(0, 191, 255, 0.6);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform-origin: center;
    animation: wormholeExpand 4s infinite ease-in-out;
}

.wormhole-ring:nth-child(1) {
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    animation-delay: 0s;
}

.wormhole-ring:nth-child(2) {
    width: 60px;
    height: 60px;
    margin: -30px 0 0 -30px;
    animation-delay: 1s;
    border-color: rgba(135, 206, 235, 0.5);
}

.wormhole-ring:nth-child(3) {
    width: 100px;
    height: 100px;
    margin: -50px 0 0 -50px;
    animation-delay: 2s;
    border-color: rgba(70, 130, 180, 0.4);
}

.wormhole-ring:nth-child(4) {
    width: 140px;
    height: 140px;
    margin: -70px 0 0 -70px;
    animation-delay: 3s;
    border-color: rgba(0, 191, 255, 0.3);
}

@keyframes wormholeExpand {
    0% { 
        transform: scale(0.2) rotateZ(0deg);
        opacity: 0;
    }
    25% { 
        transform: scale(0.6) rotateZ(90deg);
        opacity: 0.8;
    }
    50% { 
        transform: scale(1) rotateZ(180deg);
        opacity: 1;
    }
    75% { 
        transform: scale(1.2) rotateZ(270deg);
        opacity: 0.6;
    }
    100% { 
        transform: scale(1.4) rotateZ(360deg);
        opacity: 0;
    }
}

/* 🔥 PARTICLE SYSTEM EXPLOSIONS */
.particle-explosion {
    position: relative;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: radial-gradient(circle, #00bfff, #87ceeb);
    border-radius: 50%;
    animation: particleExplode 2s infinite;
    opacity: 0;
}

.particle:nth-child(1) { left: 50%; top: 50%; animation-delay: 0s; --angle: 0deg; --distance: 50px; }
.particle:nth-child(2) { left: 50%; top: 50%; animation-delay: 0.1s; --angle: 45deg; --distance: 70px; }
.particle:nth-child(3) { left: 50%; top: 50%; animation-delay: 0.2s; --angle: 90deg; --distance: 60px; }
.particle:nth-child(4) { left: 50%; top: 50%; animation-delay: 0.3s; --angle: 135deg; --distance: 80px; }
.particle:nth-child(5) { left: 50%; top: 50%; animation-delay: 0.4s; --angle: 180deg; --distance: 55px; }
.particle:nth-child(6) { left: 50%; top: 50%; animation-delay: 0.5s; --angle: 225deg; --distance: 75px; }
.particle:nth-child(7) { left: 50%; top: 50%; animation-delay: 0.6s; --angle: 270deg; --distance: 65px; }
.particle:nth-child(8) { left: 50%; top: 50%; animation-delay: 0.7s; --angle: 315deg; --distance: 70px; }

@keyframes particleExplode {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
    }
    25% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(
            calc(-50% + var(--distance) * cos(var(--angle))),
            calc(-50% + var(--distance) * sin(var(--angle)))
        ) scale(0.5);
    }
}

/* 🌌 GRAVITY WELLS */
.gravity-well {
    position: relative;
    width: 250px;
    height: 250px;
    margin: 0 auto;
    background: radial-gradient(circle at center, rgba(0, 191, 255, 0.1), transparent 70%);
    border-radius: 50%;
    overflow: visible;
}

.gravity-object {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #87ceeb;
    border-radius: 50%;
    animation: gravityOrbit 6s linear infinite;
    transform-origin: 125px 125px;
}

.gravity-object:nth-child(1) {
    top: 20px;
    left: 125px;
    animation-duration: 4s;
}

.gravity-object:nth-child(2) {
    top: 60px;
    left: 125px;
    animation-duration: 6s;
    animation-delay: -2s;
}

.gravity-object:nth-child(3) {
    top: 100px;
    left: 125px;
    animation-duration: 8s;
    animation-delay: -4s;
}

@keyframes gravityOrbit {
    0% { transform: rotate(0deg) translateX(105px) rotate(0deg); }
    100% { transform: rotate(360deg) translateX(105px) rotate(-360deg); }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .quantum-field,
    .dna-helix,
    .holographic,
    .magnetic-field,
    .neural-network,
    .wormhole,
    .particle-explosion,
    .gravity-well {
        transform: scale(0.8);
    }
    
    .quantum-particles,
    .neural-node,
    .particle {
        width: 3px;
        height: 3px;
    }
}

/* Performance Optimizations */
@media (prefers-reduced-motion: reduce) {
    .quantum-field,
    .dna-helix,
    .holographic,
    .magnetic-field,
    .neural-network,
    .wormhole,
    .particle-explosion,
    .gravity-well {
        animation: none;
    }
    
    .quantum-particles,
    .dna-strand,
    .dna-base,
    .field-line,
    .neural-node,
    .neural-connection,
    .wormhole-ring,
    .particle,
    .gravity-object {
        animation: none;
    }
}