/* ============================================
   BULONES DEL SUR - Animations Stylesheet
   Custom CSS Animations (No AOS)
   ============================================ */

/* ============================================
   Reveal Animations - Base Classes
   ============================================ */
.reveal-up,
.reveal-down,
.reveal-left,
.reveal-right,
.reveal-scale,
.reveal-fade {
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-up {
    transform: translateY(60px);
}

.reveal-down {
    transform: translateY(-60px);
}

.reveal-left {
    transform: translateX(-60px);
}

.reveal-right {
    transform: translateX(60px);
}

.reveal-scale {
    transform: scale(0.8);
}

.reveal-fade {
    transform: none;
}

/* Active State - When element is visible */
.reveal-up.active,
.reveal-down.active,
.reveal-left.active,
.reveal-right.active,
.reveal-scale.active,
.reveal-fade.active {
    opacity: 1;
    transform: translate(0) scale(1);
}

/* Stagger Delays */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }
.delay-6 { transition-delay: 0.6s; }
.delay-7 { transition-delay: 0.7s; }
.delay-8 { transition-delay: 0.8s; }

/* ============================================
   Particle Animation for Hero
   ============================================ */
.particle {
    position: absolute;
    background: var(--color-accent);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.3;
    animation: particle-float linear infinite;
}

@keyframes particle-float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ============================================
   Text Animations
   ============================================ */
.text-animate {
    display: inline-block;
    overflow: hidden;
}

.text-animate span {
    display: inline-block;
    animation: text-reveal 0.8s cubic-bezier(0.77, 0, 0.175, 1) forwards;
    animation-delay: calc(var(--index) * 0.05s);
    transform: translateY(100%);
}

@keyframes text-reveal {
    to {
        transform: translateY(0);
    }
}

/* Typing Animation */
.typing-text {
    overflow: hidden;
    border-right: 3px solid var(--color-accent);
    white-space: nowrap;
    animation: 
        typing 3.5s steps(40, end),
        blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--color-accent); }
}

/* ============================================
   Hover Animations
   ============================================ */
/* Magnetic Button Effect */
.magnetic-btn {
    position: relative;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Shine Effect */
.shine-effect {
    position: relative;
    overflow: hidden;
}

.shine-effect::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    transform: rotate(30deg);
    animation: shine 6s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) rotate(30deg);
    }
    20%, 100% {
        transform: translateX(100%) rotate(30deg);
    }
}

/* ============================================
   Icon Animations
   ============================================ */
/* Bounce */
.icon-bounce {
    animation: icon-bounce 2s ease-in-out infinite;
}

@keyframes icon-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Pulse */
.icon-pulse {
    animation: icon-pulse 2s ease-in-out infinite;
}

@keyframes icon-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Spin */
.icon-spin {
    animation: icon-spin 3s linear infinite;
}

@keyframes icon-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   Card Animations
   ============================================ */
