/* ==========================================================================
   MAGNETIC SPACE BACKGROUND
   Fondo interactivo de polvo estelar diamagnético y nebulosas de gas.
   ========================================================================== */

#magnetic-space-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -100; /* Asegurar que quede por detrás de todo */
    background-color: #010005;
    overflow: hidden;
    pointer-events: none; /* No bloquear clics */
}

#magnetic-space-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.realistic-nebula {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    /* El gradiente usa variables CSS inyectadas por JS según la industria */
    background: linear-gradient(135deg, 
        rgba(10, 5, 20, 0) 0%, 
        var(--nebula-c1, rgba(40, 20, 80, 0.4)) 20%, 
        var(--nebula-c2, rgba(140, 60, 150, 0.35)) 40%, 
        var(--nebula-c3, rgba(30, 80, 180, 0.4)) 60%, 
        var(--nebula-c4, rgba(70, 20, 100, 0.3)) 80%, 
        rgba(10, 5, 20, 0) 100%);
    filter: url(#space-noise) blur(10px);
    z-index: 1;
    opacity: 0.7;
    pointer-events: none;
    will-change: transform;
    animation: driftGas 60s infinite linear alternate;
}

@keyframes driftGas {
    0% { transform: translate(0%, 0%) rotate(0deg) scale(1); }
    50% { transform: translate(10%, -10%) rotate(2deg) scale(1.1); }
    100% { transform: translate(-10%, 10%) rotate(-2deg) scale(1); }
}
