.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

.popup-container {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    width: auto;
    animation: popupSlideIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform: scale(0.8);
    transition: transform 0.4s ease;
}

.popup-overlay.show .popup-container {
    transform: scale(1);
}

@keyframes popupSlideIn {
    0% {
        transform: scale(0.5) translateY(-50px);
        opacity: 0;
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.popup-content {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

.popup-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 20px;
}

.popup-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 3px solid white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.popup-close:hover {
    transform: rotate(90deg) scale(1.1);
    background: linear-gradient(135deg, #3a3182 0%, #eaa521 100%);
    box-shadow: 0 8px 30px rgba(58, 49, 130, 0.5);
}

.popup-close svg {
    color: white;
    width: 20px;
    height: 20px;
}

/* Responsive Popup Styles */
@media (max-width: 768px) {
    .popup-container {
        max-width: 95%;
    }

    .popup-close {
        top: -10px;
        right: -10px;
        width: 40px;
        height: 40px;
    }

    .popup-close svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .popup-container {
        max-width: 98%;
    }

    .popup-close {
        width: 35px;
        height: 35px;
    }

    .popup-close svg {
        width: 16px;
        height: 16px;
    }
}