/**
 * All Are Angels - Animations
 *
 * Lightweight, performant animations for a playful feel.
 * Uses CSS animations, transforms, and will-change for GPU acceleration.
 */

/* ═══════════════════════════════════════
   Keyframes
   ═══════════════════════════════════════ */

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

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

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

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

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

@keyframes aaaScaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes aaaBounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

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

@keyframes aaaFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-8px) rotate(2deg); }
    75% { transform: translateY(4px) rotate(-2deg); }
}

@keyframes aaaFloatHorizontal {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(10px); }
}

/* Cloud drift */
@keyframes aaaCloudDrift {
    0% { transform: translateX(-10%); }
    100% { transform: translateX(110%); }
}

/* Twinkle */
@keyframes aaaTwinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.3); }
}

/* Pulse */
@keyframes aaaPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes aaaPulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 193, 7, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 193, 7, 0.6);
    }
}

/* Bounce */
@keyframes aaaBounce {
    0%, 100% { transform: translateY(0); }
    40% { transform: translateY(-12px); }
    60% { transform: translateY(-6px); }
}

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

/* Ripple */
@keyframes aaaRipple {
    0% {
        transform: scale(0);
        opacity: 0.5;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* Shake */
@keyframes aaaShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* Wiggle */
@keyframes aaaWiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-3deg); }
    75% { transform: rotate(3deg); }
}

/* Jelly */
@keyframes aaaJelly {
    0% { transform: scale(1, 1); }
    25% { transform: scale(0.95, 1.05); }
    50% { transform: scale(1.05, 0.95); }
    75% { transform: scale(0.98, 1.02); }
    100% { transform: scale(1, 1); }
}

/* Slide in from bottom */
@keyframes aaaSlideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════
   Scroll-triggered Animation Classes
   ═══════════════════════════════════════ */

.aaa-animate-fade-up,
.aaa-animate-fade-down,
.aaa-animate-fade-left,
.aaa-animate-fade-right,
.aaa-animate-scale-in,
.aaa-animate-bounce-in {
    opacity: 0;
    will-change: transform, opacity;
}

.aaa-animate-fade-up.aaa-animated {
    animation: aaaFadeInUp 0.6s ease forwards;
}

.aaa-animate-fade-down.aaa-animated {
    animation: aaaFadeInDown 0.6s ease forwards;
}

.aaa-animate-fade-left.aaa-animated {
    animation: aaaFadeInLeft 0.6s ease forwards;
}

.aaa-animate-fade-right.aaa-animated {
    animation: aaaFadeInRight 0.6s ease forwards;
}

.aaa-animate-scale-in.aaa-animated {
    animation: aaaScaleIn 0.5s ease forwards;
}

.aaa-animate-bounce-in.aaa-animated {
    animation: aaaBounceIn 0.7s ease forwards;
}

/* Stagger delay classes */
.aaa-delay-1 { animation-delay: 0.1s !important; }
.aaa-delay-2 { animation-delay: 0.2s !important; }
.aaa-delay-3 { animation-delay: 0.3s !important; }
.aaa-delay-4 { animation-delay: 0.4s !important; }
.aaa-delay-5 { animation-delay: 0.5s !important; }

/* ═══════════════════════════════════════
   Hover Animations
   ═══════════════════════════════════════ */

/* Lift effect */
.aaa-hover-lift {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.aaa-hover-lift:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

/* Bounce on hover */
.aaa-hover-bounce:hover {
    animation: aaaBounce 0.6s ease;
}

/* Shake on hover */
.aaa-hover-shake:hover {
    animation: aaaShake 0.4s ease;
}

/* Wiggle on hover */
.aaa-hover-wiggle:hover {
    animation: aaaWiggle 0.4s ease;
}

/* Jelly on hover */
.aaa-hover-jelly:hover {
    animation: aaaJelly 0.5s ease;
}

/* Scale on hover */
.aaa-hover-scale {
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

/* Glow on hover */
.aaa-hover-glow:hover {
    box-shadow: 0 0 20px rgba(74, 144, 217, 0.3);
}

/* ═══════════════════════════════════════
   Button Ripple Effect
   ═══════════════════════════════════════ */
.aaa-btn {
    position: relative;
    overflow: hidden;
}

.aaa-btn .aaa-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    pointer-events: none;
    animation: aaaRipple 0.6s linear;
}

/* ═══════════════════════════════════════
   Loading States
   ═══════════════════════════════════════ */
.aaa-loading {
    position: relative;
    pointer-events: none;
}

.aaa-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid var(--aaa-border);
    border-top-color: var(--aaa-sky-blue);
    border-radius: 50%;
    animation: aaaSpin 0.8s linear infinite;
}

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

    .aaa-animate-fade-up,
    .aaa-animate-fade-down,
    .aaa-animate-fade-left,
    .aaa-animate-fade-right,
    .aaa-animate-scale-in,
    .aaa-animate-bounce-in {
        opacity: 1;
        transform: none;
    }

    .aaa-hero-cloud,
    .aaa-hero-sun,
    .aaa-hero-star,
    .aaa-hero-heart,
    .aaa-hero-badge,
    .aaa-floating-element,
    .aaa-star-float,
    .aaa-whatsapp-float {
        animation: none;
    }
}
