/* ===========================================
   MEXICANO - Animations & Transitions
   AOS-style animations, keyframes, and transition utilities
   =========================================== */

/* ===========================================
   AOS (ANIMATE ON SCROLL) STYLES
   Custom implementation without external library
   =========================================== */

/* Base animation properties */
[data-aos] {
    opacity: 0;
    transition-property: transform, opacity;
    transition-timing-function: ease-out;
    transition-duration: 0.6s;
}

/* Animated state - applied via JS when element enters viewport */
[data-aos].aos-animate {
    opacity: 1;
}

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

/* Fade Up */
[data-aos="fade-up"] {
    transform: translateY(40px);
}

[data-aos="fade-up"].aos-animate {
    transform: translateY(0);
}

/* Fade Down */
[data-aos="fade-down"] {
    transform: translateY(-40px);
}

[data-aos="fade-down"].aos-animate {
    transform: translateY(0);
}

/* Fade Left */
[data-aos="fade-left"] {
    transform: translateX(40px);
}

[data-aos="fade-left"].aos-animate {
    transform: translateX(0);
}

/* Fade Right */
[data-aos="fade-right"] {
    transform: translateX(-40px);
}

[data-aos="fade-right"].aos-animate {
    transform: translateX(0);
}

/* Fade Up Right */
[data-aos="fade-up-right"] {
    transform: translate(-40px, 40px);
}

[data-aos="fade-up-right"].aos-animate {
    transform: translate(0, 0);
}

/* Fade Up Left */
[data-aos="fade-up-left"] {
    transform: translate(40px, 40px);
}

[data-aos="fade-up-left"].aos-animate {
    transform: translate(0, 0);
}

/* ===========================================
   ZOOM ANIMATIONS
   =========================================== */

/* Zoom In */
[data-aos="zoom-in"] {
    transform: scale(0.8);
}

[data-aos="zoom-in"].aos-animate {
    transform: scale(1);
}

/* Zoom In Up */
[data-aos="zoom-in-up"] {
    transform: scale(0.8) translateY(40px);
}

[data-aos="zoom-in-up"].aos-animate {
    transform: scale(1) translateY(0);
}

/* Zoom In Down */
[data-aos="zoom-in-down"] {
    transform: scale(0.8) translateY(-40px);
}

[data-aos="zoom-in-down"].aos-animate {
    transform: scale(1) translateY(0);
}

/* Zoom Out */
[data-aos="zoom-out"] {
    transform: scale(1.2);
}

[data-aos="zoom-out"].aos-animate {
    transform: scale(1);
}

/* ===========================================
   FLIP ANIMATIONS
   =========================================== */

/* Flip Up */
[data-aos="flip-up"] {
    transform: perspective(2500px) rotateX(-100deg);
}

[data-aos="flip-up"].aos-animate {
    transform: perspective(2500px) rotateX(0);
}

/* Flip Down */
[data-aos="flip-down"] {
    transform: perspective(2500px) rotateX(100deg);
}

[data-aos="flip-down"].aos-animate {
    transform: perspective(2500px) rotateX(0);
}

/* Flip Left */
[data-aos="flip-left"] {
    transform: perspective(2500px) rotateY(-100deg);
}

[data-aos="flip-left"].aos-animate {
    transform: perspective(2500px) rotateY(0);
}

/* Flip Right */
[data-aos="flip-right"] {
    transform: perspective(2500px) rotateY(100deg);
}

[data-aos="flip-right"].aos-animate {
    transform: perspective(2500px) rotateY(0);
}

/* ===========================================
   SLIDE ANIMATIONS
   =========================================== */

/* Slide Up */
[data-aos="slide-up"] {
    transform: translateY(100%);
}

[data-aos="slide-up"].aos-animate {
    transform: translateY(0);
}

/* Slide Down */
[data-aos="slide-down"] {
    transform: translateY(-100%);
}

[data-aos="slide-down"].aos-animate {
    transform: translateY(0);
}

/* Slide Left */
[data-aos="slide-left"] {
    transform: translateX(100%);
}

[data-aos="slide-left"].aos-animate {
    transform: translateX(0);
}

/* Slide Right */
[data-aos="slide-right"] {
    transform: translateX(-100%);
}

[data-aos="slide-right"].aos-animate {
    transform: translateX(0);
}

/* ===========================================
   ANIMATION DELAYS
   =========================================== */

[data-aos-delay="100"] { transition-delay: 100ms; }
[data-aos-delay="200"] { transition-delay: 200ms; }
[data-aos-delay="300"] { transition-delay: 300ms; }
[data-aos-delay="400"] { transition-delay: 400ms; }
[data-aos-delay="500"] { transition-delay: 500ms; }
[data-aos-delay="600"] { transition-delay: 600ms; }
[data-aos-delay="700"] { transition-delay: 700ms; }
[data-aos-delay="800"] { transition-delay: 800ms; }
[data-aos-delay="900"] { transition-delay: 900ms; }
[data-aos-delay="1000"] { transition-delay: 1000ms; }

