/* ================================
   DRAGON GAMES - ANIMATIONS
   Keyframe Animations & Effects
   ================================ */

/* ================================
   FLOATING ANIMATION
   ================================ */

@keyframes floating {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

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

/* ================================
   PULSING ANIMATION
   ================================ */

@keyframes pulsing {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

.pulsing {
    animation: pulsing 2s ease-in-out infinite;
}

/* ================================
   ROTATING ANIMATION
   ================================ */

@keyframes rotating {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.rotating {
    animation: rotating 20s linear infinite;
}

@keyframes rotating-slow {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.rotating-slow {
    animation: rotating-slow 40s linear infinite;
}

/* ================================
   GLOWING ANIMATION
   ================================ */

@keyframes glowing {
    0%, 100% {
        box-shadow: 
            0 0 5px var(--electric-blue),
            0 0 10px var(--electric-blue),
            0 0 15px var(--electric-blue);
    }
    50% {
        box-shadow: 
            0 0 10px var(--electric-blue),
            0 0 20px var(--electric-blue),
            0 0 30px var(--electric-blue),
            0 0 40px var(--neon-purple);
    }
}

.glowing {
    animation: glowing 2s ease-in-out infinite;
}

@keyframes text-glow {
    0%, 100% {
        text-shadow: 
            0 0 10px var(--electric-blue),
            0 0 20px var(--electric-blue);
    }
    50% {
        text-shadow: 
            0 0 20px var(--electric-blue),
            0 0 30px var(--electric-blue),
            0 0 40px var(--neon-purple),
            0 0 50px var(--neon-purple);
    }
}

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

/* ================================
   FADING ANIMATIONS
   ================================ */

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

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

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.fade-out {
    animation: fadeOut 0.6s ease-out;
}

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

.fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

/* ================================
   SLIDING ANIMATIONS
   ================================ */

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

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

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

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

/* ================================
   BOUNCING ANIMATION
   ================================ */

@keyframes bouncing {
    0%, 100% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(-15px);
    }
    50% {
        transform: translateY(0);
    }
    75% {
        transform: translateY(-7px);
    }
}

.bouncing {
    animation: bouncing 2s ease-in-out infinite;
}

/* ================================
   SHAKING ANIMATION
   ================================ */

@keyframes shaking {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.shaking {
    animation: shaking 0.8s ease-in-out;
}

/* ================================
   FLIPPING ANIMATION
   ================================ */

@keyframes flipping {
    0% {
        transform: rotateY(0deg);
    }
    100% {
        transform: rotateY(360deg);
    }
}

.flipping {
    animation: flipping 2s ease-in-out infinite;
}

/* ================================
   ZOOMING ANIMATION
   ================================ */

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

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

@keyframes zoomOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.5);
    }
}

.zoom-out {
    animation: zoomOut 0.5s ease-out;
}

/* ================================
   GRADIENT ANIMATION
   ================================ */

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-animated {
    background-size: 200% 200%;
    animation: gradient-shift 6s ease infinite;
}

/* ================================
   PARTICLE ANIMATIONS
   ================================ */

@keyframes particle-float {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(20px);
        opacity: 0;
    }
}

.particle {
    animation: particle-float linear infinite;
}

/* ================================
   EGG HATCHING ANIMATION
   ================================ */

@keyframes egg-shake {
    0%, 100% {
        transform: rotate(0deg);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: rotate(-5deg);
    }
    20%, 40%, 60%, 80% {
        transform: rotate(5deg);
    }
}

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

@keyframes egg-crack {
    0% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
    100% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 100%, 0 100%);
        opacity: 0;
    }
}

.egg-crack {
    animation: egg-crack 1s ease-out forwards;
}

@keyframes dragon-emerge {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(50px);
    }
    50% {
        opacity: 1;
        transform: scale(1.1) translateY(0);
    }
    100% {
        transform: scale(1) translateY(0);
    }
}

.dragon-emerge {
    animation: dragon-emerge 1.5s ease-out forwards;
}

/* ================================
   WING FLAPPING ANIMATION
   ================================ */

@keyframes flapping {
    0%, 100% {
        transform: rotateX(0deg);
    }
    50% {
        transform: rotateX(-30deg);
    }
}

.flapping {
    animation: flapping 0.4s ease-in-out infinite;
}

/* ================================
   SPARKLE ANIMATION
   ================================ */

@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

.sparkle {
    animation: sparkle 1.5s ease-in-out infinite;
}

