/* assets/css/effects.css */

/* Efectos de Reveal */
[data-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-reveal].is-inview {
    opacity: 1;
    transform: translateY(0);
}

[data-reveal].no-animation {
    transition: none !important;
    opacity: 1;
    transform: none;
}

/* Variantes de reveal */
[data-reveal="fade"] {
    transform: none;
}

[data-reveal="scale"] {
    transform: scale(0.9);
}

[data-reveal="scale"].is-inview {
    transform: scale(1);
}

/* Navbar Sticky Mejorado */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.header.is-scrolled {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

/* Link activo en navegación */
.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s ease, left 0.3s ease;
}

.nav-link.is-active::after,
.nav-link.active::after {
    width: 100%;
    left: 0;
}

/* Hero con Parallax */
.hero__bg {
    position: absolute;
    top: -10%;
    left: 0;
    right: 0;
    bottom: -10%;
    z-index: -1;
    will-change: transform;
}

.hero__bg-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-primary);
}

[data-parallax] {
    will-change: transform;
    transition: transform 0.1s linear;
}


/* Contadores Animados */
.counter {
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent-color);
    display: block;
    font-variant-numeric: tabular-nums;
}

.hero-stat-number.counter {
    font-size: 2rem;
}

.result-number.counter {
    color: var(--accent-color);
}

.counter.is-animated {
    animation: counterPulse 0.5s ease;
}

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

/* Botón Back to Top */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.back-to-top.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.back-to-top:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.back-to-top svg {
    width: 24px;
    height: 24px;
}

/* Focus visible para accesibilidad */
:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

button:focus:not(:focus-visible) {
    outline: none;
}

/* Preferencias de movimiento reducido */
@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-reveal] {
        opacity: 1;
        transform: none;
    }
    
    [data-parallax] {
        transform: none !important;
    }
    
    .back-to-top {
        transition: opacity 0.01ms;
    }
}

/* Mejoras responsive */
@media (max-width: 768px) {
    [data-reveal] {
        transform: translateY(20px);
    }
    
    .counter {
        font-size: 2rem;
    }
    
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
    }
    
    .faq-trigger {
        padding: 1rem;
        font-size: 1rem;
    }
    
    /* Desactivar parallax en móvil */
    [data-parallax] {
        transform: none !important;
    }
}

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

body {
    animation: fadeIn 0.5s ease;
}

/* Transiciones suaves para interacciones */
a,
button {
    transition: all 0.3s ease;
}

/* Estados hover mejorados */
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.service-card:hover {
    transform: translateY(-8px);
}

.value-card:hover {
    transform: translateY(-4px);
}

/* Loading skeleton (opcional para lazy load) */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}