/* ===== ANIMATIONS CSS ===== */

/* Animaciones de entrada */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

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

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

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

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

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

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

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

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(201, 152, 31, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(201, 152, 31, 0.6);
    }
}

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

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

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.3);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes flipInX {
    from {
        opacity: 0;
        transform: perspective(400px) rotateX(90deg);
    }
    40% {
        transform: perspective(400px) rotateX(-20deg);
    }
    60% {
        transform: perspective(400px) rotateX(10deg);
    }
    80% {
        transform: perspective(400px) rotateX(-5deg);
    }
    to {
        opacity: 1;
        transform: perspective(400px) rotateX(0deg);
    }
}

@keyframes flipInY {
    from {
        opacity: 0;
        transform: perspective(400px) rotateY(90deg);
    }
    40% {
        transform: perspective(400px) rotateY(-20deg);
    }
    60% {
        transform: perspective(400px) rotateY(10deg);
    }
    80% {
        transform: perspective(400px) rotateY(-5deg);
    }
    to {
        opacity: 1;
        transform: perspective(400px) rotateY(0deg);
    }
}

/* Clases de animación */
.animate-fade-in {
    animation: fadeIn 1s ease-out;
}

.animate-fade-up {
    animation: fadeUp 1s ease-out;
}

.animate-fade-up-delay {
    animation: fadeUp 1s ease-out 0.3s both;
}

.animate-fade-up-delay-2 {
    animation: fadeUp 1s ease-out 0.6s both;
}

.animate-fade-up-delay-3 {
    animation: fadeUp 1s ease-out 0.9s both;
}

.animate-fade-down {
    animation: fadeDown 1s ease-out;
}

.animate-fade-left {
    animation: fadeLeft 1s ease-out;
}

.animate-fade-right {
    animation: fadeRight 1s ease-out;
}

.animate-scale-up {
    animation: scaleUp 0.8s ease-out;
}

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

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

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

.animate-rotate {
    animation: rotate 2s linear infinite;
}

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

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

.animate-slide-left {
    animation: slideInLeft 1s ease-out;
}

.animate-slide-right {
    animation: slideInRight 1s ease-out;
}

.animate-zoom-in {
    animation: zoomIn 0.8s ease-out;
}

.animate-flip-x {
    animation: flipInX 1s ease-out;
}

.animate-flip-y {
    animation: flipInY 1s ease-out;
}

/* Animaciones de scroll */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

.animate-on-scroll-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.6s ease-out;
}

.animate-on-scroll-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.animate-on-scroll-right {
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.6s ease-out;
}

.animate-on-scroll-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.animate-on-scroll-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.6s ease-out;
}

.animate-on-scroll-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* Animaciones de hover para botones */
.btn-hover-lift {
    transition: all 0.3s ease;
}

.btn-hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.btn-hover-glow {
    transition: all 0.3s ease;
}

.btn-hover-glow:hover {
    box-shadow: 0 0 20px rgba(201, 152, 31, 0.6);
}

.btn-hover-scale {
    transition: all 0.3s ease;
}

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

/* Animaciones de hover para cards */
.card-hover-lift {
    transition: all 0.3s ease;
}

.card-hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.card-hover-glow {
    transition: all 0.3s ease;
}

.card-hover-glow:hover {
    box-shadow: 0 0 30px rgba(201, 152, 31, 0.3);
}

/* Animaciones de texto */
.text-glow {
    text-shadow: 0 0 10px rgba(201, 152, 31, 0.5);
}

.text-typing {
    overflow: hidden;
    border-right: 2px solid #C9981F;
    white-space: nowrap;
    animation: typing 3s 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: #C9981F;
    }
}

/* Animaciones de carga (loading) */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(201, 152, 31, 0.3);
    border-radius: 50%;
    border-top-color: #C9981F;
    animation: spin 1s ease-in-out infinite;
}

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

.loading-dots::after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}

/* Animaciones de progreso */
.progress-bar {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 8px;
    background: linear-gradient(90deg, #C9981F, #ffdd44);
    border-radius: 10px;
    transition: width 0.8s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

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

/* Animaciones específicas para elementos SVG */
.svg-draw {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: draw 3s ease-in-out forwards;
}

@keyframes draw {
    to {
        stroke-dashoffset: 0;
    }
}

.svg-fill {
    fill: transparent;
    animation: fill 2s ease-in-out 3s forwards;
}

@keyframes fill {
    to {
        fill: #C9981F;
    }
}

/* Animaciones de parallax */
.parallax {
    transform: translateZ(0);
    will-change: transform;
}

/* Transiciones suaves para elementos interactivos */
.smooth-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.smooth-transition-slow {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animaciones de entrada retardadas para listas */
.stagger-animation > * {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
}

.stagger-animation.visible > *:nth-child(1) { transition-delay: 0.1s; }
.stagger-animation.visible > *:nth-child(2) { transition-delay: 0.2s; }
.stagger-animation.visible > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-animation.visible > *:nth-child(4) { transition-delay: 0.4s; }
.stagger-animation.visible > *:nth-child(5) { transition-delay: 0.5s; }
.stagger-animation.visible > *:nth-child(6) { transition-delay: 0.6s; }

.stagger-animation.visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* Media queries para animaciones */
@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;
    }
}

/* Mejoras de rendimiento */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

.optimize-animations {
    backface-visibility: hidden;
    perspective: 1000px;
}