/**
 * MT Popup Builder — Frontend Styles
 * Minimal structural CSS. Content styling comes from the editor.
 * @author Fernando Mazur
 * @version 1.0.0
 */

/* Overlay */
.mt-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: mtPopupFadeIn 0.2s ease;
}

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

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

/* Container */
.mt-popup-container {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    z-index: 9999;
    max-width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-sizing: border-box;
    animation: mtPopupZoomIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Fullscreen */
.mt-popup-container--fullscreen {
    max-width: 100vw;
    max-height: 100vh;
    width: 100%;
    height: 100%;
    border-radius: 0;
}

/* Slide-in */
.mt-popup-container--slide_in {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
    animation: mtPopupSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes mtPopupSlideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* Top bar */
.mt-popup-container--top_bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 100vw;
    border-radius: 0;
    animation: mtPopupSlideDown 0.3s ease;
    z-index: 9999;
}

@keyframes mtPopupSlideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

/* Bottom bar */
.mt-popup-container--bottom_bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: 100vw;
    border-radius: 0;
    animation: mtPopupSlideUp 0.3s ease;
    z-index: 9999;
}

@keyframes mtPopupSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* Toast */
.mt-popup-container--toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    max-width: 400px;
    border-radius: 10px;
    animation: mtPopupToastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 9999;
}

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

/* Close button */
.mt-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.06);
    color: #4a5568;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    transition: background 0.15s ease, color 0.15s ease;
    z-index: 10000;
}

.mt-popup-close:hover {
    background: rgba(0, 0, 0, 0.12);
    color: #1a202c;
}

/* Focus trap / accessibility */
.mt-popup-container:focus {
    outline: none;
}

.mt-popup-container *:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Body scroll lock when popup is open */
body.mt-popup-open {
    overflow: hidden;
}
