/* Particle Background Styles */
#particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: radial-gradient(ellipse at top, 
        hsla(var(--primary-color), 0.1) 0%, 
        hsla(var(--secondary-color), 0.05) 25%, 
        hsl(var(--background-darker)) 50%);
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    animation: float linear infinite;
}

/* Particle Types */
.particle.type-1 {
    background: hsl(var(--primary-color));
    box-shadow: 0 0 10px hsla(var(--primary-color), 0.5);
}

.particle.type-2 {
    background: hsl(var(--secondary-color));
    box-shadow: 0 0 10px hsla(var(--secondary-color), 0.5);
}

.particle.type-3 {
    background: hsl(var(--accent-color));
    box-shadow: 0 0 10px hsla(var(--accent-color), 0.5);
}

.particle.type-4 {
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

/* Particle Animations */
@keyframes float {
    0% {
        transform: translateY(100vh) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) translateX(var(--drift)) rotate(360deg);
        opacity: 0;
    }
}

/* Particle Size Variants */
.particle.small {
    width: 2px;
    height: 2px;
}

.particle.medium {
    width: 4px;
    height: 4px;
}

.particle.large {
    width: 6px;
    height: 6px;
}

/* Glowing Effect */
.particle.glow {
    filter: blur(0.5px);
    animation: float linear infinite, pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Shooting Stars */
.shooting-star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    animation: shoot 4s linear infinite;
}

@keyframes shoot {
    0% {
        transform: translateX(-100px) translateY(-100px);
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    95% {
        opacity: 1;
    }
    100% {
        transform: translateX(100vw) translateY(100vh);
        opacity: 0;
    }
}

.shooting-star::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50px;
    height: 1px;
    background: linear-gradient(90deg, white, transparent);
    transform: translateX(-50px);
}

/* Constellation Effect */
.constellation {
    position: absolute;
    width: 1px;
    height: 1px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: twinkle 2s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.5);
    }
}

/* Performance Optimizations */
.particle,
.shooting-star,
.constellation {
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .particle,
    .shooting-star,
    .constellation {
        animation-duration: 10s;
        animation-timing-function: ease-in-out;
    }
    
    .particle.glow {
        animation: none;
        opacity: 0.3;
    }
}

/* High Performance Mode */
@media (max-width: 768px) {
    .particle.large,
    .particle.glow {
        display: none;
    }
    
    .shooting-star {
        animation-duration: 6s;
    }
}

/* Dark Mode Enhancements */
@media (prefers-color-scheme: dark) {
    #particles-container {
        background: radial-gradient(ellipse at top, 
            hsla(var(--primary-color), 0.15) 0%, 
            hsla(var(--secondary-color), 0.08) 25%, 
            hsl(var(--background-darker)) 50%);
    }
}
