/**
 * Cosmic Inspiration Background Animation
 * AppWT LLC - Elite Visual Enhancement
 *
 * Features:
 * - Shooting stars/meteors
 * - Subtle particle field
 * - Gold accent glows
 * - Accessibility: respects prefers-reduced-motion
 * - Performance: CSS-only, hardware accelerated
 */

/* Cosmic Background Container */
.cosmic-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(ellipse at center, #0d1117 0%, #0A0A0A 50%, #000000 100%);
}

/* Subtle star field base - Enhanced with purple/silver */
.cosmic-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(1px 1px at 20% 30%, rgba(255, 255, 255, 0.3) 0%, transparent 100%),
        radial-gradient(1px 1px at 40% 70%, rgba(212, 175, 55, 0.2) 0%, transparent 100%),
        radial-gradient(1px 1px at 50% 50%, rgba(139, 92, 246, 0.25) 0%, transparent 100%),
        radial-gradient(1px 1px at 60% 20%, rgba(192, 192, 192, 0.2) 0%, transparent 100%),
        radial-gradient(1px 1px at 80% 90%, rgba(255, 255, 255, 0.25) 0%, transparent 100%),
        radial-gradient(1px 1px at 10% 80%, rgba(139, 92, 246, 0.2) 0%, transparent 100%),
        radial-gradient(1px 1px at 90% 40%, rgba(192, 192, 192, 0.25) 0%, transparent 100%),
        radial-gradient(1px 1px at 30% 10%, rgba(212, 175, 55, 0.15) 0%, transparent 100%),
        radial-gradient(1px 1px at 70% 60%, rgba(139, 92, 246, 0.3) 0%, transparent 100%),
        radial-gradient(1px 1px at 15% 45%, rgba(212, 175, 55, 0.2) 0%, transparent 100%),
        radial-gradient(1px 1px at 85% 15%, rgba(192, 192, 192, 0.3) 0%, transparent 100%),
        radial-gradient(1px 1px at 45% 85%, rgba(139, 92, 246, 0.2) 0%, transparent 100%);
    background-size: 100% 100%;
    animation: starTwinkle 8s ease-in-out infinite;
}

/* Shooting Stars Container */
.shooting-stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Individual Shooting Star */
.shooting-star {
    position: absolute;
    width: 150px;
    height: 2px;
    background: linear-gradient(90deg, rgba(212, 175, 55, 0) 0%, rgba(212, 175, 55, 0.8) 50%, rgba(255, 255, 255, 1) 100%);
    border-radius: 100%;
    transform: rotate(-45deg);
    animation: shootingStar 3s ease-in-out infinite;
    opacity: 0;
}

/* Purple shooting star variant */
.shooting-star-purple {
    position: absolute;
    width: 140px;
    height: 2px;
    background: linear-gradient(90deg, rgba(139, 92, 246, 0) 0%, rgba(139, 92, 246, 0.8) 50%, rgba(192, 192, 192, 1) 100%);
    border-radius: 100%;
    transform: rotate(-45deg);
    animation: shootingStar 3.5s ease-in-out infinite;
    opacity: 0;
}

.shooting-star-purple:nth-child(1) {
    top: 30%;
    left: 55%;
    animation-delay: 2s;
}

.shooting-star-purple:nth-child(2) {
    top: 12%;
    left: 85%;
    animation-delay: 5s;
    width: 110px;
}

.shooting-star-purple:nth-child(3) {
    top: 55%;
    left: 70%;
    animation-delay: 8s;
    width: 120px;
}

/* Shooting Star Variations */
.shooting-star:nth-child(1) {
    top: 10%;
    left: 80%;
    animation-delay: 0s;
    animation-duration: 3s;
}

.shooting-star:nth-child(2) {
    top: 25%;
    left: 60%;
    animation-delay: 1.5s;
    animation-duration: 2.5s;
    width: 100px;
}

.shooting-star:nth-child(3) {
    top: 5%;
    left: 40%;
    animation-delay: 3s;
    animation-duration: 3.5s;
    width: 120px;
}

.shooting-star:nth-child(4) {
    top: 40%;
    left: 90%;
    animation-delay: 4.5s;
    animation-duration: 2.8s;
    width: 80px;
}

.shooting-star:nth-child(5) {
    top: 15%;
    left: 70%;
    animation-delay: 6s;
    animation-duration: 3.2s;
}

.shooting-star:nth-child(6) {
    top: 35%;
    left: 50%;
    animation-delay: 7.5s;
    animation-duration: 2.6s;
    width: 90px;
}

.shooting-star:nth-child(7) {
    top: 8%;
    left: 95%;
    animation-delay: 9s;
    animation-duration: 3.4s;
    width: 130px;
}

.shooting-star:nth-child(8) {
    top: 50%;
    left: 75%;
    animation-delay: 10.5s;
    animation-duration: 2.9s;
    width: 110px;
}

/* Rocket Trail - Larger, more prominent */
.rocket-trail {
    position: absolute;
    width: 200px;
    height: 3px;
    background: linear-gradient(90deg,
        rgba(212, 175, 55, 0) 0%,
        rgba(212, 175, 55, 0.6) 30%,
        rgba(255, 215, 0, 0.9) 70%,
        rgba(255, 255, 255, 1) 100%);
    border-radius: 100%;
    transform: rotate(-35deg);
    animation: rocketTrail 8s ease-in-out infinite;
    opacity: 0;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5), 0 0 20px rgba(212, 175, 55, 0.3);
}

