/* =====================================================
   PREMIUM ANIMATIONS & EFFECTS
   Particles, Parallax, Micro-interactions
   ===================================================== */

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

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

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

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

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

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

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

@keyframes wiggle {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-3deg);
    }
    75% {
        transform: rotate(3deg);
    }
}

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

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

/* Scroll-triggered Animation Classes */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-up {
    animation: fadeInUp 1s ease forwards;
}

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

.scale-in {
    animation: scaleIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.slide-in-left {
    animation: slideInLeft 0.8s ease forwards;
}

.slide-in-right {
    animation: slideInRight 0.8s ease forwards;
}

/* Stagger delays for sequential animations */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* Parallax Elements */
.parallax-element {
    will-change: transform;
    transition: transform 0.1s ease-out;
}

.parallax-slow {
    transform: translateY(var(--parallax-offset-slow, 0));
}

.parallax-medium {
    transform: translateY(var(--parallax-offset-medium, 0));
}

.parallax-fast {
    transform: translateY(var(--parallax-offset-fast, 0));
}

/* Floating Illustrations */
.illustration-float {
    animation: floatSlow 8s ease-in-out infinite;
}

.illustration-float-alt {
    animation: floatSlow 10s ease-in-out infinite;
    animation-delay: -2s;
}

/* Particle Container */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

/* Organic Blob Shapes */
@keyframes blobMorph {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    25% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
    50% {
        border-radius: 50% 50% 30% 60% / 30% 60% 70% 40%;
    }
    75% {
        border-radius: 60% 30% 60% 50% / 60% 40% 50% 50%;
    }
}

.blob-shape {
    animation: blobMorph 20s ease-in-out infinite;
}

/* Hover Effects for Cards */
.card-hover-lift {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.4s ease;
}

.card-hover-lift:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(44, 40, 32, 0.15);
}

/* Badge Pulse Animation */
.badge-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* App Store Button Shimmer */
.app-store-shimmer {
    position: relative;
    overflow: hidden;
}

.app-store-shimmer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 3s infinite;
}

/* Icon Wiggle on Hover */
.icon-wiggle:hover {
    animation: wiggle 0.5s ease;
}

/* Glow Effect */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(217, 120, 69, 0.5),
                    0 0 10px rgba(217, 120, 69, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(217, 120, 69, 0.8),
                    0 0 30px rgba(217, 120, 69, 0.5),
                    0 0 40px rgba(217, 120, 69, 0.3);
    }
}

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

/* Text Gradient Animation */
.gradient-text {
    background: linear-gradient(
        90deg,
        var(--color-accent-orange),
        var(--color-accent-blue),
        var(--color-accent-orange)
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

/* Loading State */
@keyframes skeletonLoading {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-paper-dark) 25%,
        #F8F5ED 50%,
        var(--color-paper-dark) 75%
    );
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s infinite;
}

/* Magnetic Button Effect */
.magnetic-btn {
    transition: transform 0.2s ease;
}

/* Cursor Trail Effect */
.cursor-trail {
    position: fixed;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-accent-orange);
    opacity: 0.6;
    pointer-events: none;
    z-index: 9998;
    transition: transform 0.2s ease, opacity 0.3s ease;
    mix-blend-mode: multiply;
}

/* Scroll Progress Indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(
        90deg,
        var(--color-accent-orange),
        var(--color-accent-blue)
    );
    z-index: 10000;
    transform-origin: left;
    transition: transform 0.1s ease;
}

/* Smooth Reveal on Scroll */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Image Parallax Container */
.image-parallax-container {
    overflow: hidden;
    position: relative;
}

.image-parallax {
    transform: scale(1.2);
    transition: transform 0.5s ease;
    will-change: transform;
}

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

    .parallax-element,
    .illustration-float,
    .illustration-float-alt,
    .particle {
        animation: none !important;
        transform: none !important;
    }
}

/* Performance Optimizations */
.will-animate {
    will-change: transform, opacity;
}

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}
