/**
 * Animations CSS
 * All animations and keyframes for AsteroidWP theme
 *
 * @package AsteroidWP
 */

/* Asteroid Animation */
.asteroid-animation {
    position: relative;
    width: 300px;
    height: 300px;
}

.asteroid {
    width: 80px;
    height: 80px;
    background: linear-gradient(45deg, var(--orange-primary), var(--orange-accent));
    border-radius: 50% 40% 60% 30%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: asteroidFloat 4s ease-in-out infinite;
    box-shadow: 0 0 30px rgba(255, 107, 53, 0.5);
}

.trail {
    position: absolute;
    top: 50%;
    left: 0;
    width: 200px;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--orange-primary), transparent);
    transform: translateY(-50%);
    animation: trailPulse 2s ease-in-out infinite;
}

.stars {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(2px 2px at 20% 30%, #FFF, transparent),
        radial-gradient(1px 1px at 80% 20%, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(1px 1px at 60% 70%, rgba(255, 255, 255, 0.6), transparent);
    animation: starsTwinkle 3s ease-in-out infinite;
}

/* Mini Asteroids for Plugin Section */
.floating-asteroids {
    position: relative;
    width: 150px;
    height: 150px;
}

.mini-asteroid {
    position: absolute;
    width: 20px;
    height: 20px;
    background: linear-gradient(45deg, var(--orange-primary), var(--orange-accent));
    border-radius: 50% 40% 60% 30%;
    animation: floatAsteroid 3s ease-in-out infinite;
}

.mini-asteroid:nth-child(1) {
    top: 20%;
    left: 30%;
    animation-delay: 0s;
}

.mini-asteroid:nth-child(2) {
    top: 60%;
    left: 60%;
    animation-delay: 1s;
}

.mini-asteroid:nth-child(3) {
    top: 40%;
    left: 10%;
    animation-delay: 2s;
}

/* Atmosphere Entry Animation */
.atmosphere-entry {
    position: relative;
    width: 100%;
    height: 100%;
}

.entering-asteroid {
    position: absolute;
    top: 20%;
    right: 20%;
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, var(--orange-primary), var(--orange-accent));
    border-radius: 50% 40% 60% 30%;
    animation: enterAtmosphere 6s ease-in-out infinite;
    box-shadow: 0 0 40px rgba(255, 107, 53, 0.7);
}

/* Meteor Effect */
.meteor {
    position: fixed;
    width: 4px;
    height: 4px;
    background: linear-gradient(45deg, var(--orange-primary), var(--orange-accent));
    border-radius: 50%;
    animation: meteorShower 8s linear infinite;
    pointer-events: none;
    z-index: 0;
}

/* Keyframe Animations */
@keyframes asteroidFloat {
    0%, 100% {
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
        box-shadow: 0 0 30px rgba(255, 107, 53, 0.5);
    }
    25% {
        transform: translate(-45%, -55%) rotate(45deg) scale(1.05);
        box-shadow: 0 0 40px rgba(255, 107, 53, 0.7);
    }
    50% {
        transform: translate(-50%, -60%) rotate(180deg) scale(1.1);
        box-shadow: 0 0 50px rgba(255, 107, 53, 0.9);
    }
    75% {
        transform: translate(-55%, -55%) rotate(225deg) scale(1.05);
        box-shadow: 0 0 40px rgba(255, 107, 53, 0.7);
    }
}

@keyframes trailPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

@keyframes starsTwinkle {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

@keyframes floatAsteroid {
    0%, 100% {
        transform: translateY(0px) rotate(0deg) scale(1);
        opacity: 0.8;
    }
    33% {
        transform: translateY(-15px) rotate(60deg) scale(1.2);
        opacity: 1;
    }
    66% {
        transform: translateY(-25px) rotate(120deg) scale(0.9);
        opacity: 0.9;
    }
}

@keyframes enterAtmosphere {
    0% { 
        transform: translate(100px, -100px) rotate(0deg) scale(0.5); 
        opacity: 0; 
    }
    50% { 
        transform: translate(0, 0) rotate(180deg) scale(1); 
        opacity: 1; 
    }
    100% { 
        transform: translate(-100px, 100px) rotate(360deg) scale(0.8); 
        opacity: 0.7; 
    }
}

@keyframes meteorShower {
    0% {
        transform: translateX(-100px) translateY(-100px) rotate(45deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateX(calc(100vw + 100px)) translateY(calc(100vh + 100px)) rotate(45deg);
        opacity: 0;
    }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 107, 53, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 107, 53, 0.8), 0 0 60px rgba(255, 167, 38, 0.4);
    }
}

@keyframes floatUp {
    0% {
        transform: translateY(100px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInFromLeft {
    0% {
        transform: translateX(-100px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromRight {
    0% {
        transform: translateX(100px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes scaleIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes twinkle {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

@keyframes particleFade {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.5) translateY(-50px);
    }
}

/* Animation Classes */
.animate-in {
    animation: fadeInUp 0.8s ease forwards;
}

.service-card {
    animation: pulseGlow 4s ease-in-out infinite;
}

.hero-text {
    animation: slideInFromLeft 1s ease-out;
}

.hero-visual {
    animation: slideInFromRight 1s ease-out 0.3s both;
}

.section-title {
    animation: floatUp 0.8s ease-out;
}

/* Twinkling Star */
.twinkling-star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s ease-in-out infinite;
}

/* Particle Animation */
.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    pointer-events: none;
    animation: particleFade 1s ease-out forwards;
}
