/**
 * Popup Builder & Maker Lite - Frontend Styles
 * Modern, lightweight, responsive popup
 */

.pbml-overlay,
.pbml-overlay * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.pbml-overlay {
    position: fixed;
    inset: 0;
    background: var(--pbml-overlay, rgba(15, 23, 42, 0.8));
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.pbml-overlay.pbml-active {
    opacity: 1;
    visibility: visible;
}

.pbml-modal {
    position: relative;
    background: var(--pbml-bg, #1e293b);
    border-radius: var(--pbml-radius, 20px);
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    transform: translateY(25px) scale(0.96);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}

.pbml-overlay.pbml-active .pbml-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.pbml-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pbml-close-color, #94a3b8);
    z-index: 20;
    opacity: 0;
    transition: all 0.25s ease;
    font-size: 24px;
    line-height: 1;
}

.pbml-close.pbml-visible {
    opacity: 1;
}

.pbml-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg) scale(1.1);
}

.pbml-image {
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.pbml-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    max-height: 220px;
}

.pbml-body {
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 18px;
}

.pbml-headline {
    font-size: var(--pbml-h-size, 28px);
    font-weight: 800;
    color: var(--pbml-h-color, #ffffff);
    line-height: 1.2;
    letter-spacing: -0.03em;
    text-transform: none !important;
}

.pbml-description {
    font-size: var(--pbml-d-size, 16px);
    line-height: 1.65;
    color: var(--pbml-d-color, #cbd5e1);
}

.pbml-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--pbml-btn-bg, #fbbf24);
    color: var(--pbml-btn-color, #1e293b) !important;
    font-size: 16px;
    font-weight: 700;
    padding: 16px 36px;
    border-radius: var(--pbml-btn-radius, 10px);
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px -3px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    border: none;
    margin-top: 8px;
}

.pbml-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.4);
    filter: brightness(1.1);
    color: var(--pbml-btn-color, #1e293b) !important;
}

@media screen and (max-width: 600px) {
    .pbml-modal {
        max-width: 95%;
    }

    .pbml-body {
        padding: 28px 24px;
        gap: 14px;
    }

    .pbml-headline {
        font-size: 22px;
    }

    .pbml-description {
        font-size: 14px;
    }

    .pbml-btn {
        width: 100%;
        padding: 14px;
    }

    .pbml-image img {
        max-height: 160px;
    }
}

/* Image Based Popup Support */
.pbml-modal.pbml-type-image {
    background: transparent;
    box-shadow: none;
    max-width: fit-content;
    width: auto;
    padding: 0;
}

.pbml-modal.pbml-type-image .pbml-image-only img {
    display: block;
    max-width: 100%;
    height: auto;
    max-height: 85vh;
    border-radius: var(--pbml-radius, 20px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.pbml-modal.pbml-type-image .pbml-close {
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    top: 10px;
    right: 10px;
}

.pbml-modal.pbml-type-image .pbml-close:hover {
    background: rgba(0, 0, 0, 0.8);
}