/* ════════════════════════════════════════════════════════════════════════════
   DARS-ON | ANIMACIONES ÉPICAS CSS
   Complemento visual para animaciones GSAP
   ════════════════════════════════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════════════════════════════════
   KEYFRAMES FUNDAMENTALES
   ════════════════════════════════════════════════════════════════════════════ */

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(60px); }
    to { opacity: 1; transform: translateX(0); }
}

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

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulseGlow {
    0%, 100% { 
        opacity: 0.6; 
        transform: scale(1);
        filter: blur(0px);
    }
    50% { 
        opacity: 1; 
        transform: scale(1.1);
        filter: blur(2px);
    }
}

@keyframes spinRing {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

@keyframes floatBadge1 {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50% { transform: translateY(-12px) rotate(3deg); }
}

@keyframes floatBadge2 {
    0%, 100% { transform: translateY(0) rotate(3deg); }
    50% { transform: translateY(12px) rotate(-3deg); }
}

@keyframes floatBadge3 {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-8px) rotate(2deg); }
}

@keyframes scrollBounce {
    0%, 100% { transform: rotate(45deg) translateY(0); opacity: 1; }
    50% { transform: rotate(45deg) translateY(8px); opacity: 0.4; }
}

@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-10px) rotate(3deg);
    }
    50% {
        transform: translateY(-18px) rotate(5deg);
    }
    75% {
        transform: translateY(-10px) rotate(3deg);
    }
}

@keyframes pulse {
    0%, 100% {
        filter: drop-shadow(0 0 25px rgba(139, 92, 246, 0.6));
        transform: scale(1);
    }
    50% {
        filter: drop-shadow(0 0 50px rgba(236, 72, 153, 0.9));
        transform: scale(1.05);
    }
}

@keyframes gradientFlow {
    0%, 100% {
        background-position: 0% 50%;
        filter: hue-rotate(0deg);
    }
    50% {
        background-position: 100% 50%;
        filter: hue-rotate(30deg);
    }
}

@keyframes gradientShift {
    0%, 100% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(50px, 50px);
    }
    50% {
        transform: translate(100px, 100px);
    }
    75% {
        transform: translate(50px, 50px);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateX(200%);
        opacity: 0;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(60px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes auraGlow {
    0%, 100% {
        box-shadow: 0 0 30px rgba(139, 92, 246, 0.4),
                    0 0 60px rgba(139, 92, 246, 0.2);
    }
    50% {
        box-shadow: 0 0 50px rgba(139, 92, 246, 0.6),
                    0 0 100px rgba(139, 92, 246, 0.3);
    }
}

@keyframes colorBounce {
    0%, 100% {
        transform: translateY(0) scale(1);
        box-shadow: 0 10px 35px rgba(0,0,0,0.5), 0 0 25px currentColor;
    }
    50% {
        transform: translateY(-15px) scale(1.05);
        box-shadow: 0 20px 50px rgba(0,0,0,0.6), 0 0 40px currentColor;
    }
}

@keyframes shineWave {
    0% {
        transform: translateX(-100%) skewX(-15deg);
    }
    100% {
        transform: translateX(200%) skewX(-15deg);
    }
}

@keyframes borderGlow {
    0%, 100% {
        border-color: rgba(139, 92, 246, 0.5);
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
    }
    50% {
        border-color: rgba(236, 72, 153, 0.8);
        box-shadow: 0 0 40px rgba(236, 72, 153, 0.5);
    }
}

@keyframes textGlow {
    0%, 100% {
        text-shadow: 0 0 10px currentColor;
    }
    50% {
        text-shadow: 0 0 20px currentColor, 0 0 40px currentColor;
    }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes glitch {
    0%, 100% {
        transform: translate(0);
    }
    20% {
        transform: translate(-2px, 2px);
    }
    40% {
        transform: translate(-2px, -2px);
    }
    60% {
        transform: translate(2px, 2px);
    }
    80% {
        transform: translate(2px, -2px);
    }
}

@keyframes neonPulse {
    0%, 100% {
        box-shadow: 
            0 0 5px rgba(139, 92, 246, 0.5),
            0 0 10px rgba(139, 92, 246, 0.3),
            inset 0 0 5px rgba(139, 92, 246, 0.1);
    }
    50% {
        box-shadow: 
            0 0 20px rgba(139, 92, 246, 0.8),
            0 0 40px rgba(139, 92, 246, 0.5),
            0 0 60px rgba(139, 92, 246, 0.3),
            inset 0 0 20px rgba(139, 92, 246, 0.2);
    }
}

@keyframes breathe {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.02);
        opacity: 1;
    }
}

@keyframes rotate3d {
    0% {
        transform: rotateY(0deg);
    }
    100% {
        transform: rotateY(360deg);
    }
}

/* ════════════════════════════════════════════════════════════════════════════
   ANIMACIONES DE ENTRADA DE SECCIONES
   ════════════════════════════════════════════════════════════════════════════ */

.section-animate {
    opacity: 0;
    transform: translateY(60px) scale(0.95);
    transition: opacity 0.8s cubic-bezier(0.23, 1, 0.32, 1), 
                transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
    will-change: transform, opacity;
}

.section-animate.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ════════════════════════════════════════════════════════════════════════════
   ANIMACIONES MODAL DE PRODUCTO
   ════════════════════════════════════════════════════════════════════════════ */

@keyframes pmFadeIn {
    from { opacity: 0; backdrop-filter: blur(0px); }
    to   { opacity: 1; backdrop-filter: blur(10px); }
}

@keyframes pmSlideUp {
    from { 
        opacity: 0; 
        transform: translateY(40px) scale(0.95);
    }
    to   { 
        opacity: 1; 
        transform: translateY(0) scale(1);
    }
}

@keyframes pmScaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ════════════════════════════════════════════════════════════════════════════
   TRANSICIONES ENTRE PÁGINAS
   ════════════════════════════════════════════════════════════════════════════ */

/* El body empieza INVISIBLE — GSAP lo hace visible */
body {
    opacity: 0;
}

/* ════════════════════════════════════════════════════════════════════════════
   EFECTOS ESPECIALES
   ════════════════════════════════════════════════════════════════════════════ */

/* Efecto de resplandor en hover */
.glow-effect {
    position: relative;
}

.glow-effect::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, 
        rgba(139, 92, 246, 0.5), 
        rgba(236, 72, 153, 0.5),
        rgba(139, 92, 246, 0.5));
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    filter: blur(10px);
}

