/**
 * Erebora Landing Page - Animations
 * Keyframes and animation utilities
 */

/* ===== KEYFRAMES ===== */

/* ===== FINGER TAPPING ANIMATION ===== */
@keyframes finger-tap {
    0%, 100% { 
        transform: translateY(0) rotate(0deg);
    }
    40%, 60% { 
        transform: translateY(8px) rotate(-5deg);
    }
}



/* Sheen effect on headline text */
@keyframes sheen-text {
    0% { background-position: 200% center; }
    20% { background-position: -20% center; }
    100% { background-position: -20% center; }
}

/* ===== HERO BUTTON SHEEN - REBUILT FROM SCRATCH ===== */
/* Light sweeps continuously across the button */

@-webkit-keyframes hero-sheen {
    0% {
        -webkit-transform: translateX(-100%) skewX(-15deg);
        transform: translateX(-100%) skewX(-15deg);
    }
    100% {
        -webkit-transform: translateX(300%) skewX(-15deg);
        transform: translateX(300%) skewX(-15deg);
    }
}

@keyframes hero-sheen {
    0% {
        -webkit-transform: translateX(-100%) skewX(-15deg);
        transform: translateX(-100%) skewX(-15deg);
    }
    100% {
        -webkit-transform: translateX(300%) skewX(-15deg);
        transform: translateX(300%) skewX(-15deg);
    }
}

/* Sheen button utility class - complete rebuild */
.sheen-btn {
    position: relative !important;
    overflow: hidden !important;
}

.sheen-btn::after {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 50% !important;
    height: 100% !important;
    background: -webkit-linear-gradient(
        left,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    ) !important;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    ) !important;
    -webkit-animation: hero-sheen 2.5s ease-in-out infinite !important;
    animation: hero-sheen 2.5s ease-in-out infinite !important;
    pointer-events: none !important;
    z-index: 100 !important;
}

/* Pulse dot (sound button) */
@keyframes pulse-dot {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

/* Fade bounce (scroll indicator) */
@keyframes fade-bounce {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.3; }
}

/* Bounce down (scroll arrows) */
@keyframes bounce-down {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* Pulse animation for main CTA */
@keyframes pulse-cta {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

/* Pulse badge (bike cards) */
@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* WhatsApp bar pulse */
@keyframes pulse-bar {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.9; }
}

/* Float animation */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Slide in from right (social proof) */
@keyframes slide-in-right {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Slide out to right */
@keyframes slide-out-right {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Fade in up (sections reveal) */
@keyframes fade-in-up {
    from {
        transform: translateY(40px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Fade in (general) */
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Scale in (modals) */
@keyframes scale-in {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Shake (error feedback) */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

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

/* ===== ANIMATION UTILITIES ===== */

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

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

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

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

.shake {
    animation: shake 0.5s ease;
}

/* ===== TRANSITION HELPERS ===== */

.transition-all {
    transition: all var(--transition-base);
}

.transition-fast {
    transition: all var(--transition-fast);
}

.transition-slow {
    transition: all var(--transition-slow);
}

/* ===== HOVER EFFECTS ===== */

.hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.hover-glow {
    transition: box-shadow var(--transition-base);
}

.hover-glow:hover {
    box-shadow: var(--shadow-gold);
}

.hover-scale {
    transition: transform var(--transition-base);
}

.hover-scale:hover {
    transform: scale(1.02);
}

/* ===== LOADING STATES ===== */

.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--bg-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--ring);
    border-top-color: var(--cta1);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

/* ===== SKELETON LOADING ===== */

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-card) 0%,
        var(--bg-card-elevated) 50%,
        var(--bg-card) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== 3D TILT EFFECT FOR CARDS ===== */
@keyframes tilt-in {
    0% {
        transform: perspective(1000px) rotateY(-15deg) rotateX(10deg) scale(0.9);
        opacity: 0;
    }
    100% {
        transform: perspective(1000px) rotateY(0) rotateX(0) scale(1);
        opacity: 1;
    }
}

/* ===== STAGGERED FADE IN ===== */
@keyframes stagger-fade-in {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== GRADIENT BORDER ROTATION ===== */
@keyframes gradient-border-rotate {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* ===== NUMBER COUNTER TICK ===== */
@keyframes number-tick {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    50% {
        transform: translateY(10%);
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===== CONFETTI BURST ===== */
@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

@keyframes confetti-burst {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.5) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(360deg);
        opacity: 0;
    }
}

/* ===== KEN BURNS EFFECT ===== */
@keyframes ken-burns {
    0% {
        transform: scale(1) translate(0, 0);
    }
    50% {
        transform: scale(1.1) translate(-2%, -1%);
    }
    100% {
        transform: scale(1) translate(0, 0);
    }
}

/* ===== RIPPLE EFFECT ===== */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.5;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* ===== GLOW PULSE ===== */
@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(212, 175, 55, 0.6), 0 0 60px rgba(212, 175, 55, 0.3);
    }
}

/* ===== FLOAT WITH ROTATION ===== */
@keyframes float-rotate {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-8px) rotate(2deg);
    }
    75% {
        transform: translateY(-4px) rotate(-2deg);
    }
}

/* ===== SLIDE IN STAGGER ===== */
@keyframes slide-in-left {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slide-in-bottom {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===== MORPHING BLOB ===== */
@keyframes morph-blob {
    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% 60% 30% 60% / 30% 60% 70% 40%;
    }
    75% {
        border-radius: 60% 40% 60% 30% / 70% 30% 50% 60%;
    }
}

/* ===== DRAW LINE (SVG) ===== */
@keyframes draw-line {
    from {
        stroke-dashoffset: 1000;
    }
    to {
        stroke-dashoffset: 0;
    }
}

/* ===== SUCCESS CHECKMARK ===== */
@keyframes checkmark-draw {
    0% {
        stroke-dashoffset: 100;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

/* ===== ATTENTION SHAKE ===== */
@keyframes attention-shake {
    0%, 100% { transform: translateX(0); }
    10% { transform: translateX(-2px) rotate(-1deg); }
    20% { transform: translateX(2px) rotate(1deg); }
    30% { transform: translateX(-2px) rotate(-1deg); }
    40% { transform: translateX(2px) rotate(1deg); }
    50% { transform: translateX(0); }
}

/* ===== UTILITY CLASSES FOR NEW ANIMATIONS ===== */

.tilt-in {
    animation: tilt-in 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.stagger-fade-in {
    animation: stagger-fade-in 0.5s ease forwards;
    opacity: 0;
}

/* Stagger delays for grid items */
.stagger-fade-in:nth-child(1) { animation-delay: 0ms; }
.stagger-fade-in:nth-child(2) { animation-delay: 100ms; }
.stagger-fade-in:nth-child(3) { animation-delay: 200ms; }
.stagger-fade-in:nth-child(4) { animation-delay: 300ms; }
.stagger-fade-in:nth-child(5) { animation-delay: 400ms; }
.stagger-fade-in:nth-child(6) { animation-delay: 500ms; }

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

.float-rotate-animation {
    animation: float-rotate 4s ease-in-out infinite;
}

.ken-burns-animation {
    animation: ken-burns 20s ease-in-out infinite;
}

.attention-shake-animation {
    animation: attention-shake 0.5s ease;
}

/* ===== REDUCED MOTION ===== */

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