/* ===== SISTEMA DE ANIMACIONES NATIVO (Reemplaza AOS) ===== */

/* Variables para animaciones */
:root {
    --animation-duration: 0.8s;
    --animation-easing: cubic-bezier(0.4, 0, 0.2, 1);
    --animation-distance: 30px;
}

/* ===== ANIMACIONES PRINCIPALES ===== */

/* Fade In Up */
.fade-in-up {
    opacity: 0;
    transform: translateY(var(--animation-distance));
    transition: opacity var(--animation-duration) var(--animation-easing),
                transform var(--animation-duration) var(--animation-easing);
}

.fade-in-up.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Fade In Down */
.fade-in-down {
    opacity: 0;
    transform: translateY(calc(-1 * var(--animation-distance)));
    transition: opacity var(--animation-duration) var(--animation-easing),
                transform var(--animation-duration) var(--animation-easing);
}

.fade-in-down.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Fade In Left */
.fade-in-left {
    opacity: 0;
    transform: translateX(calc(-1 * var(--animation-distance)));
    transition: opacity var(--animation-duration) var(--animation-easing),
                transform var(--animation-duration) var(--animation-easing);
}

.fade-in-left.animate {
    opacity: 1;
    transform: translateX(0);
}

/* Fade In Right */
.fade-in-right {
    opacity: 0;
    transform: translateX(var(--animation-distance));
    transition: opacity var(--animation-duration) var(--animation-easing),
                transform var(--animation-duration) var(--animation-easing);
}

.fade-in-right.animate {
    opacity: 1;
    transform: translateX(0);
}

/* Zoom In */
.zoom-in {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity var(--animation-duration) var(--animation-easing),
                transform var(--animation-duration) var(--animation-easing);
}

.zoom-in.animate {
    opacity: 1;
    transform: scale(1);
}

/* Zoom Out */
.zoom-out {
    opacity: 0;
    transform: scale(1.2);
    transition: opacity var(--animation-duration) var(--animation-easing),
                transform var(--animation-duration) var(--animation-easing);
}

.zoom-out.animate {
    opacity: 1;
    transform: scale(1);
}

/* Flip Left */
.flip-left {
    opacity: 0;
    transform: perspective(400px) rotateY(90deg);
    transition: opacity var(--animation-duration) var(--animation-easing),
                transform var(--animation-duration) var(--animation-easing);
}

.flip-left.animate {
    opacity: 1;
    transform: perspective(400px) rotateY(0deg);
}

/* Flip Right */
.flip-right {
    opacity: 0;
    transform: perspective(400px) rotateY(-90deg);
    transition: opacity var(--animation-duration) var(--animation-easing),
                transform var(--animation-duration) var(--animation-easing);
}

.flip-right.animate {
    opacity: 1;
    transform: perspective(400px) rotateY(0deg);
}

/* Slide In Up */
.slide-in-up {
    opacity: 0;
    transform: translateY(100%);
    transition: opacity var(--animation-duration) var(--animation-easing),
                transform var(--animation-duration) var(--animation-easing);
}

.slide-in-up.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Slide In Down */
.slide-in-down {
    opacity: 0;
    transform: translateY(-100%);
    transition: opacity var(--animation-duration) var(--animation-easing),
                transform var(--animation-duration) var(--animation-easing);
}

.slide-in-down.animate {
    opacity: 1;
    transform: translateY(0);
}

/* ===== DELAYS PARA ANIMACIONES ESCALONADAS ===== */
.delay-100 { transition-delay: 0.1s !important; }
.delay-200 { transition-delay: 0.2s !important; }
.delay-300 { transition-delay: 0.3s !important; }
.delay-400 { transition-delay: 0.4s !important; }
.delay-500 { transition-delay: 0.5s !important; }
.delay-600 { transition-delay: 0.6s !important; }
.delay-700 { transition-delay: 0.7s !important; }
.delay-800 { transition-delay: 0.8s !important; }
.delay-900 { transition-delay: 0.9s !important; }
.delay-1000 { transition-delay: 1s !important; }