.glow-effect:hover::before {
    opacity: 1;
}

/* Efecto de borde brillante */
.border-glow {
    animation: borderGlow 2s ease-in-out infinite;
}

/* Efecto de texto brillante */
.text-glow {
    animation: textGlow 2s ease-in-out infinite;
}

/* Efecto de outline animado */
.outline-animation {
    position: relative;
}

.outline-animation::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(90deg, 
        var(--primary), 
        var(--accent), 
        var(--secondary),
        var(--primary));
    background-size: 300% 100%;
    animation: gradientFlow 3s linear infinite;
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

/* ════════════════════════════════════════════════════════════════════════════
   ANIMACIONES DE HOVER AMPLIADAS
   ════════════════════════════════════════════════════════════════════════════ */

/* Servicio Card Hover */
.service-card {
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.service-card:hover {
    transform: translateY(-12px) scale(1.03);
    box-shadow: 
        0 25px 60px rgba(139, 92, 246, 0.3),
        0 0 40px rgba(139, 92, 246, 0.15);
    border-color: var(--secondary);
}

/* Product Card Hover */
.product-card {
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-style: preserve-3d;
    perspective: 1000px;
}

.product-card:hover {
    transform: translateY(-15px) scale(1.05);
    box-shadow: 
        0 30px 70px rgba(139, 92, 246, 0.35),
        0 0 50px rgba(139, 92, 246, 0.2);
    border-color: var(--accent);
}

.product-card:hover::before {
    opacity: 1;
    height: 3px;
}

/* Filament Card Hover */
.filament-card {
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.filament-card:hover {
    transform: translateY(-10px) scale(1.08);
    box-shadow: 
        0 20px 50px rgba(139, 92, 246, 0.4),
        0 0 30px rgba(236, 72, 153, 0.2);
}

.filament-card:hover .filament-color {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5), 0 0 25px currentColor;
}

/* Machine Card Hover */
.machine-card {
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.machine-card:hover {
    transform: translateY(-12px) scale(1.03);
    box-shadow: 
        0 25px 60px rgba(139, 92, 246, 0.35),
        0 0 40px rgba(139, 92, 246, 0.15);
}

/* ════════════════════════════════════════════════════════════════════════════
   ANIMACIONES DE ELEMENTOS DECORATIVOS
   ════════════════════════════════════════════════════════════════════════════ */

/* Orbit ring animation */
.hero-orbit {
    transform-origin: center center;
}

.hero-orbit::before {
    animation: pulse 2s ease-in-out infinite;
}

/* Glow background pulse */
.hero-glow-bg {
    animation: breathe 4s ease-in-out infinite;
}

/* Center box float */
.hero-center-box {
    animation: floatCore 5s ease-in-out infinite;
}

/* ════════════════════════════════════════════════════════════════════════════
   RESPONSIVE ANIMATIONS
   ════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .section-animate {
        transform: translateY(40px) scale(0.98);
    }
    
    .section-animate.visible {
        transform: translateY(0) scale(1);
    }
}

/* ════════════════════════════════════════════════════════════════════════════
   UTILIDADES DE ANIMACIÓN
   ════════════════════════════════════════════════════════════════════════════ */

.animate-fadeIn {
    animation: fadeIn 0.6s ease forwards;
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease forwards;
}

.animate-fadeInDown {
    animation: fadeInDown 0.6s ease forwards;
}

.animate-fadeInRight {
    animation: fadeInRight 0.6s ease forwards;
}

.animate-slideUp {
    animation: slideUp 0.6s ease forwards;
}

.animate-scaleIn {
    animation: pmScaleIn 0.5s ease forwards;
}

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

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

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

/* Delays para stagger */
.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; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }
