/**
 * Terapia Física Total - Animations
 * 
 * Animaciones profesionales con Intersection Observer.
 * @version 1.0.0
 */

/* ==========================================================================
   PARTICLE CANVAS
   ========================================================================== */
.tft-particles-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: auto;
}

/* Ensure content is above particles */
.tft-hero .tft-container,
.tft-cta-final .tft-container {
    position: relative;
    z-index: 2;
}

.tft-hero .tft-hero__overlay,
.tft-cta-final .tft-cta-final__overlay {
    z-index: 0;
}

.tft-hero .tft-hero__bg {
    z-index: 0;
}

.tft-hero .tft-hero__scroll {
    z-index: 3;
}

/* Page header particles - very subtle */
.tft-page-header {
    position: relative;
    overflow: hidden;
}

.tft-page-header .tft-particles-canvas {
    opacity: 0.4;
    pointer-events: none;
}

.tft-page-header .tft-container {
    position: relative;
    z-index: 2;
}

/* On mobile, reduce particle canvas to save performance */
@media (max-width: 768px) {
    .tft-particles-canvas {
        pointer-events: none;
    }
}

/* ==========================================================================
   SCROLL ANIMATIONS (con data-animate)
   ========================================================================== */

/* Estado inicial: invisible */
[data-animate] {
    opacity: 0;
    transition: 
        opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
}

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

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

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

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

/* Fade In */
[data-animate="fade-in"] {
    transform: scale(0.96);
}

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

/* Estado visible: animado */
[data-animate].animated {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
}

/* Delays */
[data-delay="50"] { transition-delay: 50ms; }
[data-delay="100"] { transition-delay: 100ms; }
[data-delay="150"] { transition-delay: 150ms; }
[data-delay="200"] { transition-delay: 200ms; }
[data-delay="250"] { transition-delay: 250ms; }
[data-delay="300"] { transition-delay: 300ms; }
[data-delay="350"] { transition-delay: 350ms; }
[data-delay="400"] { transition-delay: 400ms; }
[data-delay="450"] { transition-delay: 450ms; }
[data-delay="500"] { transition-delay: 500ms; }
[data-delay="600"] { transition-delay: 600ms; }
[data-delay="700"] { transition-delay: 700ms; }
[data-delay="800"] { transition-delay: 800ms; }

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

/* Button hover ripple */
.tft-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.25) 0%, transparent 70%);
    opacity: 0;
    transform: scale(0);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: inherit;
}

.tft-btn:active::after {
    opacity: 1;
    transform: scale(2);
    transition: 0s;
}

/* Card lift effect */
.tft-card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Link underline animation */
.tft-link-animated {
    position: relative;
    display: inline-block;
}

.tft-link-animated::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--tft-red);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tft-link-animated:hover::after {
    width: 100%;
}

/* ==========================================================================
   PREFERS-REDUCED-MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    [data-animate] {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    
    .tft-wa-float__pulse,
    .tft-hero__scroll-wheel,
    .tft-hero__badge-dot {
        animation: none !important;
    }

    .tft-particles-canvas {
        display: none !important;
    }
}
