/* 🔹 Fondo difuminado */
.blur-background {
    position: fixed; /* Fija el fondo en toda la pantalla */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.01); /* Ajusta opacidad */
    backdrop-filter: blur(5px); /* Aplica el desenfoque */
    z-index: 2; /* Lo mantiene en el fondo */
}

.star-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 1; /* Está sobre el fondo pero debajo del contenido */
    pointer-events: none; /* Evita interferencia con el contenido */
}

.star {
    position: absolute;
    color: gold;
    font-size: 1.5rem; /* Tamaño de la estrella */
    opacity: 0;
    animation: starFlight linear infinite;
    transform: translateX(-100%);
    z-index: -1;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.8));
    visibility: visible;
}

.star::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -150px; /* Asegura que el haz esté detrás */
    width: 150px; /* Longitud del haz de luz */
    height: 10px; /* Grosor del haz de luz */
    background: linear-gradient(to right, rgba(255, 215, 0, 0) 0%, rgba(255, 215, 0, 1) 100%);
    transform: translateY(-50%) rotate(0deg); /* Mantiene el haz horizontal */
    opacity: 1;
    animation: tailGlow linear infinite;
    z-index: -1; /* Detrás de la estrella */
    filter: blur(8px); /* Suavizar bordes */
}

/* Clase que desactiva la animación */
.stars-disabled .star {
    animation: none !important;
    visibility: visible !important;
}

@keyframes starFlight {
    0% {
        transform: translateX(-20%);
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateX(120vw);
        opacity: 0;
    }
}

@keyframes tailGlow {
    0% {
        opacity: 0;
        transform: translateY(-50%) scaleX(0);
    }
    20% {
        opacity: 1;
        transform: translateY(-50%) scaleX(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-50%) scaleX(0.2);
    }
}



/* Optimizaciones */
.star {
    will-change: transform, opacity;
}

/* Tema claro */
.light-theme .star {
    color: #2F4F4F;
    filter: drop-shadow(0 0 15px rgba(47, 79, 79, 0.8));
}

.light-theme .star::before {
    background: radial-gradient(
        ellipse at left,
        rgba(47, 79, 79, 0.9) 20%,
        rgba(47, 79, 79, 0.5) 50%,
        transparent 80%
    );
}