/**
 * AINNA - CSS Animations
 * Consolidated animation keyframes for all agent pages
 * 
 * @version 1.0
 * @date 2026-04-18
 */

/* ============================================
   HERO IMAGE ANIMATIONS
   ============================================ */

/* Hero Zoom + Pan Effect (Desktop) */
@keyframes heroZoomPan {
    0% {
        transform: scale(1) translate(0, 0);
    }
    50% {
        transform: scale(1.1) translate(-2%, -2%);
    }
    100% {
        transform: scale(1) translate(0, 0);
    }
}

/* Hero Zoom + Pan Effect (Mobile) */
@keyframes heroZoomPanMobile {
    0% {
        transform: scale(1) translate(0, 0);
    }
    50% {
        transform: scale(1.05) translate(-1%, -1%);
    }
    100% {
        transform: scale(1) translate(0, 0);
    }
}

/* Apply to hero images */
.hero-animated-image {
    animation: heroZoomPan 20s ease-in-out infinite;
    will-change: transform;
    transform-origin: center center;
}

@media (max-width: 768px) {
    .hero-animated-image {
        animation: heroZoomPanMobile 12s ease-in-out infinite;
    }
}

/* ============================================
   PAGE FLIP / SPINNER ANIMATIONS
   ============================================ */

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

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #0066ff;
    border-radius: 50%;
    animation: pageFlipSpin 1s linear infinite;
    will-change: transform;
}

/* ============================================
   SCROLLING LOGOS ANIMATION
   ============================================ */

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.logo-scroll {
    animation: scroll 30s linear infinite;
    will-change: transform;
}

/* ============================================
   WHATSAPP CHAT ANIMATIONS
   ============================================ */

/* Message Slide In */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wa-message {
    animation: messageSlideIn 0.3s ease;
    will-change: transform, opacity;
}

/* Typing Indicator Bounce */
@keyframes typingBounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #128C7E;
    border-radius: 50%;
    display: inline-block;
    animation: typingBounce 1.4s infinite ease-in-out both;
    will-change: transform, opacity;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0s;
}

/* Cursor Blink */
@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

.typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: #128C7E;
    margin-left: 3px;
    animation: blink 0.8s infinite;
    vertical-align: middle;
    will-change: opacity;
}

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

.pulse-animation {
    animation: pulse 2s infinite;
    will-change: transform, opacity;
}

/* ============================================
   FLOATING ANIMATIONS
   ============================================ */

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

.wa-float {
    animation: wa-float 3s ease-in-out infinite;
    will-change: transform;
}

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

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

.scale-in {
    animation: scaleIn 0.5s ease-out;
    will-change: transform, opacity;
}

/* ============================================
   FADE IN ANIMATIONS
   ============================================ */

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

.fade-in {
    animation: fadeIn 0.5s ease forwards;
    will-change: opacity;
}

/* ============================================
   SHOOTING STARS ANIMATIONS
   ============================================ */

/* Milky Way Rotation */
@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.milky-way {
    animation: rotate 120s linear infinite;
    will-change: transform;
}

/* Nebula Floating */
@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -30px) scale(1.05);
    }
    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }
    75% {
        transform: translate(20px, 30px) scale(1.02);
    }
}

.nebula {
    animation: float 20s ease-in-out infinite;
    will-change: transform;
}

/* Shooting Star */
@keyframes shoot {
    0% {
        transform: translate(0, 0) rotate(-45deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translate(800px, 800px) rotate(-45deg);
        opacity: 0;
    }
}

.shooting-star {
    animation: shoot var(--duration) linear var(--delay) infinite;
    will-change: transform, opacity;
}

/* Twinkling Stars */
@keyframes twinkle {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.2;
    }
}

.twinkle-star {
    animation: twinkle 2s ease-in-out infinite;
    will-change: opacity;
}

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

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

.spin {
    animation: spin 1s linear infinite;
    will-change: transform;
}

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

/* Pause animation on hover (for interactive elements) */
.pause-on-hover:hover {
    animation-play-state: paused;
}

/* Slow down animation */
.animation-slow {
    animation-duration: 2s;
}

/* Speed up animation */
.animation-fast {
    animation-duration: 0.5s;
}

/* Disable animation (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;
    }
}
