/* Nimbus Pop-up - Estilos Frontend */

/* Overlay do pop-up */
.nimbus-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.nimbus-popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Conteúdo do pop-up */
.nimbus-popup-content {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    margin: 20px;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

/* Pop-up apenas com imagem - fundo transparente */
.nimbus-popup-content.image-only {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}

.nimbus-popup-overlay.show .nimbus-popup-content {
    transform: scale(1);
}

/* Tamanhos do pop-up */
.nimbus-popup-content.small {
    width: 400px;
    max-width: 90vw;
}

.nimbus-popup-content.medium {
    width: 600px;
    max-width: 90vw;
}

.nimbus-popup-content.large {
    width: 800px;
    max-width: 95vw;
}

.nimbus-popup-content.full {
    width: 95vw;
    max-width: 95vw;
}

/* Conteúdo interno */
.nimbus-popup-inner {
    padding: 30px;
    text-align: center;
}

/* Botão de fechar */
.nimbus-popup-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.nimbus-popup-close:hover {
    color: #333;
}

/* Imagem do pop-up */
.nimbus-popup-image {
    margin-bottom: 20px;
}

.nimbus-popup-image img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

/* Título */
.nimbus-popup-title {
    margin: 0 0 15px 0;
    font-size: 24px;
    font-weight: bold;
    line-height: 1.3;
}

/* Texto do conteúdo */
.nimbus-popup-text {
    margin-bottom: 25px;
    line-height: 1.6;
}

.nimbus-popup-text p {
    margin: 0 0 15px 0;
}

.nimbus-popup-text p:last-child {
    margin-bottom: 0;
}

/* Botões */
.nimbus-popup-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

.nimbus-popup-button {
    display: inline-block;
    padding: 12px 24px;
    background: #007cba;
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 16px;
    line-height: 1;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    min-width: 140px;
    text-align: center;
}

.nimbus-popup-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 124, 186, 0.4);
    text-decoration: none;
    color: #ffffff;
}

.nimbus-popup-button:focus {
    outline: 2px solid #005a87;
    outline-offset: 2px;
}

/* Responsividade para tablets */
@media (max-width: 768px) {
    .nimbus-popup-content.responsive {
        width: 95vw !important;
        max-width: 95vw !important;
        margin: 10px;
    }
    
    .nimbus-popup-inner {
        padding: 25px 20px;
    }
    
    .nimbus-popup-title {
        font-size: 22px;
    }
    
    .nimbus-popup-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .nimbus-popup-button {
        width: 100%;
        min-width: auto;
    }
}

/* Responsividade para mobile */
@media (max-width: 480px) {
    .nimbus-popup-overlay {
        padding: 10px;
    }
    
    .nimbus-popup-content.responsive {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }
    
    /* Pop-up apenas imagem no mobile */
    .nimbus-popup-content.image-only.responsive {
        width: 95% !important;
        max-width: 95% !important;
        margin: 10px auto;
    }
    
    .nimbus-popup-inner {
        padding: 20px 15px;
    }
    
    .nimbus-popup-content.image-only .nimbus-popup-inner {
        padding: 0;
    }
    
    .nimbus-popup-close {
        top: 10px;
        right: 15px;
        font-size: 24px;
    }
    
    .nimbus-popup-close.image-close {
        top: 15px;
        right: 15px;
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    
    .nimbus-popup-title {
        font-size: 20px;
        margin-bottom: 12px;
    }
    
    .nimbus-popup-text {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    .nimbus-popup-button {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Prevenção de scroll no body quando pop-up está aberto */
body.nimbus-popup-open {
    overflow: hidden;
}

/* Animações de entrada */
@keyframes fadeInOverlay {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translate(-50%, 100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

/* Estados de carregamento */
.nimbus-popup-loading {
    pointer-events: none;
}

.nimbus-popup-loading .nimbus-popup-content {
    opacity: 0.7;
}

/* Acessibilidade */
.nimbus-popup-overlay:focus-within {
    outline: none;
}

.nimbus-popup-content {
    outline: none;
}

/* Para temas que podem interferir */
.nimbus-popup-overlay * {
    box-sizing: border-box;
}

.nimbus-popup-content a {
    color: inherit;
}

.nimbus-popup-content h1,
.nimbus-popup-content h2,
.nimbus-popup-content h3,
.nimbus-popup-content h4,
.nimbus-popup-content h5,
.nimbus-popup-content h6 {
    margin: 0 0 15px 0;
    line-height: 1.3;
}

/* Evita conflitos com outros estilos */
.nimbus-popup-overlay,
.nimbus-popup-overlay * {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Scroll personalizado para conteúdo longo */
.nimbus-popup-content::-webkit-scrollbar {
    width: 8px;
}

.nimbus-popup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.nimbus-popup-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.nimbus-popup-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Estados especiais para diferentes tipos de conteúdo */
.nimbus-popup-content.image-only .nimbus-popup-inner {
    padding: 0;
    position: relative;
}

.nimbus-popup-content.image-only .nimbus-popup-image {
    margin: 0;
    position: relative;
}

.nimbus-popup-content.image-only .nimbus-popup-image img {
    border-radius: 8px;
    width: 100%;
    display: block;
}

/* Imagem clicável */
.nimbus-popup-image.clickable-image .image-link {
    display: block;
    text-decoration: none;
    border: none;
    outline: none;
}

.nimbus-popup-image.clickable-image img {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.nimbus-popup-image.clickable-image img:hover {
    opacity: 0.95;
}

/* Botão fechar para imagens - posicionado atrás da imagem */
.nimbus-popup-close.image-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 18px;
    z-index: 5;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.nimbus-popup-close.image-close:hover {
    background: rgba(0, 0, 0, 0.8);
    color: #ffffff;
}

/* Suporte para dark mode */
@media (prefers-color-scheme: dark) {
    .nimbus-popup-content {
        background: #2c3e50;
        color: #ecf0f1;
    }
    
    .nimbus-popup-close {
        color: #bdc3c7;
    }
    
    .nimbus-popup-close:hover {
        color: #ecf0f1;
    }
}