/* ========================================
   ANIMACIONES
   ======================================== */

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

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

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

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

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

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

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

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

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

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

/* Scroll-triggered Animations */
.animate-on-scroll {
    animation: slideInUp 0.6s ease-out forwards;
    opacity: 0;
}

.animate-on-scroll.in-view {
    animation: slideInUp 0.6s ease-out forwards;
}

/* Hero Animations */
.hero__content {
    animation: slideInLeft 0.8s ease-out;
}

.hero__badge {
    animation: slideInDown 0.6s ease-out;
}

.hero__title {
    animation: slideInUp 0.8s ease-out 0.1s both;
}

.hero__subtitle {
    animation: slideInUp 0.8s ease-out 0.2s both;
}

.hero__buttons {
    animation: slideInUp 0.8s ease-out 0.3s both;
}

.hero__image-wrapper {
    animation: slideInRight 0.8s ease-out;
}

/* Stats Animation */
.stats__item {
    animation: scaleIn 0.6s ease-out;
}

.stats__item:nth-child(1) { animation-delay: 0s; }
.stats__item:nth-child(2) { animation-delay: 0.1s; }
.stats__item:nth-child(3) { animation-delay: 0.2s; }
.stats__item:nth-child(4) { animation-delay: 0.3s; }

/* Card Hover Animations */
.invest__card,
.methodology__step {
    transition: all var(--transition-base);
}

.invest__card:hover {
    animation: none;
}

/* Button Animations */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.1);
    transition: left var(--transition-base);
}

.btn:hover::before {
    left: 100%;
}

/* Link Underline Animation */
a {
    position: relative;
}

a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-primary);
    transition: width var(--transition-base);
}

a:hover::after {
    width: 100%;
}

/* Loading States */
.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

.shimmer-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Form Input Focus Animation */
.form-input {
    position: relative;
}

.form-input:focus {
    animation: slideInUp 0.3s ease-out;
}

/* Image Hover Animation */
img {
    transition: transform var(--transition-base), filter var(--transition-base);
}

img:hover {
    transform: scale(1.02);
}

/* Navbar Scroll Animation */
.header {
    transition: all var(--transition-base);
}

.header.scrolled {
    animation: slideInDown 0.3s ease-out;
}

/* Mobile Menu Animation */
.navbar__menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow);
}

.navbar__menu.active {
    max-height: 500px;
    animation: slideInDown 0.4s ease-out;
}

/* Stagger Animation for List Items */
.story__gallery li,
.form-section__benefits li {
    animation: slideInLeft 0.6s ease-out forwards;
    opacity: 0;
}

.story__gallery li:nth-child(1) { animation-delay: 0s; }
.story__gallery li:nth-child(2) { animation-delay: 0.1s; }
.story__gallery li:nth-child(3) { animation-delay: 0.2s; }

/* Counter Animation */
.stats__number {
    animation: slideInUp 0.6s ease-out;
}

/* Fade In on Page Load */
body {
    animation: fadeIn 0.5s ease-out;
}

/* Accessibility - Reduced Motion Respect */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Scroll Progress Bar Animation */
.scroll-progress {
    animation: slideInRight 0.3s ease-out;
}

/* Success Message Animation */
.form-message.success {
    animation: slideInUp 0.3s ease-out;
}

/* Error Message Animation */
.form-message.error {
    animation: slideInUp 0.3s ease-out;
    animation-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Tooltip Animation */
[data-tooltip]:hover::after {
    animation: slideInDown 0.2s ease-out;
}
