/**
 * SYSPROVIDER Popup - Frontend Styles
 *
 * @author    SYSPROVIDER S.L.
 * @copyright 2024 SYSPROVIDER S.L.
 */

/* Overlay */
.sysp-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.sysp-popup-overlay.active {
    display: flex;
}

/* Container */
.sysp-popup-container {
    position: relative;
    background-color: #fff;
    max-width: 90%;
    max-height: 90vh;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.3s ease;
}

.sysp-popup-container.active {
    opacity: 1;
    transform: scale(1);
}

.sysp-popup-overlay.active .sysp-popup-container {
    opacity: 1;
    transform: scale(1);
}

/* Fullscreen */
.sysp-popup-container.sysp-fullscreen {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
}

/* Border Styles */
.sysp-popup-container.sysp-border-none {
    border-radius: 0;
}

.sysp-popup-container.sysp-border-sharp {
    border-radius: 0;
}

.sysp-popup-container.sysp-border-rounded {
    border-radius: 8px;
}

.sysp-popup-container.sysp-border-circle {
    border-radius: 20px;
}

/* Shadow Styles */
.sysp-popup-container.sysp-shadow-none {
    box-shadow: none;
}

.sysp-popup-container.sysp-shadow-light {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.sysp-popup-container.sysp-shadow-medium {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.sysp-popup-container.sysp-shadow-heavy {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

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

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

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.sysp-popup-container.sysp-animation-fade {
    animation: fadeIn 0.3s ease;
}

.sysp-popup-container.sysp-animation-slide-down {
    animation: slideDown 0.4s ease;
}

.sysp-popup-container.sysp-animation-slide-up {
    animation: slideUp 0.4s ease;
}

.sysp-popup-container.sysp-animation-zoom {
    animation: zoomIn 0.3s ease;
}

/* Close Button */
.sysp-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.sysp-popup-close:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.sysp-popup-close svg {
    width: 20px;
    height: 20px;
}

/* Content */
.sysp-popup-content {
    width: 100%;
    height: 100%;
}

.sysp-popup-link {
    display: block;
    width: 100%;
    height: 100%;
}

.sysp-popup-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.sysp-popup-container.sysp-fullscreen .sysp-popup-image {
    object-fit: cover;
}

/* Responsive */
@media (max-width: 768px) {
    .sysp-popup-container:not(.sysp-fullscreen) {
        max-width: 95%;
        max-height: 80vh;
    }
    
    .sysp-popup-close {
        width: 35px;
        height: 35px;
    }
}

@media (max-width: 480px) {
    .sysp-popup-overlay {
        padding: 10px;
    }
    
    .sysp-popup-container:not(.sysp-fullscreen) {
        max-width: 100%;
    }
}

/* Animación de cierre */
.sysp-popup-overlay.closing {
    animation: fadeOut 0.3s ease;
}

.sysp-popup-overlay.closing .sysp-popup-container {
    animation: zoomOut 0.3s ease;
}

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

@keyframes zoomOut {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0.8);
        opacity: 0;
    }
}
