/**
 * Mi Mensaje Flotante - Frontend Styles
 * Estilos premium con glassmorphism y animaciones suaves
 */

/* Variables CSS */
:root {
    --mmf-animation-duration: 0.4s;
    --mmf-animation-timing: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Overlay */
.mmf-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--mmf-animation-duration) var(--mmf-animation-timing),
        visibility var(--mmf-animation-duration) var(--mmf-animation-timing);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.mmf-overlay.mmf-active {
    opacity: 1;
    visibility: visible;
}

/* Modal */
.mmf-modal {
    position: relative;
    max-width: 480px;
    width: 100%;
    border-radius: 24px;
    overflow: hidden;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: transform var(--mmf-animation-duration) var(--mmf-animation-timing),
        opacity var(--mmf-animation-duration) var(--mmf-animation-timing);
}

.mmf-overlay.mmf-active .mmf-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Botón cerrar */
.mmf-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
    color: inherit;
}

.mmf-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.mmf-close:active {
    transform: scale(0.95);
}

.mmf-close svg {
    width: 20px;
    height: 20px;
}

/* Imagen */
.mmf-image {
    width: 100%;
    max-height: 220px;
    overflow: hidden;
}

.mmf-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Contenido */
.mmf-content {
    padding: 28px 32px 32px;
    text-align: center;
}

.mmf-title {
    margin: 0 0 12px;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.mmf-text {
    margin: 0 0 24px;
    font-size: 1rem;
    line-height: 1.6;
    opacity: 0.9;
}

.mmf-text p {
    margin: 0 0 12px;
}

.mmf-text p:last-child {
    margin-bottom: 0;
}

/* Botón CTA */
.mmf-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.mmf-button::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;
}

.mmf-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.mmf-button:hover::before {
    left: 100%;
}

.mmf-button:active {
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 540px) {
    .mmf-overlay {
        padding: 16px;
    }

    .mmf-modal {
        border-radius: 20px;
    }

    .mmf-content {
        padding: 24px;
    }

    .mmf-title {
        font-size: 1.5rem;
    }

    .mmf-text {
        font-size: 0.95rem;
    }

    .mmf-button {
        padding: 12px 28px;
        font-size: 0.95rem;
        width: 100%;
    }

    .mmf-close {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
    }
}

/* Animación de entrada especial */
@keyframes mmf-pulse {

    0%,
    100% {
        box-shadow:
            0 25px 50px -12px rgba(0, 0, 0, 0.4),
            0 0 0 1px rgba(255, 255, 255, 0.1) inset,
            0 0 0 0 rgba(255, 255, 255, 0.2);
    }

    50% {
        box-shadow:
            0 25px 50px -12px rgba(0, 0, 0, 0.4),
            0 0 0 1px rgba(255, 255, 255, 0.1) inset,
            0 0 0 10px rgba(255, 255, 255, 0);
    }
}

.mmf-overlay.mmf-active .mmf-modal {
    animation: mmf-pulse 2s ease-in-out 0.5s;
}

/* Soporte para prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {

    .mmf-overlay,
    .mmf-modal,
    .mmf-close,
    .mmf-button {
        transition: none;
    }

    .mmf-overlay.mmf-active .mmf-modal {
        animation: none;
    }
}