/* Popup banner. CSS ini ada di file template, bukan di isi modul,
   supaya editor visual Joomla tidak menghapusnya saat gambar diganti. */
#popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 999999;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#popup-overlay.show {
    display: flex;
    opacity: 1;
}

#popup-content {
    position: relative;
    background-color: #ffffff;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    width: 95%;
    max-width: 1200px;
    max-height: 90vh;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#popup-content.loaded {
    opacity: 1;
    transform: scale(1);
}

.popup-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 4px solid #f3f3f3;
    border-top: 4px solid #115c45;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: pa-popup-spin 1s linear infinite;
    z-index: 2;
}

@keyframes pa-popup-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

#popup-img {
    width: 100%;
    height: auto;
    max-height: calc(90vh - 70px);
    object-fit: contain;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

#popup-img.loaded {
    opacity: 1;
}

.popup-footer {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 5px 2px 5px;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
    font-size: 13px;
    color: #444;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.popup-footer.loaded {
    opacity: 1;
}

.popup-footer label {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
}

.popup-footer input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: #115c45;
}

.popup-countdown {
    font-size: 13px;
    color: #888;
    text-align: right;
}

.popup-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 38px;
    height: 38px;
    padding: 0;
    background-color: #ffffff;
    color: #333333;
    border: 2px solid #333333;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 26px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
}

.popup-close.loaded {
    opacity: 1;
    pointer-events: auto;
}

.popup-close:hover {
    background-color: #e74c3c;
    color: #ffffff;
    border-color: #e74c3c;
    transform: scale(1.1);
}

@media (max-width: 650px) {
    .popup-footer {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .popup-countdown {
        text-align: center;
    }

    .popup-close {
        width: 34px;
        height: 34px;
        top: -12px;
        right: -12px;
        font-size: 24px;
    }
}
