/* Enhanced Particle Effects CSS */

/* Base particle container */
.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

/* Individual particle styling */
.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
}

/* Floating particles effect */
.floating-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

/* Gradient orbs */
.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
    z-index: -1;
    pointer-events: none;
    will-change: transform;
    transition: transform 0.7s ease-out;
    mix-blend-mode: screen;
}

.gradient-orb.primary {
    background: radial-gradient(circle, rgba(0, 122, 255, 0.7) 0%, rgba(0, 122, 255, 0) 70%);
    animation: orbPulse 8s ease-in-out infinite alternate;
}

.gradient-orb.secondary {
    background: radial-gradient(circle, rgba(255, 45, 85, 0.5) 0%, rgba(255, 45, 85, 0) 70%);
    animation: orbPulse 12s ease-in-out infinite alternate-reverse;
}

.gradient-orb.tertiary {
    background: radial-gradient(circle, rgba(88, 86, 214, 0.5) 0%, rgba(88, 86, 214, 0) 70%);
    animation: orbPulse 10s ease-in-out infinite alternate;
}

@keyframes orbPulse {
    0% {
        transform: scale(1) translate(0, 0);
        opacity: 0.5;
        filter: blur(60px);
    }
    50% {
        transform: scale(1.1) translate(20px, -10px);
        opacity: 0.7;
        filter: blur(70px);
    }
    100% {
        transform: scale(0.9) translate(-20px, 10px);
        opacity: 0.4;
        filter: blur(50px);
    }
}

/* Animated background gradient */
.animated-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, 
        rgba(0, 122, 255, 0.1), 
        rgba(88, 86, 214, 0.1), 
        rgba(255, 45, 85, 0.1), 
        rgba(0, 122, 255, 0.1));
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite;
    z-index: -2;
    mix-blend-mode: overlay;
}

@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Shooting stars effect */
.shooting-star {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0));
    border-radius: 100px;
    filter: drop-shadow(0 0 6px rgba(105, 155, 255, 1));
    animation: shootingStarAnimation 3s ease-in infinite;
    opacity: 0;
    z-index: 0;
    pointer-events: none;
    transform-origin: left center;
}

@keyframes shootingStarAnimation {
    0% {
        transform: translateX(0) translateY(0) scale(0.5);
        opacity: 0;
    }
    10% {
        opacity: 1;
        transform: translateX(30px) translateY(30px) scale(1);
    }
    70% {
        opacity: 1;
        transform: translateX(270px) translateY(270px) scale(1);
    }
    100% {
        transform: translateX(300px) translateY(300px) scale(0.1);
        opacity: 0;
    }
}

/* Enhanced floating particles */
.floating-particle {
    position: absolute;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    animation: floatingAnimation 20s ease-in-out infinite;
    opacity: 0.5;
    pointer-events: none;
}

@keyframes floatingAnimation {
    0% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(20px, -30px) scale(1.2);
    }
    50% {
        transform: translate(40px, 0) scale(0.8);
    }
    75% {
        transform: translate(-20px, 30px) scale(1.1);
    }
    100% {
        transform: translate(0, 0) scale(1);
    }
}

/* Interactive particles that follow mouse/cursor */
.interactive-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.cursor-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
    animation: fadeOut 1s ease-out forwards;
}

@keyframes fadeOut {
    0% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(0.2);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Glow effect for elements */
.glow-effect {
    position: relative;
    overflow: hidden;
}

.glow-effect::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 122, 255, 0.2) 0%, rgba(0, 122, 255, 0) 70%);
    transform: rotate(0deg);
    animation: glowRotate 15s linear infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes glowRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Nebula effect for backgrounds */
.nebula-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiPgogIDxmaWx0ZXIgaWQ9Im5vaXNlIj4KICAgIDxmZVR1cmJ1bGVuY2UgdHlwZT0iZnJhY3RhbE5vaXNlIiBiYXNlRnJlcXVlbmN5PSIwLjY1IiBudW1PY3RhdmVzPSIzIiBzdGl0Y2hUaWxlcz0ic3RpdGNoIj48L2ZlVHVyYnVsZW5jZT4KICAgIDxmZUNvbG9yTWF0cml4IHR5cGU9InNhdHVyYXRlIiB2YWx1ZXM9IjAiPjwvZmVDb2xvck1hdHJpeD4KICA8L2ZpbHRlcj4KICA8cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWx0ZXI9InVybCgjbm9pc2UpIiBvcGFjaXR5PSIwLjA1Ij48L3JlY3Q+Cjwvc3ZnPg==');
    opacity: 0.3;
    z-index: -1;
    pointer-events: none;
    mix-blend-mode: screen;
}

/* Dust particles */
.dust-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.dust {
    position: absolute;
    width: 1px;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: dustFloat 60s linear infinite;
    opacity: 0;
}

@keyframes dustFloat {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.2;
    }
    90% {
        opacity: 0.2;
    }
    100% {
        transform: translateY(-100vh) translateX(20px);
        opacity: 0;
    }
}

/* Performance considerations */
@media (prefers-reduced-motion: reduce) {
    .gradient-orb {
        transition: none;
        animation: none;
    }
    .animated-gradient {
        animation: none;
    }
    .shooting-star {
        display: none;
    }
    .floating-particle {
        animation: none;
    }
    .cursor-particle {
        display: none;
    }
    .glow-effect::before {
        animation: none;
    }
}

.performance-low .gradient-orb,
.performance-low .animated-gradient,
.performance-low .shooting-star,
.performance-low .nebula-effect,
.performance-low .dust-particles {
    display: none;
}

.performance-low .floating-particle {
    animation: none;
    opacity: 0.3;
}

.performance-medium .gradient-orb {
    filter: blur(30px);
    animation-duration: 20s;
}

.performance-medium .shooting-star {
    animation-duration: 5s;
}

.performance-medium .floating-particle {
    animation-duration: 30s;
}