/* Card Lift */
.card-lift {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-lift:hover {
    transform: translateY(-12px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

/* Card Tilt */
.card-tilt {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

/* ============================================
   Image Animations
   ============================================ */
/* Zoom on Hover */
.img-zoom {
    overflow: hidden;
}

.img-zoom img {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.img-zoom:hover img {
    transform: scale(1.1);
}

/* Ken Burns Effect */
.ken-burns {
    overflow: hidden;
}

.ken-burns img {
    animation: ken-burns 20s ease-in-out infinite alternate;
}

@keyframes ken-burns {
    0% {
        transform: scale(1) translate(0, 0);
    }
    100% {
        transform: scale(1.2) translate(-5%, -5%);
    }
}

/* ============================================
   Loading Animations
   ============================================ */
/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-light);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Dots Loading */
.loading-dots {
    display: flex;
    gap: 6px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--color-accent);
    border-radius: 50%;
    animation: dots-bounce 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0; }

@keyframes dots-bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* ============================================
   Background Animations
   ============================================ */
/* Gradient Animation */
.animated-gradient {
    background: linear-gradient(
        -45deg,
        var(--color-primary),
        var(--color-primary-dark),
        var(--color-accent-dark),
        var(--color-primary)
    );
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* ============================================
   Scroll Triggered Animations
   ============================================ */
/* Counter Animation */
.count-up {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.count-up.counting {
    opacity: 1;
    transform: translateY(0);
}

/* Progress Bar Fill */
.progress-fill {
    width: 0;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-fill.animate {
    width: var(--progress, 100%);
}

/* ============================================
   Navigation Animations
   ============================================ */
/* Nav Link Underline */
.nav-link-animated {
    position: relative;
}

.nav-link-animated::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: width 0.3s ease;
}

.nav-link-animated:hover::after {
    width: 100%;
}

/* Menu Open Animation */
.menu-open .nav-item {
    animation: menu-item-in 0.5s ease forwards;
    opacity: 0;
}

.menu-open .nav-item:nth-child(1) { animation-delay: 0.1s; }
.menu-open .nav-item:nth-child(2) { animation-delay: 0.2s; }
.menu-open .nav-item:nth-child(3) { animation-delay: 0.3s; }
.menu-open .nav-item:nth-child(4) { animation-delay: 0.4s; }
.menu-open .nav-item:nth-child(5) { animation-delay: 0.5s; }
.menu-open .nav-item:nth-child(6) { animation-delay: 0.6s; }

@keyframes menu-item-in {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   Button Animations
   ============================================ */
/* Ripple Effect */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple-effect 0.6s linear;
    pointer-events: none;
}

@keyframes ripple-effect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Arrow Bounce */
.arrow-bounce {
    display: inline-block;
    animation: arrow-bounce 1.5s ease-in-out infinite;
}

@keyframes arrow-bounce {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(5px);
    }
}

/* ============================================
   Form Animations
   ============================================ */
/* Input Focus */
.input-animated {
    position: relative;
}

.input-animated::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: all 0.3s ease;
}

.input-animated:focus-within::after {
    left: 0;
    width: 100%;
}

/* Shake on Error */
.shake {
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {
    10%, 90% {
        transform: translateX(-1px);
    }
    20%, 80% {
        transform: translateX(2px);
    }
    30%, 50%, 70% {
        transform: translateX(-4px);
    }
    40%, 60% {
        transform: translateX(4px);
    }
}

/* ============================================
   Special Effects
   ============================================ */
/* Glow Effect */
.glow {
    animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 5px var(--color-accent),
                    0 0 10px var(--color-accent),
                    0 0 15px var(--color-accent);
    }
    50% {
        box-shadow: 0 0 10px var(--color-accent),
                    0 0 20px var(--color-accent),
                    0 0 30px var(--color-accent);
    }
}

/* Morph Shape */
.morph {
    animation: morph 8s ease-in-out infinite;
}

@keyframes morph {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
}

/* ============================================
   Scroll Progress Indicator
   ============================================ */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
    z-index: 9999;
    transition: width 0.1s ease-out;
}

/* ============================================
   Parallax Effect Classes
   ============================================ */
.parallax-slow {
    will-change: transform;
}

.parallax-medium {
    will-change: transform;
}

.parallax-fast {
    will-change: transform;
}

/* ============================================
   Intersection Observer Utility
   ============================================ */
[data-animate] {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate="fade-up"] {
    transform: translateY(30px);
}

[data-animate="fade-down"] {
    transform: translateY(-30px);
}

[data-animate="fade-left"] {
    transform: translateX(-30px);
}

[data-animate="fade-right"] {
    transform: translateX(30px);
}

[data-animate="zoom-in"] {
    transform: scale(0.9);
}

[data-animate].animated {
    opacity: 1;
    transform: translate(0) scale(1);
}

/* ============================================
   Reduced Motion Support
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .reveal-up,
    .reveal-down,
    .reveal-left,
    .reveal-right,
    .reveal-scale,
    .reveal-fade {
        opacity: 1;
        transform: none;
    }
}
