/* Fun Animations for Space Alphabet Adventure */

/* Bounce In Animation */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.bounce-in {
    animation: bounceIn 0.6s ease-out;
}

/* Shake Animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.pulse {
    animation: pulse 1s ease-in-out infinite;
}

/* Wiggle Animation (for encouragement) */
@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

.wiggle {
    animation: wiggle 0.5s ease-in-out 3;
}

/* Float Animation */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.float {
    animation: float 3s ease-in-out infinite;
}

/* Rocket Launch Animation */
@keyframes rocketLaunch {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-1000px) rotate(15deg);
        opacity: 0;
    }
}

.rocket-launch {
    animation: rocketLaunch 1.5s ease-in forwards;
}

/* Star Burst Animation */
@keyframes starBurst {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.5) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: scale(0.5) rotate(360deg);
        opacity: 0;
    }
}

.star-burst {
    animation: starBurst 0.8s ease-out;
}

/* Confetti Fall Animation */
@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confettiFall 3s ease-in-out;
    z-index: 9999;
}

/* Glow Pulse Animation */
@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 215, 61, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 215, 61, 0.8),
                    0 0 60px rgba(255, 215, 61, 0.6);
    }
}

.glow-pulse {
    animation: glowPulse 2s ease-in-out infinite;
}

/* Progress Bar Fill Animation */
@keyframes fillBar {
    from { width: 0%; }
    to { width: 100%; }
}

.fill-bar {
    animation: fillBar 2s ease-out;
}

/* Letter Flip Animation */
@keyframes letterFlip {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(180deg); }
    100% { transform: rotateY(360deg); }
}

.letter-flip {
    animation: letterFlip 0.8s ease-in-out;
}

/* Pop In Animation */
@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0) translateY(50px);
    }
    80% {
        transform: scale(1.2) translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.pop-in {
    animation: popIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Slide In From Left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

/* Slide In From Right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

/* Fade In */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/* Zoom In */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.zoom-in {
    animation: zoomIn 0.4s ease-out;
}

/* Success Celebration */
@keyframes successCelebration {
    0% { transform: scale(1); }
    10% { transform: scale(1.1) rotate(-5deg); }
    20% { transform: scale(1.1) rotate(5deg); }
    30% { transform: scale(1.1) rotate(-5deg); }
    40% { transform: scale(1.1) rotate(5deg); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.success-celebration {
    animation: successCelebration 0.8s ease-in-out;
}

/* Badge Unlock Animation */
@keyframes badgeUnlock {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }
    60% {
        transform: scale(1.3) rotate(20deg);
    }
    80% {
        transform: scale(0.9) rotate(-10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.badge-unlock {
    animation: badgeUnlock 1s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Camera Scanning Animation */
@keyframes cameraScan {
    0%, 100% {
        border-color: rgba(78, 205, 196, 0.3);
        box-shadow: 0 0 10px rgba(78, 205, 196, 0.3);
    }
    50% {
        border-color: rgba(78, 205, 196, 1);
        box-shadow: 0 0 30px rgba(78, 205, 196, 0.6);
    }
}

.camera-scanning {
    animation: cameraScan 1.5s ease-in-out infinite;
}

/* Hold Progress Animation */
@keyframes holdProgress {
    from {
        width: 0%;
        opacity: 0.7;
    }
    to {
        width: 100%;
        opacity: 1;
    }
}

.hold-progress {
    animation: holdProgress 2s linear;
}

/* Delayed Animations (for staggered effects) */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-10px) scale(1.05);
}

.hover-glow {
    transition: all 0.3s ease;
}

.hover-glow:hover {
    filter: brightness(1.2);
    box-shadow: 0 0 30px rgba(255, 215, 61, 0.6);
}

/* Particle Background Effect */
.particles {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 10s ease-in-out infinite;
}

@keyframes particleFloat {
    0%, 100% {
        opacity: 0;
        transform: translateY(0) translateX(0);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(50px);
    }
}
