/* Modal Popup Plugin CSS */

/* Overlay */
.modal-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-in-out;
}

/* Container */
.modal-popup-container {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    margin: 20px;
    animation: slideIn 0.3s ease-in-out;
}

/* Content */
.modal-popup-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Close Button */
.modal-popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    font-size: 24px;
    font-weight: bold;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.modal-popup-close:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* Images */
.modal-popup-image {
    width: 100%;
    height: auto;
    display: block;
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

/* Desktop Image - Show on desktop, hide on mobile */
.modal-popup-desktop-image {
    display: block;
}

/* Mobile Image - Hide on desktop, show on mobile */
.modal-popup-mobile-image {
    display: none;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .modal-popup-container {
        max-width: 95%;
        max-height: 95%;
        margin: 10px;
    }
    
    .modal-popup-content {
        border-radius: 4px;
    }
    
    .modal-popup-close {
        top: 8px;
        right: 12px;
        width: 30px;
        height: 30px;
        font-size: 20px;
    }
    
    /* Hide desktop image on mobile */
    .modal-popup-desktop-image {
        display: none;
    }
    
    /* Show mobile image on mobile */
    .modal-popup-mobile-image {
        display: block;
    }
    
    .modal-popup-image {
        max-height: 85vh;
    }
}

@media screen and (max-width: 480px) {
    .modal-popup-container {
        max-width: 98%;
        max-height: 98%;
        margin: 5px;
    }
    
    .modal-popup-close {
        top: 5px;
        right: 8px;
        width: 28px;
        height: 28px;
        font-size: 18px;
    }
    
    .modal-popup-image {
        max-height: 90vh;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: scale(0.8) translateY(-50px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Fade out animation */
.modal-popup-overlay.fade-out {
    animation: fadeOut 0.3s ease-in-out forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Slide out animation */
.modal-popup-container.slide-out {
    animation: slideOut 0.3s ease-in-out forwards;
}

@keyframes slideOut {
    from {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
    to {
        transform: scale(0.8) translateY(-50px);
        opacity: 0;
    }
}

/* Prevent body scroll when modal is open */
body.modal-popup-open {
    overflow: hidden;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .modal-popup-overlay {
        background-color: rgba(0, 0, 0, 0.95);
    }
    
    .modal-popup-content {
        border: 2px solid #000;
    }
    
    .modal-popup-close {
        background: #000;
        border: 2px solid #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .modal-popup-overlay,
    .modal-popup-container,
    .modal-popup-close {
        animation: none;
        transition: none;
    }
}
