/**
 * SEMES - Animaciones y Efectos Avanzados
 * Equipos y Suministros Médicos
 */

/* ========================================
   EFECTOS DE FONDO HERO
   ======================================== */
.hero-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(56, 189, 248, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(6, 182, 212, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(10, 106, 191, 0.08) 0%, transparent 50%);
    pointer-events: none;
    animation: pulse 15s ease-in-out infinite;
}

/* Patrón de puntos */
.hero-background::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.5;
}

/* ========================================
   EFECTOS DE GLASSMORPHISM
   ======================================== */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px 0 rgba(10, 106, 191, 0.1);
}

.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 32px 0 rgba(10, 106, 191, 0.06);
    border-radius: var(--radius-xl);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    box-shadow: 0 16px 48px rgba(10, 106, 191, 0.12);
    border-color: rgba(56, 189, 248, 0.3);
}

/* Glass dark variant for dark backgrounds */
.glass-dark {
    background: rgba(12, 45, 87, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

/* ========================================
   EFECTOS DE HOVER AVANZADOS
   ======================================== */
.hover-lift {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(10, 106, 191, 0.12);
}

.hover-glow {
    position: relative;
    transition: all 0.4s ease;
}

.hover-glow::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-sky));
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
    filter: blur(12px);
}

.hover-glow:hover::before {
    opacity: 0.6;
}

/* ========================================
   ANIMACIONES DE ENTRADA
   ======================================== */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
}

.fade-in-down {
    opacity: 0;
    transform: translateY(-30px);
    animation: fadeInDown 0.6s ease forwards;
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
    animation: slideInLeft 0.6s ease forwards;
}

.fade-in-right {
    opacity: 0;
    transform: translateX(30px);
    animation: slideInRight 0.6s ease forwards;
}

.scale-in {
    opacity: 0;
    transform: scale(0.9);
    animation: scaleIn 0.6s ease forwards;
}

/* Delays escalonados */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }

/* ========================================
   EFECTOS DE TEXTO
   ======================================== */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-sky));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-glow {
    text-shadow: 
        0 0 10px rgba(56, 189, 248, 0.4),
        0 0 20px rgba(56, 189, 248, 0.2),
        0 0 30px rgba(56, 189, 248, 0.1);
}

.text-shimmer {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.8) 0%,
        rgba(255, 255, 255, 1) 50%,
        rgba(255, 255, 255, 0.8) 100%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

/* ========================================
   LOADING Y SKELETON
   ======================================== */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(56, 189, 248, 0.05) 25%,
        rgba(56, 189, 248, 0.1) 50%,
        rgba(56, 189, 248, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(56, 189, 248, 0.2);
    border-top-color: var(--primary-sky);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   EFECTOS DE SCROLL
   ======================================== */
.parallax {
    transform: translateZ(0);
    will-change: transform;
}

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   EFECTOS DE BOTONES
   ======================================== */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-ripple:active::after {
    width: 300px;
    height: 300px;
}

.btn-shine {
    position: relative;
    overflow: hidden;
}

.btn-shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.25),
        transparent
    );
    transition: left 0.5s;
}

.btn-shine:hover::before {
    left: 100%;
}

/* ========================================
   EFECTOS DE IMAGEN
   ======================================== */
.image-zoom {
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.image-zoom img {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-zoom:hover img {
    transform: scale(1.08);
}

.image-tilt {
    transition: transform 0.4s ease;
}

.image-tilt:hover {
    transform: perspective(1000px) rotateX(3deg) rotateY(3deg);
}

/* ========================================
   EFECTOS DE SOMBRA
   ======================================== */
.shadow-soft {
    box-shadow: 0 2px 8px rgba(10, 106, 191, 0.06);
}

.shadow-medium {
    box-shadow: 0 4px 16px rgba(10, 106, 191, 0.08);
}

.shadow-hard {
    box-shadow: 0 8px 32px rgba(10, 106, 191, 0.12);
}

.shadow-colored {
    box-shadow: 0 8px 32px rgba(56, 189, 248, 0.15);
}

.shadow-colored-hover:hover {
    box-shadow: 0 12px 48px rgba(56, 189, 248, 0.25);
}

/* ========================================
   EFECTOS DE BORDE
   ======================================== */
.border-gradient {
    position: relative;
    background: white;
}

.border-gradient::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-sky));
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
}

/* ========================================
   PARTÍCULAS DECORATIVAS
   ======================================== */
@keyframes floatParticle {
    0%, 100% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translate(var(--tx, 100px), var(--ty, -200px)) rotate(360deg); opacity: 0; }
}

@keyframes orbitGlow {
    0% { transform: rotate(0deg) translateX(150px) rotate(0deg); }
    100% { transform: rotate(360deg) translateX(150px) rotate(-360deg); }
}

/* ========================================
   UTILIDADES DE ANIMACIÓN
   ======================================== */
.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-bounce {
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(-25%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-glow {
    animation: glowPulse 3s ease-in-out infinite;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .hero-section::after {
        display: none;
    }
    
    .glass-effect,
    .glass-card,
    .glass-dark {
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
}

/* ========================================
   REDUCED MOTION
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
