/* Just Popup - Frontend Styles */

.just-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.just-popup-overlay.show {
    opacity: 1;
}

.just-popup-container {
    position: relative;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transform: scale(0.8);
    transition: transform 0.3s ease-in-out;
    max-width: 90vw;
    max-height: 90vh;
}

.just-popup-overlay.show .just-popup-container {
    transform: scale(1);
}

/* Posicionamiento */
.just-popup-center {
    position: relative;
}

.just-popup-top-left {
    position: absolute;
    top: 20px;
    left: 20px;
    margin: 0;
}

.just-popup-top-right {
    position: absolute;
    top: 20px;
    right: 20px;
    margin: 0;
}

.just-popup-bottom-left {
    position: absolute;
    bottom: 20px;
    left: 20px;
    margin: 0;
}

.just-popup-bottom-right {
    position: absolute;
    bottom: 20px;
    right: 20px;
    margin: 0;
}

/* Para posiciones en esquinas, ajustar el overlay */
.just-popup-overlay:has(.just-popup-top-left),
.just-popup-overlay:has(.just-popup-top-right),
.just-popup-overlay:has(.just-popup-bottom-left),
.just-popup-overlay:has(.just-popup-bottom-right) {
    align-items: stretch;
    justify-content: stretch;
    background-color: transparent;
    pointer-events: none;
}

.just-popup-overlay:has(.just-popup-top-left) .just-popup-container,
.just-popup-overlay:has(.just-popup-top-right) .just-popup-container,
.just-popup-overlay:has(.just-popup-bottom-left) .just-popup-container,
.just-popup-overlay:has(.just-popup-bottom-right) .just-popup-container {
    pointer-events: all;
}

/* Botón de cerrar */
.just-popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: inherit;
    z-index: 1;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.just-popup-close:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.just-popup-close span {
    line-height: 1;
}

/* Contenido del popup */
.just-popup-content {
    padding: 20px;
    height: 100%;
    box-sizing: border-box;
    overflow-y: auto;
}

.just-popup-text {
    line-height: 1.6;
}

.just-popup-text h1,
.just-popup-text h2,
.just-popup-text h3,
.just-popup-text h4,
.just-popup-text h5,
.just-popup-text h6 {
    margin-top: 0;
}

.just-popup-image {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.just-popup-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.just-popup-html {
    height: 100%;
}

/* Botones dentro del popup */
.just-popup-content .button,
.just-popup-content .btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #0073aa;
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.just-popup-content .button:hover,
.just-popup-content .btn:hover {
    background-color: #005a87;
    color: #ffffff;
}

/* Enlaces dentro del popup */
.just-popup-content a {
    color: inherit;
    text-decoration: underline;
}

.just-popup-content a:hover {
    text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
    .just-popup-container {
        max-width: 95vw;
        max-height: 80vh;
        margin: 10px;
    }
    
    .just-popup-top-left,
    .just-popup-top-right {
        top: 10px;
    }
    
    .just-popup-top-left,
    .just-popup-bottom-left {
        left: 10px;
    }
    
    .just-popup-top-right,
    .just-popup-bottom-right {
        right: 10px;
    }
    
    .just-popup-bottom-left,
    .just-popup-bottom-right {
        bottom: 10px;
    }
    
    .just-popup-content {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .just-popup-content {
        padding: 10px;
    }
    
    .just-popup-close {
        top: 5px;
        right: 10px;
    }
}

/* Animaciones adicionales */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideInFromTop {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideInFromBottom {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Clases para animaciones específicas */
.just-popup-top-left .just-popup-content,
.just-popup-top-right .just-popup-content {
    animation: slideInFromTop 0.3s ease-out;
}

.just-popup-bottom-left .just-popup-content,
.just-popup-bottom-right .just-popup-content {
    animation: slideInFromBottom 0.3s ease-out;
}

.just-popup-top-right .just-popup-content,
.just-popup-bottom-right .just-popup-content {
    animation: slideInFromRight 0.3s ease-out;
}

.just-popup-top-left .just-popup-content,
.just-popup-bottom-left .just-popup-content {
    animation: slideInFromLeft 0.3s ease-out;
}

.just-popup-center .just-popup-content {
    animation: fadeIn 0.3s ease-out;
}