/* Popup System Styles */

/* Modal Popup */
.popup-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.popup-modal-content {
    background: #fff;
    border-radius: 8px;
    width: 500px;
    min-width: 300px;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* Modal dengan background transparan (untuk PNG) */
.popup-modal-content.transparent-bg {
    background: transparent;
    box-shadow: none;
}

.popup-modal-body {
    padding: 20px;
}

/* Body tanpa padding jika background transparan */
.popup-modal-content.transparent-bg .popup-modal-body {
    padding: 0;
}

.popup-modal-body img {
    max-width: 100%;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

.popup-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    text-align: center;
}

.popup-modal-footer label {
    margin: 0;
    font-weight: normal;
    cursor: pointer;
}

.popup-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.popup-close-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* Toast Popup */
.popup-toast {
    position: fixed;
    z-index: 9999;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 15px 20px;
    max-width: 400px;
    min-width: 300px;
    animation: slideInToast 0.3s ease-out;
}

.popup-toast-top-right {
    top: 20px;
    right: 20px;
}

.popup-toast-bottom-right {
    bottom: 20px;
    right: 20px;
}

.popup-toast-top-left {
    top: 20px;
    left: 20px;
}

.popup-toast-bottom-left {
    bottom: 20px;
    left: 20px;
}

.popup-toast-content {
    position: relative;
}

.popup-toast-content img {
    max-width: 100%;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}

@keyframes slideInToast {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide-in Popup */
.popup-slide {
    position: fixed;
    z-index: 9999;
    background: #fff;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    padding: 20px;
    transition: transform 0.3s ease-out;
}

.popup-slide-top {
    top: 0;
    left: 0;
    right: 0;
    transform: translateY(-100%);
}

.popup-slide-bottom {
    bottom: 0;
    left: 0;
    right: 0;
    transform: translateY(100%);
}

.popup-slide-right {
    top: 0;
    right: 0;
    bottom: 0;
    width: 300px;
    transform: translateX(100%);
}

.popup-slide-left {
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px;
    transform: translateX(-100%);
}

.popup-slide-active {
    transform: translate(0, 0) !important;
}

.popup-slide-content {
    position: relative;
}

.popup-slide-content img {
    max-width: 100%;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}

/* Responsive */
@media (max-width: 768px) {
    .popup-modal-content {
        width: 95%;
        min-width: 300px;
        max-width: 95%;
        max-height: 95vh;
    }

    .popup-toast {
        max-width: calc(100% - 40px);
        min-width: auto;
    }

    .popup-slide-right,
    .popup-slide-left {
        width: 100%;
    }
}

