/* Starry Sky Background Effect */
.background-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

/* Base star styles */
.star {
    position: absolute;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, rgba(197, 134, 255, 0.6) 40%, transparent 70%);
    border-radius: 50%;
    opacity: 0;
    animation: star-twinkle 4s infinite ease-in-out;
}

/* Bright stars */
.star-bright {
    background: radial-gradient(circle, rgba(255, 255, 255, 1) 0%, rgba(197, 134, 255, 0.8) 30%, rgba(157, 91, 204, 0.4) 60%, transparent 80%);
    box-shadow: 
        0 0 8px rgba(255, 255, 255, 0.6),
        0 0 16px rgba(197, 134, 255, 0.3),
        0 0 24px rgba(197, 134, 255, 0.1);
    animation: star-twinkle 3s infinite ease-in-out, star-pulse 6s infinite ease-in-out;
}

/* Dim stars */
.star-dim {
    background: radial-gradient(circle, rgba(197, 134, 255, 0.7) 0%, rgba(138, 107, 184, 0.4) 50%, transparent 70%);
    opacity: 0.6;
    animation: star-twinkle 5s infinite ease-in-out;
}

/* Distant stars */
.star-distant {
    background: radial-gradient(circle, rgba(197, 134, 255, 0.4) 0%, rgba(138, 107, 184, 0.2) 60%, transparent 80%);
    opacity: 0.3;
    animation: star-twinkle 7s infinite ease-in-out;
}

/* Twinkling animations */
@keyframes star-twinkle {
    0%, 100% {
        opacity: 0.2;
        transform: scale(0.8);
    }
    25% {
        opacity: 0.8;
        transform: scale(1);
    }
    50% {
        opacity: 0.4;
        transform: scale(0.9);
    }
    75% {
        opacity: 1;
        transform: scale(1.1);
    }
}

@keyframes star-pulse {
    0%, 100% {
        box-shadow: 
            0 0 8px rgba(255, 255, 255, 0.6),
            0 0 16px rgba(197, 134, 255, 0.3),
            0 0 24px rgba(197, 134, 255, 0.1);
    }
    50% {
        box-shadow: 
            0 0 12px rgba(255, 255, 255, 0.8),
            0 0 24px rgba(197, 134, 255, 0.5),
            0 0 36px rgba(197, 134, 255, 0.2);
    }
}

/* Constellation lines (subtle connecting lines between some stars) */
.constellation-line {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(197, 134, 255, 0.1) 20%, 
        rgba(197, 134, 255, 0.2) 50%, 
        rgba(197, 134, 255, 0.1) 80%, 
        transparent 100%);
    transform-origin: left center;
    opacity: 0;
    animation: constellation-fade 8s infinite ease-in-out;
}

@keyframes constellation-fade {
    0%, 100% {
        opacity: 0;
    }
    25%, 75% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.6;
    }
}

/* Shooting stars (occasional) */
.shooting-star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: linear-gradient(45deg, rgba(255, 255, 255, 1), rgba(197, 134, 255, 0.8));
    border-radius: 50%;
    opacity: 0;
    animation: shooting-star 3s ease-out;
}

.shooting-star::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50px;
    height: 1px;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.8) 0%, 
        rgba(197, 134, 255, 0.6) 30%, 
        transparent 100%);
    transform: translateX(-50px) skew(-45deg);
}

@keyframes shooting-star {
    0% {
        opacity: 0;
        transform: translateX(-100px) translateY(-50px);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateX(200px) translateY(100px);
    }
}

/* Nebula clusters (very subtle background glow areas) */
.nebula-cluster {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, 
        rgba(197, 134, 255, 0.03) 0%, 
        rgba(157, 91, 204, 0.02) 40%, 
        transparent 70%);
    opacity: 0;
    animation: nebula-glow 12s infinite ease-in-out;
}

@keyframes nebula-glow {
    0%, 100% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.2);
    }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .star-bright {
        box-shadow: 
            0 0 4px rgba(255, 255, 255, 0.4),
            0 0 8px rgba(197, 134, 255, 0.2);
    }
    
    .constellation-line,
    .shooting-star,
    .nebula-cluster {
        display: none; /* Simplify on mobile for performance */
    }
    
    .star {
        animation-duration: 6s; /* Slower animations on mobile */
    }
}