/* ===========================================
   ANIMATION DURATIONS
   =========================================== */

[data-aos-duration="300"] { transition-duration: 300ms; }
[data-aos-duration="400"] { transition-duration: 400ms; }
[data-aos-duration="500"] { transition-duration: 500ms; }
[data-aos-duration="600"] { transition-duration: 600ms; }
[data-aos-duration="700"] { transition-duration: 700ms; }
[data-aos-duration="800"] { transition-duration: 800ms; }
[data-aos-duration="900"] { transition-duration: 900ms; }
[data-aos-duration="1000"] { transition-duration: 1000ms; }
[data-aos-duration="1200"] { transition-duration: 1200ms; }

/* ===========================================
   ANIMATION EASING
   =========================================== */

[data-aos-easing="linear"] { transition-timing-function: linear; }
[data-aos-easing="ease"] { transition-timing-function: ease; }
[data-aos-easing="ease-in"] { transition-timing-function: ease-in; }
[data-aos-easing="ease-out"] { transition-timing-function: ease-out; }
[data-aos-easing="ease-in-out"] { transition-timing-function: ease-in-out; }
[data-aos-easing="ease-in-back"] { transition-timing-function: cubic-bezier(0.6, -0.28, 0.735, 0.045); }
[data-aos-easing="ease-out-back"] { transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275); }
[data-aos-easing="ease-in-out-back"] { transition-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55); }

/* ===========================================
   CUSTOM KEYFRAME ANIMATIONS
   =========================================== */

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

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

/* Bounce */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

.animate-bounce {
    animation: bounce 2s ease infinite;
}

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

.animate-shake {
    animation: shake 0.6s ease;
}

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

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Ping */
@keyframes ping {
    75%, 100% {
        transform: scale(2);
        opacity: 0;
    }
}

.animate-ping {
    animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* Glow */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px var(--gold-primary),
                    0 0 10px var(--gold-primary),
                    0 0 15px var(--gold-primary);
    }
    50% {
        box-shadow: 0 0 10px var(--gold-primary),
                    0 0 20px var(--gold-primary),
                    0 0 30px var(--gold-primary);
    }
}

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

/* Shimmer (for loading states) */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.animate-shimmer {
    background: linear-gradient(
        90deg,
        var(--bg-card) 25%,
        var(--bg-card-hover) 50%,
        var(--bg-card) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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

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

/* Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.animate-fadeIn {
    animation: fadeIn 0.5s ease forwards;
}

/* Fade Out */
@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.animate-fadeOut {
    animation: fadeOut 0.5s ease forwards;
}

/* Slide In From Bottom */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slideInUp {
    animation: slideInUp 0.5s ease forwards;
}

/* Slide In From Top */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slideInDown {
    animation: slideInDown 0.5s ease forwards;
}

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

.animate-scaleIn {
    animation: scaleIn 0.3s ease forwards;
}

/* ===========================================
   TEXT ANIMATIONS
   =========================================== */

/* Text Reveal */
@keyframes textReveal {
    from {
        clip-path: inset(0 100% 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

.text-reveal {
    animation: textReveal 0.8s ease forwards;
}

/* Typing Effect */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

.typing-effect {
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid var(--gold-primary);
    animation: typing 3s steps(40) forwards, blink 0.75s step-end infinite;
}

/* Gradient Text Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animate-gradient-text {
    background: linear-gradient(
        90deg,
        var(--red-primary),
        var(--gold-primary),
        var(--red-primary)
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

/* ===========================================
   COUNTER ANIMATION
   =========================================== */

.counter {
    font-variant-numeric: tabular-nums;
}

/* ===========================================
   STAGGER ANIMATION CLASSES
   =========================================== */

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }
.stagger-item:nth-child(7) { animation-delay: 0.7s; }
.stagger-item:nth-child(8) { animation-delay: 0.8s; }

/* ===========================================
   HOVER ANIMATIONS
   =========================================== */

/* Hover Lift */
.hover-lift {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

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

/* Hover Scale */
.hover-scale {
    transition: transform var(--transition-normal);
}

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

/* Hover Rotate */
.hover-rotate {
    transition: transform var(--transition-normal);
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* Hover Glow */
.hover-glow {
    transition: box-shadow var(--transition-normal);
}

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

/* ===========================================
   LOADING ANIMATIONS
   =========================================== */

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--gold-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Dots Loading */
@keyframes dotsLoading {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.dots-loading {
    display: flex;
    gap: 8px;
}

.dots-loading span {
    width: 10px;
    height: 10px;
    background: var(--gold-primary);
    border-radius: 50%;
    animation: dotsLoading 1.4s ease-in-out infinite;
}

.dots-loading span:nth-child(1) { animation-delay: 0s; }
.dots-loading span:nth-child(2) { animation-delay: 0.2s; }
.dots-loading span:nth-child(3) { animation-delay: 0.4s; }

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

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

    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
    }
}
