/* =========================================
   BYTE POPUP — PUBLIC CSS
   GrintByte Plugin
   ========================================= */

/* -------------------------
   OVERLAY (background layer)
   ------------------------- */
.bytepopup-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    background: rgba(0,0,0,0.55);
    opacity: 0;
    transition: opacity .25s ease;
    z-index: 999999999 !important;
    pointer-events: auto !important;
}

/* overlay aktif */
.bytepopup-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* -------------------------
   WRAPPER (flex container)
   ------------------------- */
.bytepopup-modal-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column; /* penting untuk posisi vertikal */
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.bytepopup-modal-wrapper,
.bytepopup-modal {
    pointer-events: auto !important;
    position: relative;
    z-index: 9999999999 !important;
}

/* -------------------------
   MODAL BOX
   ------------------------- */
.bytepopup-modal {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    max-width: 640px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    overflow-y: hidden;
    position: relative;
    transform-origin: center center;
    transition: transform .28s ease, opacity .28s ease;
}

/* close button */
.bytepopup-close {
    position: absolute;
    z-index: 99999999999 !important;
    pointer-events: auto !important;
    top: 8px;
    right: 10px;
    border: none;
    background: transparent;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}

/* -------------------------
   POSITIONS + SAFE SPACING
   ------------------------- */

/* center */
.position-center-center .bytepopup-modal-wrapper {
    justify-content: center;
    align-items: center;
}

/* top-left */
.position-top-left .bytepopup-modal-wrapper {
    justify-content: flex-start;
    align-items: flex-start;

    padding-top: 40px;
    padding-left: 40px;
}

/* top-right */
.position-top-right .bytepopup-modal-wrapper {
    justify-content: flex-start;
    align-items: flex-end;

    padding-top: 40px;
    padding-right: 40px;
}

/* bottom-left */
.position-bottom-left .bytepopup-modal-wrapper {
    justify-content: flex-end;
    align-items: flex-start;

    padding-bottom: 40px;
    padding-left: 40px;
}

/* bottom-right */
.position-bottom-right .bytepopup-modal-wrapper {
    justify-content: flex-end;
    align-items: flex-end;

    padding-bottom: 40px;
    padding-right: 40px;
}

/* -------------------------
   ANIMATIONS
   ------------------------- */

/* fade */
.bytepopup-modal.anim-fade {
    opacity: 0;
    transform: translateY(6px) scale(1);
}
.bytepopup-overlay.active .bytepopup-modal.anim-fade {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* slide up */
.bytepopup-modal.anim-slide {
    opacity: 0;
    transform: translateY(20px);
}
.bytepopup-overlay.active .bytepopup-modal.anim-slide {
    opacity: 1;
    transform: translateY(0);
}

/* zoom */
.bytepopup-modal.anim-zoom {
    opacity: 0;
    transform: scale(.92);
}
.bytepopup-overlay.active .bytepopup-modal.anim-zoom {
    opacity: 1;
    transform: scale(1);
}

/* closing animation */
.bytepopup-modal.anim-closing {
    opacity: 0 !important;
    transform: scale(.98) !important;
}

/* -------------------------
   RESPONSIVE
   ------------------------- */
@media (max-width: 480px) {
    .bytepopup-modal {
        margin: 10px;
        width: calc(100% - 20px);
    }
}


/* ==============================
   POPUP WRAPPER & POSITIONING
   ============================== */

.bytepopup-overlay {
    position: fixed !important;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px; /* memberi jarak dari tepi layar */
    z-index: 999999;
    pointer-events: auto !important;
}

/* ==============================
   POPUP CONTAINER
   ============================== */

.bytepopup-container {
    position: relative;
    background: #ffffff;
    max-width: 90vw;
    max-height: 90vh;
    padding: 20px; /* jarak dalam supaya tidak mepet */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: bytepopup-fadeIn 0.35s ease;
}

/* ==============================
   CONTENT FIT TO MODAL
   ============================== */

.bytepopup-content {
    max-height: calc(90vh - 100px);
    overflow-y: auto;
    overflow-x: hidden;
}

.bytepopup-content img,
.bytepopup-content iframe,
.bytepopup-content video {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

/* Scrollbar minimal */
.bytepopup-content::-webkit-scrollbar {
    width: 6px;
}
.bytepopup-content::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.25);
    border-radius: 6px;
}

/* ==============================
   SLIM & ELEGANT CLOSE BUTTON
   ============================== */

.bytepopup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    font-size: 22px;
    line-height: 1;
    padding: 0;
    border: none;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;

    color: #333;
    font-weight: 400;

    transition: background 0.25s ease, transform 0.25s ease;
}

/* Hover state */
.bytepopup-close:hover {
    background: rgba(0,0,0,0.08);
    transform: scale(1.07);
}

/* Focus accessible */
.bytepopup-close:focus {
    outline: 2px solid #007cba;
    outline-offset: 3px;
}

/* ==============================
   ANIMATIONS
   ============================== */

@keyframes bytepopup-fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes bytepopup-fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(20px); }
}