@keyframes sparkle-burst {
    0% {
        opacity: 1;
        transform: scale(0) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: scale(2) rotate(180deg);
    }
}

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

/* ================================
   FIRE EFFECT ANIMATION
   ================================ */

@keyframes fire-flicker {
    0%, 100% {
        transform: scaleY(1) scaleX(1);
        filter: brightness(1);
    }
    25% {
        transform: scaleY(1.1) scaleX(0.95);
        filter: brightness(1.2);
    }
    50% {
        transform: scaleY(0.9) scaleX(1.05);
        filter: brightness(0.9);
    }
    75% {
        transform: scaleY(1.05) scaleX(0.98);
        filter: brightness(1.1);
    }
}

.fire-flicker {
    animation: fire-flicker 1.5s ease-in-out infinite;
}

/* ================================
   ICE EFFECT ANIMATION
   ================================ */

@keyframes ice-shimmer {
    0%, 100% {
        filter: brightness(1) saturate(1);
    }
    50% {
        filter: brightness(1.3) saturate(1.2);
    }
}

.ice-shimmer {
    animation: ice-shimmer 2s ease-in-out infinite;
}

/* ================================
   LIGHTNING EFFECT ANIMATION
   ================================ */

@keyframes lightning-flash {
    0%, 100% {
        opacity: 1;
        filter: brightness(1);
    }
    10%, 30%, 50% {
        opacity: 0.3;
        filter: brightness(2);
    }
    20%, 40%, 60% {
        opacity: 1;
        filter: brightness(1);
    }
}

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

/* ================================
   COUNTDOWN ANIMATION
   ================================ */

@keyframes countdown-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

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

/* ================================
   BUTTON RIPPLE EFFECT
   ================================ */

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

.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
}

.ripple-effect:active::after {
    animation: ripple 0.6s ease-out;
}

/* ================================
   LOADING SPINNER
   ================================ */

@keyframes spinner {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--glass-border);
    border-top-color: var(--electric-blue);
    border-radius: 50%;
    animation: spinner 1s linear infinite;
}

/* ================================
   WAVE ANIMATION
   ================================ */

@keyframes wave {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.wave {
    animation: wave 1.5s ease-in-out infinite;
}

/* Staggered wave effect for multiple elements */
.wave-1 { animation-delay: 0s; }
.wave-2 { animation-delay: 0.1s; }
.wave-3 { animation-delay: 0.2s; }
.wave-4 { animation-delay: 0.3s; }
.wave-5 { animation-delay: 0.4s; }

/* ================================
   REVEAL ANIMATIONS
   ================================ */

@keyframes reveal-left {
    from {
        clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
    }
    to {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
}

.reveal-left {
    animation: reveal-left 0.8s ease-out;
}

@keyframes reveal-right {
    from {
        clip-path: polygon(100% 0, 100% 0, 100% 100%, 100% 100%);
    }
    to {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
}

.reveal-right {
    animation: reveal-right 0.8s ease-out;
}

/* ================================
   TYPEWRITER EFFECT
   ================================ */

@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes cursor-blink {
    0%, 100% {
        border-color: var(--electric-blue);
    }
    50% {
        border-color: transparent;
    }
}

.typewriter {
    overflow: hidden;
    border-right: 3px solid var(--electric-blue);
    white-space: nowrap;
    animation: 
        typewriter 4s steps(40) 1s forwards,
        cursor-blink 0.75s step-end infinite;
}

/* ================================
   SCALE ANIMATIONS
   ================================ */

@keyframes scale-up {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.scale-up {
    animation: scale-up 0.4s ease-out;
}

@keyframes scale-down {
    from {
        transform: scale(1.2);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.scale-down {
    animation: scale-down 0.4s ease-out;
}

/* ================================
   UTILITY CLASSES
   ================================ */

/* Animation delays */
.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; }

/* Animation duration modifiers */
.duration-fast { animation-duration: 0.3s; }
.duration-normal { animation-duration: 0.6s; }
.duration-slow { animation-duration: 1s; }
.duration-slower { animation-duration: 2s; }

/* Pause animation on hover */
.pause-on-hover:hover {
    animation-play-state: paused;
}

/* Infinite animations */
.infinite {
    animation-iteration-count: infinite;
}

/* ================================
   RESPONSIVE ANIMATION CONTROLS
   ================================ */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Disable complex animations on mobile for performance */
@media (max-width: 768px) {
    .floating,
    .rotating-slow,
    .particle {
        animation: none;
    }
}