/**
 * Frontend Styles for Dimsum Juara Pop-up Banner
 */

/* Prevent scrolling when popup is active */
body.dj-popup-open {
    overflow: hidden !important;
}

/* Main Overlay Container */
.dj-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.dj-popup-overlay.dj-show {
    opacity: 1;
    visibility: visible;
}

/* Semi-transparent Backdrop */
.dj-popup-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
}

/* Modal Box Container */
.dj-popup-container {
    position: relative;
    z-index: 2;
    margin: 0 auto;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    background: transparent;
    transform: translateZ(0);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
    max-height: 88vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Animation Variants */
/* 1. Zoom / Scale */
.dj-anim-zoom .dj-popup-container {
    transform: scale(0.85);
    opacity: 0;
}
.dj-anim-zoom.dj-show .dj-popup-container {
    transform: scale(1);
    opacity: 1;
}

/* 2. Fade */
.dj-anim-fade .dj-popup-container {
    opacity: 0;
}
.dj-anim-fade.dj-show .dj-popup-container {
    opacity: 1;
}

/* 3. Slide Up */
.dj-anim-slide .dj-popup-container {
    transform: translateY(40px);
    opacity: 0;
}
.dj-anim-slide.dj-show .dj-popup-container {
    transform: translateY(0);
    opacity: 1;
}

/* Close Button */
.dj-popup-close {
    position: absolute;
    top: -16px;
    right: -16px;
    width: 40px;
    height: 40px;
    background: #ffffff;
    color: #1e293b;
    border: 2px solid #ffffff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
    z-index: 10;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.dj-popup-close:hover {
    background: #d93829;
    color: #ffffff;
    border-color: #d93829;
    transform: scale(1.08) rotate(90deg);
}

.dj-popup-close:focus-visible {
    outline: 2px solid #d93829;
    outline-offset: 2px;
}

/* Banner Content & Image */
.dj-popup-content {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: transparent;
    line-height: 0;
    max-height: inherit;
    width: auto;
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dj-popup-link {
    display: inline-block;
    cursor: pointer;
    line-height: 0;
    text-decoration: none;
    max-height: inherit;
    width: auto;
    max-width: 100%;
}

.dj-popup-image {
    width: auto;
    max-width: 92vw;
    height: auto;
    display: block;
    object-fit: contain;
    border-radius: 12px;
    user-select: none;
    -webkit-user-drag: none;
    margin: 0 auto;
}

/* Responsive on Mobile Screens */
@media (max-width: 640px) {
    .dj-popup-overlay {
        padding: 16px;
    }

    .dj-popup-close {
        top: -12px;
        right: -12px;
        width: 36px;
        height: 36px;
    }

    .dj-popup-close svg {
        width: 18px;
        height: 18px;
    }
}