/* ===== ANIMACIONES DE KEYFRAMES ===== */

/* Animaciones para elementos específicos */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(5px) rotate(270deg);
    }
}

/* Animación de ondas */
@keyframes wave {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

/* Animación de pulso */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Animación de brillo */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(74, 144, 226, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(74, 144, 226, 0.6);
    }
}

/* Animación de latido */
@keyframes heartbeat {
    0%, 14%, 28%, 42%, 70% {
        transform: scale(1);
    }
    7%, 21%, 35% {
        transform: scale(1.1);
    }
}

/* Animación de rotación suave */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Animación de balanceo */
@keyframes swing {
    0%, 100% {
        transform: rotate(0deg);
    }
    20% {
        transform: rotate(15deg);
    }
    40% {
        transform: rotate(-10deg);
    }
    60% {
        transform: rotate(5deg);
    }
    80% {
        transform: rotate(-5deg);
    }
}

/* Animación de rebote */
@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translateY(0);
    }
    40%, 43% {
        transform: translateY(-30px);
    }
    70% {
        transform: translateY(-15px);
    }
    90% {
        transform: translateY(-4px);
    }
}

/* Animación de escritura */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* Animación de aparición de línea */
@keyframes drawLine {
    from {
        stroke-dashoffset: 1000;
    }
    to {
        stroke-dashoffset: 0;
    }
}

/* Animación de contador */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animación de onda gradiente */
@keyframes gradientWave {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Animación de partículas de fondo */
@keyframes particleMove {
    0% {
        transform: translateY(0px) translateX(0px);
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(-100px) translateX(50px);
        opacity: 0;
    }
}

/* ===== BURBUJAS ANIMADAS ===== */
.bubbles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 2;
    pointer-events: none;
}

.bubble {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    bottom: -100px;
    animation: bubble-rise linear infinite;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    pointer-events: none;
    backdrop-filter: blur(1px);
}

@keyframes bubble-rise {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* ===== CLASES DE UTILIDAD PARA ANIMACIONES ===== */
.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out both;
}

.animate-fade-in-down {
    animation: fadeInDown 0.6s ease-out both;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.6s ease-out both;
}

.animate-fade-in-right {
    animation: fadeInRight 0.6s ease-out both;
}

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

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

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

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

.animate-float-2 {
    animation: float2 8s ease-in-out infinite;
}

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

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

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

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

.animate-heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

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

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

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

/* ===== EFECTOS DE HOVER AVANZADOS ===== */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

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

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

.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(74, 144, 226, 0.5);
}

.hover-blur {
    transition: filter 0.3s ease;
}

.hover-blur:hover {
    filter: blur(2px);
}

/* ===== EFECTOS DE TEXTO ===== */
.text-gradient {
    background: linear-gradient(135deg, #4A90E2, #7BB3F0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientWave 3s ease-in-out infinite;
    background-size: 200% 200%;
}

.text-shadow-glow {
    text-shadow: 0 0 20px rgba(74, 144, 226, 0.5);
}

.text-typing {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid #4A90E2;
    animation: typing 3s steps(40, end), blink 1s step-end infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ===== EFECTOS DE CARGA ===== */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(74, 144, 226, 0.3);
    border-top: 4px solid #4A90E2;
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(5, end) infinite;
}

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

/* ===== EFECTOS DE ENTRADA PARA ELEMENTOS ===== */
.slide-in-left {
    transform: translateX(-100%);
    transition: transform 0.6s ease-out;
}

.slide-in-left.animate {
    transform: translateX(0);
}

.slide-in-right {
    transform: translateX(100%);
    transition: transform 0.6s ease-out;
}

.slide-in-right.animate {
    transform: translateX(0);
}

/* ===== EFECTOS DE MORPHING ===== */
.morph-circle {
    border-radius: 50%;
    transition: border-radius 0.5s ease;
}

.morph-circle:hover {
    border-radius: 20%;
}

.morph-square {
    border-radius: 0;
    transition: border-radius 0.5s ease;
}

.morph-square:hover {
    border-radius: 20px;
}

/* ===== EFECTOS DE ONDAS ===== */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:hover::before {
    width: 300px;
    height: 300px;
}

/* ===== OPTIMIZACIONES ESPECÍFICAS ===== */

/* Prevenir saltos de layout */
.hero-title .typing-effect {
    min-width: 280px;
    display: inline-block;
    vertical-align: top;
}

/* Suavizar transiciones de entrada */
.loaded * {
    transition-duration: 0.6s !important;
}

/* Estados de carga */
.loading-state {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease-out;
}

.loading-state.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* ===== RESPONSIVE ANIMATIONS ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .bubble {
        display: none;
    }
}

