/* ===================================
   IPN Website - Success Modal Popups
   Contact form success message modals
   =================================== */

/* Modal Overlay */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.popup-overlay.active {
    display: flex;
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

/* Ensure modal-open works with menu-open (mobile side panel) */
body.modal-open:not(.menu-open) {
    overflow: hidden;
    position: relative;
}

/* When both modal and menu are open, menu takes precedence for body positioning */
body.modal-open.menu-open {
    overflow: hidden !important;
    position: fixed !important;
}

/* Modal Content Container */
.popup-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    animation: popupFadeIn 0.3s ease-out;
}

/* Modal Image */
.popup-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Close Button */
.popup-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 45px;
    height: 45px;
    background: var(--ipn-primary);
    border: 3px solid white;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.popup-close:hover {
    background: var(--ipn-primary-dark);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Popup Fade In Animation */
@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===================================
   Desktop/Laptop (min-width: 1024px)
   =================================== */
@media (min-width: 1024px) {
    .popup-content {
        width: 70%;
        height: auto;
    }

    .popup-image {
        border-radius: 30px;
    }

    /* Show desktop image only */
    .popup-image.desktop {
        display: block;
    }

    .popup-image.tablet,
    .popup-image.mobile {
        display: none;
    }
}

/* ===================================
   Tablet (500px - 1023px)
   =================================== */
@media (min-width: 500px) and (max-width: 1023px) {
    .popup-content {
        width: 70%;
        height: auto;
    }

    .popup-image {
        border-radius: 30px;
    }

    /* Show tablet image only */
    .popup-image.tablet {
        display: block;
    }

    .popup-image.desktop,
    .popup-image.mobile {
        display: none;
    }
}

/* ===================================
   Mobile (max-width: 499px)
   =================================== */
@media (max-width: 499px) {
    .popup-content {
        width: auto;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .popup-image {
        border-radius: 30px;
        max-height: 100%;
        width: auto;
    }

    .popup-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    /* Show mobile image only */
    .popup-image.mobile {
        display: block;
    }

    .popup-image.desktop,
    .popup-image.tablet {
        display: none;
    }
}
