/* ========================================
   ANIMACIONES TIPO APP MÓVIL
   Animaciones suaves y modernas para toda la plataforma
   ======================================== */

/* === KEYFRAMES === */

/* Fade In Up - Entrada desde abajo */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Down - Entrada desde arriba */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In - Simple aparición */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Slide In Right - Entrada desde la derecha */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In Left - Entrada desde la izquierda */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Bounce In - Rebote al entrar */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

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

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

/* === CLASES DE ANIMACIÓN === */

/* Animación de entrada por defecto */
.animate-in {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Delays para animaciones escalonadas */
.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }
.animate-delay-5 { animation-delay: 0.5s; }

/* Animaciones específicas */
.fade-in { animation: fadeIn 0.5s ease-in-out; }
.fade-in-up { animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.fade-in-down { animation: fadeInDown 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.scale-in { animation: scaleIn 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
.slide-in-right { animation: slideInRight 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.slide-in-left { animation: slideInLeft 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.bounce-in { animation: bounceIn 0.8s cubic-bezier(0.4, 0, 0.2, 1); }

/* === TRANSICIONES GLOBALES === */

/* Transiciones suaves para todos los elementos interactivos */
a, button, input, select, textarea {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Cards y contenedores */
.card, .product-card, .machine-card, .stat-card, [class*="card"] {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover, .product-card:hover, .machine-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Botones con efecto de presión */
button, .btn, [class*="btn-"] {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

button:active, .btn:active, [class*="btn-"]:active {
    transform: scale(0.95);
}

/* Efecto ripple para botones */
button::before, .btn::before, [class*="btn-"]::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:active::before, .btn:active::before, [class*="btn-"]:active::before {
    width: 300px;
    height: 300px;
}

/* Inputs con animación de foco */
input, textarea, select {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

input:focus, textarea:focus, select:focus {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0, 61, 130, 0.15);
}

/* === EFECTOS HOVER MEJORADOS === */

/* Links con subrayado animado */
a:not(.btn):not([class*="btn-"]):not(.logo) {
    position: relative;
}

a:not(.btn):not([class*="btn-"]):not(.logo)::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

a:not(.btn):not([class*="btn-"]):not(.logo):hover::after {
    width: 100%;
}

/* Logo sin efectos de subrayado */
.logo::after {
    display: none !important;
}

/* === ANIMACIONES DE CARGA === */

/* Skeleton loader */
@keyframes skeleton-loading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 0px, #f8f8f8 40px, #f0f0f0 80px);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s infinite;
}

/* Spinner de carga */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    border: 3px solid rgba(0, 61, 130, 0.1);
    border-top-color: #003d82;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
}

/* === MICROINTERACCIONES === */

/* Efecto de flotación */
.float {
    animation: float 3s ease-in-out infinite;
}

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

/* Efecto de latido */
.heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    10%, 30% {
        transform: scale(0.9);
    }
    20%, 40% {
        transform: scale(1.1);
    }
}

/* === ANIMACIONES DE NOTIFICACIONES === */

/* Slide down para notificaciones */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notification-enter {
    animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === TRANSICIONES DE PÁGINA === */

/* Fade de página completa */
.page-transition {
    animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === EFECTOS DE SCROLL === */

/* Reveal on scroll */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* === ANIMACIONES DE IMÁGENES === */

/* Zoom suave en hover */
img {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.zoom-hover:hover img {
    transform: scale(1.1);
}

/* === RESPONSIVE === */

/* Reducir animaciones en móviles para mejor rendimiento */
@media (max-width: 768px) {
    * {
        animation-duration: 0.4s !important;
        transition-duration: 0.2s !important;
    }
}

/* Respetar preferencias de usuario para animaciones reducidas */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* === UTILIDADES === */

/* Ocultar elemento inicialmente para animación */
.hidden-initial {
    opacity: 0;
}

/* Transición suave genérica */
.smooth-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Efecto glass morphism */
.glass {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sombra dinámica en hover */
.shadow-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* === EFECTO RIPPLE MEJORADO === */

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    pointer-events: none;
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* === ANIMACIONES PARA MODALES === */

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-enter {
    animation: modalFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === ANIMACIÓN DEL CARRITO === */

.cart-sidebar {
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.cart-overlay {
    transition: opacity 0.3s ease, visibility 0.3s ease !important;
}

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

/* === NAVBAR MEJORADO === */

.navbar {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, box-shadow, background;
}

/* === BOTONES CON GRADIENTE ANIMADO === */

.btn-gradient-animated {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* === LOADING DOTS === */

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

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