@media (max-width: 768px) {
    :root {
        --animation-duration: 0.4s;
        --animation-distance: 20px;
    }
    
    .bubble {
        max-width: 50px;
        max-height: 50px;
    }
    
    .animate-fade-in-up,
    .animate-fade-in-down,
    .animate-fade-in-left,
    .animate-fade-in-right {
        animation-duration: 0.4s;
    }
    
    .hover-lift:hover {
        transform: translateY(-5px);
    }
}

/* ===== OPTIMIZACIONES DE PERFORMANCE ===== */
.service-card,
.tip-card,
.advice-card {
    will-change: transform;
}

.service-card:hover,
.tip-card:hover,
.advice-card:hover {
    will-change: auto;
}

/* Contener animaciones para mejor rendimiento */
.animate {
    contain: layout style paint;
}

/* Aceleración por hardware */
.fade-in-up,
.fade-in-down,
.fade-in-left,
.fade-in-right,
.zoom-in,
.zoom-out,
.flip-left,
.flip-right {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* ===== ESTILOS PARA COMPATIBILIDAD ===== */

/* Para elementos que usaban data-aos */
[data-animate="fade-up"] {
    opacity: 0;
    transform: translateY(var(--animation-distance));
    transition: opacity var(--animation-duration) var(--animation-easing),
                transform var(--animation-duration) var(--animation-easing);
}

[data-animate="fade-up"].animate {
    opacity: 1;
    transform: translateY(0);
}

[data-animate="fade-left"] {
    opacity: 0;
    transform: translateX(calc(-1 * var(--animation-distance)));
    transition: opacity var(--animation-duration) var(--animation-easing),
                transform var(--animation-duration) var(--animation-easing);
}

[data-animate="fade-left"].animate {
    opacity: 1;
    transform: translateX(0);
}

[data-animate="fade-right"] {
    opacity: 0;
    transform: translateX(var(--animation-distance));
    transition: opacity var(--animation-duration) var(--animation-easing),
                transform var(--animation-duration) var(--animation-easing);
}

[data-animate="fade-right"].animate {
    opacity: 1;
    transform: translateX(0);
}

[data-animate="zoom-in"] {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity var(--animation-duration) var(--animation-easing),
                transform var(--animation-duration) var(--animation-easing);
}

[data-animate="zoom-in"].animate {
    opacity: 1;
    transform: scale(1);
}

[data-animate="flip-left"] {
    opacity: 0;
    transform: perspective(400px) rotateY(90deg);
    transition: opacity var(--animation-duration) var(--animation-easing),
                transform var(--animation-duration) var(--animation-easing);
}

[data-animate="flip-left"].animate {
    opacity: 1;
    transform: perspective(400px) rotateY(0deg);
} translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    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);
    }
    to {
        opacity: 1;
        transform: perspective(400px) rotateX(0deg);
    }
}

@keyframes flipInY {
    from {
        opacity: 0;
        transform: perspective(400px) rotateY(90deg);
    }
    to {
        opacity: 1;
        transform: perspective(400px) rotateY(0deg);
    }
}

/* ===== ANIMACIONES DE PARTÍCULAS FLOTANTES ===== */
@keyframes float1 {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-20px) rotate(120deg);
    }
    66% {
        transform: translateY(10px) rotate(240deg);
    }
}

@keyframes float2 {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-15px) rotate(180deg);
    }
}

@keyframes float3 {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-10px) rotate(90deg);
    }
    75% {
        transform: