/* ========================================
   LIQUID MORPHING BUTTON - VERSIÓN DISRUPTIVA
   ======================================== */

/* Contenedor principal del botón líquido */
.splash-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.2rem 3rem;
    background: transparent;
    color: #1a1a1a;
    border: none;
    border-radius: 50px;
    font-family: 'EB Garamond', serif;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    overflow: visible;
    letter-spacing: 0.02em;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.2, 0, 0.2, 1);
}

/* Capa de fondo líquido con gradiente metalizado cromado y transparencia visible */
.splash-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        rgba(192, 192, 192, 0.45),
        rgba(232, 232, 232, 0.55),
        rgba(168, 168, 168, 0.4),
        rgba(212, 212, 212, 0.5),
        rgba(184, 184, 184, 0.45),
        rgba(192, 192, 192, 0.45)
    );
    background-size: 300% 300%;
    border-radius: 50px;
    z-index: -1;
    animation: liquidFlow 4s ease-in-out infinite;
    filter: blur(0px);
    transition: all 0.6s cubic-bezier(0.2, 0, 0.2, 1);
    box-shadow: inset 0 1px 4px rgba(255, 255, 255, 0.7),
                inset 0 -1px 4px rgba(0, 0, 0, 0.15),
                0 4px 12px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

/* Efecto de "derretimiento" en los bordes - Reducido y más sutil */
.splash-btn::after {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(45deg,
        rgba(192, 192, 192, 0.25),
        rgba(232, 232, 232, 0.2),
        rgba(168, 168, 168, 0.25),
        rgba(212, 212, 212, 0.2),
        rgba(184, 184, 184, 0.22)
    );
    background-size: 400% 400%;
    border-radius: 50px;
    z-index: -2;
    animation: liquidBorder 3s ease-in-out infinite, morphing 6s ease-in-out infinite;
    filter: blur(4px);
    opacity: 0.4;
}

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

/* Animación de borde líquido */
@keyframes liquidBorder {
    0%, 100% {
        background-position: 0% 50%;
        border-radius: 50px;
    }
    25% {
        border-radius: 45% 55% 48% 52% / 52% 48% 52% 48%;
    }
    50% {
        background-position: 100% 50%;
        border-radius: 55% 45% 52% 48% / 48% 52% 48% 52%;
    }
    75% {
        border-radius: 48% 52% 45% 55% / 52% 48% 52% 48%;
    }
}

/* Morphing orgánico del botón */
@keyframes morphing {
    0%, 100% {
        border-radius: 50px;
        transform: scale(1);
    }
    33% {
        border-radius: 45% 55% 48% 52% / 52% 48% 52% 48%;
        transform: scale(1.02);
    }
    66% {
        border-radius: 55% 45% 52% 48% / 48% 52% 48% 52%;
        transform: scale(0.98);
    }
}

/* Hover state - Sutil y sin brillo excesivo */
.splash-btn:hover::before {
    animation: liquidFlow 2s ease-in-out infinite;
    filter: blur(0px);
    box-shadow: inset 0 1px 5px rgba(255, 255, 255, 0.8),
                inset 0 -1px 5px rgba(0, 0, 0, 0.3),
                0 4px 15px rgba(0, 0, 0, 0.25);
}

.splash-btn:hover::after {
    animation: liquidBorder 1.5s ease-in-out infinite, morphing 3s ease-in-out infinite;
    filter: blur(5px);
    opacity: 0.5;
}

.splash-btn:hover {
    transform: translateY(-2px);
}

/* Partículas eliminadas para diseño más limpio */

/* Texto del botón con mejor espaciado */
.btn-text {
    position: relative;
    z-index: 1;
    display: inline-block;
    transition: all 0.3s ease;
    letter-spacing: 0.08em;
    font-weight: 500;
}

/* Contenedor para caracteres flotantes */
.btn-text-morphing {
    display: inline-flex;
    gap: 0.15em;
}

.btn-text-morphing .char {
    display: inline-block;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Hover en caracteres - flotación individual */
.splash-btn:hover .btn-text-morphing .char {
    animation: floatChar 0.6s ease-in-out;
}

.splash-btn:hover .btn-text-morphing .char:nth-child(1) { animation-delay: 0s; }
.splash-btn:hover .btn-text-morphing .char:nth-child(2) { animation-delay: 0.05s; }
.splash-btn:hover .btn-text-morphing .char:nth-child(3) { animation-delay: 0.1s; }
.splash-btn:hover .btn-text-morphing .char:nth-child(4) { animation-delay: 0.15s; }
.splash-btn:hover .btn-text-morphing .char:nth-child(5) { animation-delay: 0.2s; }
.splash-btn:hover .btn-text-morphing .char:nth-child(6) { animation-delay: 0.25s; }
.splash-btn:hover .btn-text-morphing .char:nth-child(7) { animation-delay: 0.3s; }
.splash-btn:hover .btn-text-morphing .char:nth-child(8) { animation-delay: 0.35s; }
.splash-btn:hover .btn-text-morphing .char:nth-child(9) { animation-delay: 0.4s; }
.splash-btn:hover .btn-text-morphing .char:nth-child(10) { animation-delay: 0.45s; }
.splash-btn:hover .btn-text-morphing .char:nth-child(11) { animation-delay: 0.5s; }
.splash-btn:hover .btn-text-morphing .char:nth-child(12) { animation-delay: 0.55s; }
.splash-btn:hover .btn-text-morphing .char:nth-child(13) { animation-delay: 0.6s; }
.splash-btn:hover .btn-text-morphing .char:nth-child(14) { animation-delay: 0.65s; }
.splash-btn:hover .btn-text-morphing .char:nth-child(15) { animation-delay: 0.7s; }
.splash-btn:hover .btn-text-morphing .char:nth-child(16) { animation-delay: 0.75s; }
.splash-btn:hover .btn-text-morphing .char:nth-child(17) { animation-delay: 0.8s; }
.splash-btn:hover .btn-text-morphing .char:nth-child(18) { animation-delay: 0.85s; }

/* Animación de flotación de caracteres */
@keyframes floatChar {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-8px) scale(1.1);
    }
}

/* Icono del botón - Sin animación que cause saltos */
.btn-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease-out;
    opacity: 0.9;
    will-change: transform;
}

.splash-btn:hover .btn-icon {
    transform: translateX(4px);
    opacity: 1;
}

/* Efecto de absorción al click */
.splash-btn.absorbing {
    animation: absorb 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.splash-btn.absorbing::before,
.splash-btn.absorbing::after {
    animation: absorbGlow 0.8s ease-out forwards;
}

@keyframes absorb {
    0% {
        transform: translateY(-2px) scale(1);
    }
    50% {
        transform: translateY(-2px) scale(1.3);
    }
    100% {
        transform: translateY(-2px) scale(0);
        opacity: 0;
    }
}

@keyframes absorbGlow {
    0% {
        filter: blur(12px);
        opacity: 1;
    }
    50% {
        filter: blur(30px);
        opacity: 1;
        box-shadow: 0 0 100px rgba(232, 232, 232, 0.9),
                    0 0 50px rgba(255, 255, 255, 0.7);
    }
    100% {
        filter: blur(50px);
        opacity: 0;
        box-shadow: 0 0 200px rgba(192, 192, 192, 0);
    }
}

/* Ondas de energía al click - Cromadas */
.energy-wave {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border: 2px solid rgba(232, 232, 232, 0.9);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 1;
    animation: waveExpand 1s ease-out forwards;
    pointer-events: none;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.6),
                inset 0 0 10px rgba(192, 192, 192, 0.4);
}

@keyframes waveExpand {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .splash-btn {
        padding: 1rem 2.5rem;
        font-size: 1rem;
    }
}

/* Accessibility */
.splash-btn:focus {
    outline: 3px solid rgba(255, 215, 0, 0.6);
    outline-offset: 6px;
}

.splash-btn:focus:not(:focus-visible) {
    outline: none;
}

.splash-btn:focus-visible {
    outline: 3px solid rgba(255, 215, 0, 0.6);
    outline-offset: 6px;
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
    .splash-btn::before,
    .splash-btn::after,
    .particle {
        animation: none !important;
    }

    .splash-btn:hover .btn-text-morphing .char {
        animation: none !important;
    }

    .btn-icon {
        animation: none !important;
    }
}
