/* Firefly Animation Styles */

/* Base styles for firefly container */
.firefly-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Ensure it stays in the background */
    overflow: hidden;
    background-color: #000;
}

/* Base styles for a single firefly */
.firefly {
    position: absolute;
    pointer-events: none; /* Allows clicks to pass through */
    border-radius: 50%;
    /* Default values, overridden by JS for randomization */
    width: 0.4vw;
    height: 0.4vw;
    will-change: transform, opacity; /* Optimize for animation */
}

/* Pseudo-elements for the firefly body and glow */
.firefly::before,
.firefly::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transform-origin: -10vw; /* Pivot point for rotation */
    will-change: transform, opacity, box-shadow; /* Optimize for animation */
}

.firefly::before {
    background: black;
    opacity: 0.2;
    animation: drift ease alternate infinite;
}

.firefly::after {
    background: white;
    opacity: 0;
    box-shadow: 0 0 var(--firefly-shadow-blur-off, 0vw) 0vw var(--firefly-glow-color, yellow);
    animation: drift ease alternate infinite;
}

/* Keyframe animations */
@keyframes drift {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Performance optimization - reduce motion for users who prefer it */
@media (prefers-reduced-motion) {
    .firefly,
    .firefly::before,
    .firefly::after {
        animation: none !important;
    }
}
