/* ========================================
   ADVANCED ANIMATIONS & EFFECTS
   Animaciones avanzadas para la web
   ======================================== */

/* ========================================
   SCROLL REVEAL ANIMATIONS
   ======================================== */

/* Base para elementos animados */
[data-animate] {
    opacity: 1;
    transform: none;
}

/* ========================================
   GRADIENT TEXT ANIMATION
   ======================================== */

.gradient-text-animated {
    background: linear-gradient(
        90deg,
        #ffffff 0%,
        rgba(79, 209, 197, 1) 25%,
        #ffffff 50%,
        rgba(79, 209, 197, 1) 75%,
        #ffffff 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 4s ease-in-out infinite;
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% center;
    }
    50% {
        background-position: 100% center;
    }
}

/* ========================================
   TYPING EFFECT
   ======================================== */

.typing-text {
    overflow: hidden;
    border-right: 2px solid rgba(79, 209, 197, 0.8);
    white-space: nowrap;
    animation: typing 3.5s 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: rgba(79, 209, 197, 0.8);
    }
}

/* ========================================
   CARD 3D ENHANCED
   ======================================== */

.card-3d-enhanced {
    position: relative;
    transition: transform 0.2s ease;
    transform-style: preserve-3d;
}

/* Efecto de brillo que sigue el mouse */
.card-3d-enhanced::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(79, 209, 197, 0.15),
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.card-3d-enhanced:hover::before {
    opacity: 1;
}

/* Borde con gradiente animado */
.card-3d-enhanced::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(
        var(--angle, 0deg),
        rgba(79, 209, 197, 0.5),
        rgba(79, 209, 197, 0.1),
        rgba(79, 209, 197, 0.5)
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.card-3d-enhanced:hover::after {
    opacity: 1;
    animation: border-glow 3s linear infinite;
}

@keyframes border-glow {
    0% {
        --angle: 0deg;
    }
    100% {
        --angle: 360deg;
    }
}

/* ========================================
   PARALLAX LAYERS
   ======================================== */

.parallax-layer {
    transition: transform 0.3s ease-out;
    will-change: transform;
}

.parallax-slow {
    transform: translateZ(-1px) scale(1.1);
}

.parallax-medium {
    transform: translateZ(-0.5px) scale(1.05);
}

.parallax-fast {
    transform: translateZ(0);
}

/* ========================================
   RIPPLE EFFECT
   ======================================== */

.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(79, 209, 197, 0.35);
    transform: scale(0);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple {
    from {
        transform: scale(0);
        opacity: 1;
    }
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ========================================
   ANIMATED UNDERLINE
   ======================================== */

.animated-underline {
    position: relative;
    text-decoration: none;
}

.animated-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), rgba(79, 209, 197, 0.5));
    transition: width 0.3s ease;
}

.animated-underline:hover::after {
    width: 100%;
}

/* ========================================
   ICON HOVER ANIMATIONS
   ======================================== */

.icon-bounce:hover {
    animation: bounce-icon 0.5s ease;
}

@keyframes bounce-icon {
    0%, 100% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(-8px);
    }
    50% {
        transform: translateY(-4px);
    }
    75% {
        transform: translateY(-6px);
    }
}

.icon-rotate:hover {
    animation: rotate-icon 0.6s ease;
}

@keyframes rotate-icon {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.icon-shake:hover {
    animation: shake-icon 0.5s ease;
}

@keyframes shake-icon {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.icon-pulse:hover {
    animation: pulse-icon 1s ease infinite;
}

@keyframes pulse-icon {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* ========================================
   COUNTER ANIMATION
   ======================================== */

.counter {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

/* ========================================
   BUTTON ENHANCEMENTS
   ======================================== */

.btn-shimmer {
    position: relative;
    overflow: hidden;
}

.btn-shimmer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.5s ease;
}

.btn-shimmer:hover::before {
    left: 100%;
}

/* ========================================
   GLOWING ELEMENTS
   ======================================== */

.glow-on-hover {
    transition: all 0.3s ease;
}

.glow-on-hover:hover {
    box-shadow: 
        0 0 20px rgba(79, 209, 197, 0.4),
        0 0 40px rgba(79, 209, 197, 0.2),
        0 0 60px rgba(79, 209, 197, 0.1);
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    [data-animate],
    .gradient-text-animated,
    .typing-text,
    .card-3d-enhanced,
    .parallax-layer {
        animation: none !important;
        transition: none !important;
    }
}
