/**
 * Premium Animations Library
 * Ruayaverse Platform - Mystic Mangrove Theme
 */

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    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 scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(0);
    }
}

/* ============================================
   GLOW & PULSE ANIMATIONS
   ============================================ */

@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
    }

    50% {
        box-shadow: 0 0 40px rgba(16, 185, 129, 0.6);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
    }

    50% {
        box-shadow: 0 0 50px rgba(16, 185, 129, 0.7);
    }
}

/* ============================================
   FLOATING & MOVEMENT ANIMATIONS
   ============================================ */

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes floatSlow {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-30px);
    }
}

@keyframes sway {

    0%,
    100% {
        transform: translateX(0px);
    }

    50% {
        transform: translateX(10px);
    }
}

@keyframes drift {
    0% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(10px, -10px);
    }

    50% {
        transform: translate(0, -20px);
    }

    75% {
        transform: translate(-10px, -10px);
    }

    100% {
        transform: translate(0, 0);
    }
}

/* ============================================
   ROTATION & 3D ANIMATIONS
   ============================================ */

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes rotateY {
    from {
        transform: rotateY(0deg);
    }

    to {
        transform: rotateY(360deg);
    }
}

@keyframes flip {
    0% {
        transform: perspective(1000px) rotateY(0);
    }

    100% {
        transform: perspective(1000px) rotateY(360deg);
    }
}

@keyframes tilt {

    0%,
    100% {
        transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
    }

    50% {
        transform: perspective(1000px) rotateY(10deg) rotateX(5deg);
    }
}

/* ============================================
   SHIMMER & SHINE EFFECTS
   ============================================ */

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

@keyframes shine {
    0% {
        left: -100%;
    }

    100% {
        left: 200%;
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ============================================
   RIPPLE & WAVE EFFECTS
   ============================================ */

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }

    100% {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes wave {

    0%,
    100% {
        transform: scaleY(1);
    }

    50% {
        transform: scaleY(1.2);
    }
}

/* ============================================
   PARTICLE ANIMATIONS
   ============================================ */

@keyframes particleRise {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }

    10% {
        opacity: 0.5;
    }

    90% {
        opacity: 0.5;
    }

    100% {
        transform: translateY(-100vh) translateX(20px);
        opacity: 0;
    }
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }
}

/* ============================================
   TEXT ANIMATIONS
   ============================================ */

@keyframes typewriter {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@keyframes textGlow {

    0%,
    100% {
        text-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
    }

    50% {
        text-shadow: 0 0 30px rgba(16, 185, 129, 1);
    }
}

/* ============================================
   LOADING & PROGRESS ANIMATIONS
   ============================================ */

@keyframes progress {
    0% {
        width: 0%;
    }

    100% {
        width: 100%;
    }
}

@keyframes spinner {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes dots {

    0%,
    20% {
        color: rgba(16, 185, 129, 0);
        text-shadow: 0.25em 0 0 rgba(16, 185, 129, 0),
            0.5em 0 0 rgba(16, 185, 129, 0);
    }

    40% {
        color: var(--color-primary);
        text-shadow: 0.25em 0 0 rgba(16, 185, 129, 0),
            0.5em 0 0 rgba(16, 185, 129, 0);
    }

    60% {
        text-shadow: 0.25em 0 0 var(--color-primary),
            0.5em 0 0 rgba(16, 185, 129, 0);
    }

    80%,
    100% {
        text-shadow: 0.25em 0 0 var(--color-primary),
            0.5em 0 0 var(--color-primary);
    }
}

/* ============================================
   UTILITY ANIMATION CLASSES
   ============================================ */

.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fade-in-down {
    animation: fadeInDown 0.6s ease-out forwards;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.6s ease-out forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 0.6s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn 0.4s ease-out forwards;
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-float-slow {
    animation: floatSlow 8s ease-in-out infinite;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-glow {
    animation: glow 3s ease-in-out infinite;
}

.animate-pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-rotate {
    animation: rotate 3s linear infinite;
}

.animate-shimmer {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.2) 50%,
            rgba(255, 255, 255, 0) 100%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

.animate-twinkle {
    animation: twinkle 3s ease-in-out infinite;
}

.animate-sway {
    animation: sway 4s ease-in-out infinite;
}

.animate-drift {
    animation: drift 10s ease-in-out infinite;
}

/* ============================================
   DELAY UTILITIES
   ============================================ */

.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-700 {
    animation-delay: 0.7s;
}

.delay-1000 {
    animation-delay: 1s;
}

/* ============================================
   HOVER ANIMATIONS
   ============================================ */

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3), 0 0 40px rgba(16, 185, 129, 0.3);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.6);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-rotate {
    transition: transform 0.5s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}