/* ===== Keyframe Animations ===== */

/* Emoji entrance animation */
@keyframes emojiEntrance {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }
    60% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* Bounce animation */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

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

/* Pulse animation */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(78, 204, 163, 0.4);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 10px rgba(78, 204, 163, 0);
    }
}

/* Glow pulse for hints */
@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 5px var(--accent-primary);
    }
    50% {
        box-shadow: 0 0 20px var(--accent-primary), 0 0 30px var(--accent-primary);
    }
}

/* Modal slide in */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

/* Fade in up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scale in */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Spin */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Number roll up */
@keyframes numberRoll {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

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

/* Success flash */
@keyframes successFlash {
    0% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(78, 204, 163, 0.3);
    }
    100% {
        background-color: transparent;
    }
}

/* Error flash */
@keyframes errorFlash {
    0% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(255, 107, 107, 0.3);
    }
    100% {
        background-color: transparent;
    }
}

/* Hint letter reveal */
@keyframes letterReveal {
    0% {
        opacity: 0;
        transform: scale(0) rotateY(90deg);
    }
    50% {
        transform: scale(1.2) rotateY(-10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotateY(0deg);
    }
}

/* Streak fire */
@keyframes fireGlow {
    0%, 100% {
        filter: drop-shadow(0 0 5px #ff6b35) drop-shadow(0 0 10px #f7931e);
    }
    50% {
        filter: drop-shadow(0 0 15px #ff6b35) drop-shadow(0 0 25px #f7931e);
    }
}

/* Trophy bounce */
@keyframes trophyBounce {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-15px) rotate(-10deg);
    }
    50% {
        transform: translateY(0) rotate(0deg);
    }
    75% {
        transform: translateY(-10px) rotate(10deg);
    }
}

/* Progress bar fill */
@keyframes progressFill {
    from {
        width: 0;
    }
}

/* Ripple effect */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

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

/* ===== Animation Classes ===== */

.animate-bounce {
    animation: bounce 1s ease infinite;
}

.animate-shake {
    animation: shake 0.5s ease;
}

.animate-pulse {
    animation: pulse 2s ease infinite;
}

.animate-glow {
    animation: glowPulse 1.5s ease infinite;
}

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

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease;
}

.animate-scale-in {
    animation: scaleIn 0.3s ease;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

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

.animate-success {
    animation: successFlash 0.5s ease;
}

.animate-error {
    animation: errorFlash 0.5s ease;
}

.animate-fire {
    animation: fireGlow 1s ease infinite;
}

.animate-trophy {
    animation: trophyBounce 2s ease infinite;
}

/* ===== Transition Classes ===== */

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

.transition-fast {
    transition: all 0.15s ease;
}

.transition-slow {
    transition: all 0.5s ease;
}

/* ===== Hover Effects ===== */

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow:hover {
    box-shadow: 0 0 20px var(--accent-primary);
}

/* ===== Confetti Particle ===== */

.confetti-particle {
    position: fixed;
    width: 10px;
    height: 10px;
    pointer-events: none;
    animation: confettiFall 3s linear forwards;
}

.confetti-particle.square {
    border-radius: 0;
}

.confetti-particle.circle {
    border-radius: 50%;
}

.confetti-particle.triangle {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 10px solid currentColor;
    background: transparent !important;
}

/* ===== Loading States ===== */

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 25%,
        var(--bg-card) 50%,
        var(--bg-secondary) 75%
    );
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
}

@keyframes skeleton {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.loading-dots::after {
    content: '';
    animation: loadingDots 1.5s infinite;
}

@keyframes loadingDots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

/* ===== Score Counter Animation ===== */

.score-counter {
    display: inline-block;
    overflow: hidden;
}

.score-counter .digit {
    display: inline-block;
    animation: numberRoll 0.3s ease-out;
}

/* ===== Delayed Animations ===== */

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }
.delay-900 { animation-delay: 0.9s; }
.delay-1000 { animation-delay: 1s; }