.rocket-trail:nth-child(1) {
    top: 20%;
    left: 85%;
    animation-delay: 2s;
}

.rocket-trail:nth-child(2) {
    top: 45%;
    left: 95%;
    animation-delay: 6s;
    animation-duration: 9s;
}

.rocket-trail:nth-child(3) {
    top: 10%;
    left: 65%;
    animation-delay: 10s;
    animation-duration: 7s;
}

/* Floating Particles */
.cosmic-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(212, 175, 55, 0.6);
    border-radius: 50%;
    animation: floatParticle 15s ease-in-out infinite;
}

.particle:nth-child(1) { top: 20%; left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { top: 60%; left: 20%; animation-delay: 2s; }
.particle:nth-child(3) { top: 30%; left: 80%; animation-delay: 4s; }
.particle:nth-child(4) { top: 70%; left: 60%; animation-delay: 6s; }
.particle:nth-child(5) { top: 40%; left: 40%; animation-delay: 8s; }
.particle:nth-child(6) { top: 80%; left: 90%; animation-delay: 10s; }
.particle:nth-child(7) { top: 15%; left: 50%; animation-delay: 12s; }
.particle:nth-child(8) { top: 55%; left: 75%; animation-delay: 3s; }
.particle:nth-child(9) { top: 85%; left: 30%; animation-delay: 7s; }
.particle:nth-child(10) { top: 45%; left: 95%; animation-delay: 11s; }

/* Ambient Gold Glow Orbs */
.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    animation: glowPulse 10s ease-in-out infinite;
    opacity: 0.15;
}

.glow-orb:nth-child(1) {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.4) 0%, transparent 70%);
    top: 10%;
    left: -5%;
    animation-delay: 0s;
}

.glow-orb:nth-child(2) {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.3) 0%, transparent 70%);
    top: 60%;
    right: -5%;
    animation-delay: 5s;
}

.glow-orb:nth-child(3) {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.35) 0%, transparent 70%);
    bottom: 10%;
    left: 30%;
    animation-delay: 2.5s;
}

/* Purple/Silver Glow Orbs - Enhanced palette */
.glow-orb:nth-child(4) {
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, transparent 70%);
    top: 40%;
    left: 70%;
    animation-delay: 3.5s;
}

.glow-orb:nth-child(5) {
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(192, 192, 192, 0.25) 0%, transparent 70%);
    top: 75%;
    left: 10%;
    animation-delay: 7s;
}

.glow-orb:nth-child(6) {
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.35) 0%, transparent 70%);
    top: 5%;
    right: 20%;
    animation-delay: 4s;
}

/* Animations */
@keyframes starTwinkle {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@keyframes shootingStar {
    0% {
        opacity: 0;
        transform: rotate(-45deg) translateX(0);
    }
    10% {
        opacity: 1;
    }
    70% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: rotate(-45deg) translateX(-500px);
    }
}

@keyframes rocketTrail {
    0% {
        opacity: 0;
        transform: rotate(-35deg) translateX(0);
    }
    5% {
        opacity: 0.8;
    }
    60% {
        opacity: 0.6;
    }
    100% {
        opacity: 0;
        transform: rotate(-35deg) translateX(-800px);
    }
}

@keyframes floatParticle {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0.3;
    }
    25% {
        transform: translateY(-20px) translateX(10px);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-10px) translateX(-5px);
        opacity: 0.5;
    }
    75% {
        transform: translateY(-30px) translateX(15px);
        opacity: 0.9;
    }
}

@keyframes glowPulse {
    0%, 100% {
        opacity: 0.1;
        transform: scale(1);
    }
    50% {
        opacity: 0.2;
        transform: scale(1.1);
    }
}

/* Accessibility: Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .shooting-star,
    .rocket-trail,
    .particle,
    .glow-orb,
    .cosmic-bg::before {
        animation: none;
        opacity: 0.5;
    }

    .shooting-star,
    .rocket-trail {
        display: none;
    }
}

/* Performance: Reduce animations on mobile for battery */
@media (max-width: 768px) {
    .shooting-star:nth-child(n+5),
    .particle:nth-child(n+6),
    .rocket-trail:nth-child(n+2) {
        display: none;
    }

    .glow-orb {
        filter: blur(40px);
        opacity: 0.1;
    }
}

/* Ensure content stays above cosmic background */
.main-header,
.page-content,
main,
.main-content,
footer,
.footer-section,
.trust-badges-section,
.trust-badges-container,
.badges-section,
.badge-container,
.expert-showcase,
.reviews-ticker,
.location-weather,
.weather-widget,
.developed-by-appwt-llc-badges-row,
.developed-by-appwt-llc-badge-item,
.developed-by-appwt-llc-bbb-badge-custom,
.developed-by-appwt-llc-google-badge,
.developed-by-appwt-llc-responsive-container,
.developed-by-appwt-llc-hero-section,
.verification-banner,
.rotating-awards-badge {
    position: relative;
    z-index: 1;
}
