/**
 * Sistema de Pop-ups - POLICON
 * Estilos para pop-ups dinâmicos
 */

/* Overlay base */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.popup-overlay.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Container base do pop-up */
.popup-container {
    position: relative;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.3s ease;
}

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

/* Tamanhos */
.popup-container.size-small {
    width: 300px;
    max-width: 300px;
}

.popup-container.size-medium {
    width: 500px;
    max-width: 500px;
}

.popup-container.size-large {
    width: 700px;
    max-width: 700px;
}

.popup-container.size-fullscreen {
    width: 95vw;
    height: 95vh;
    max-width: 95vw;
    max-height: 95vh;
}

/* Tipos de pop-up */

/* Modal (padrão) - estilos já definidos acima */

/* Banner */
.popup-type-banner {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 9998;
}

.popup-type-banner.position-top {
    top: 0;
    transform: translateY(-100%);
}

.popup-type-banner.position-bottom {
    bottom: 0;
    transform: translateY(100%);
}

.popup-type-banner.show {
    transform: translateY(0);
}

/* Slide */
.popup-type-slide {
    position: fixed;
    top: 0;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    z-index: 9998;
}

.popup-type-slide.position-left {
    left: 0;
    transform: translateX(-100%);
}

.popup-type-slide.position-right {
    right: 0;
    transform: translateX(100%);
}

.popup-type-slide.show {
    transform: translateX(0);
}

/* Corner */
.popup-type-corner {
    position: fixed;
    z-index: 9998;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    max-width: 350px;
    width: 350px;
}

.popup-type-corner.position-top-left {
    top: 20px;
    left: 20px;
    transform: translate(-100%, -100%);
}

.popup-type-corner.position-top-right {
    top: 20px;
    right: 20px;
    transform: translate(100%, -100%);
}

.popup-type-corner.position-bottom-left {
    bottom: 20px;
    left: 20px;
    transform: translate(-100%, 100%);
}

.popup-type-corner.position-bottom-right {
    bottom: 20px;
    right: 20px;
    transform: translate(100%, 100%);
}

.popup-type-corner.show {
    transform: translate(0, 0);
}

/* Conteúdo do pop-up */
.popup-content {
    padding: 0;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.popup-header {
    padding: 20px 20px 0 20px;
    flex-shrink: 0;
}

.popup-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.popup-subtitle {
    font-size: 1rem;
    color: #666;
    margin: 0 0 15px 0;
    line-height: 1.4;
}

.popup-body {
    padding: 0 20px;
    flex: 1;
    overflow-y: auto;
}

.popup-text {
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 20px 0;
    color: #333;
}

.popup-image {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 0 0 15px 0;
    display: block;
}

.popup-footer {
    padding: 0 20px 20px 20px;
    flex-shrink: 0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
}

/* Botões */
.popup-button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    min-width: 100px;
    justify-content: center;
}

.popup-button-primary {
    background: #007bff;
    color: white;
}

.popup-button-primary:hover {
    background: #0056b3;
    color: white;
    text-decoration: none;
}

.popup-button-secondary {
    background: #6c757d;
    color: white;
}

.popup-button-secondary:hover {
    background: #545b62;
    color: white;
    text-decoration: none;
}

/* Botão de fechar */
.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    border: none;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #666;
    transition: all 0.2s ease;
    z-index: 10;
}

.popup-close:hover {
    background: rgba(0, 0, 0, 0.2);
    color: #333;
}

.popup-close::before {
    content: '×';
    font-size: 20px;
    line-height: 1;
}

/* Animações */

/* Fade */
.popup-animation-fade .popup-container {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Slide */
.popup-animation-slide.popup-type-modal .popup-container {
    transform: translateY(-50px) scale(0.8);
}

.popup-animation-slide.show .popup-container {
    transform: translateY(0) scale(1);
}

/* Zoom */
.popup-animation-zoom .popup-container {
    transform: scale(0.5);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.popup-animation-zoom.show .popup-container {
    transform: scale(1);
}

/* Bounce */
.popup-animation-bounce .popup-container {
    transform: scale(0.3);
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.3s ease;
}

.popup-animation-bounce.show .popup-container {
    transform: scale(1);
}

/* Sem animação */
.popup-animation-none .popup-container {
    transition: none;
    transform: scale(1);
    opacity: 1;
}

/* Estados especiais */

/* Loading */
.popup-loading {
    pointer-events: none;
}

.popup-loading .popup-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.popup-loading .popup-content::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: popup-spin 1s linear infinite;
    z-index: 11;
}

@keyframes popup-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsividade */
@media (max-width: 768px) {
    .popup-container {
        max-width: 95vw;
        max-height: 95vh;
        margin: 10px;
    }
    
    .popup-container.size-small,
    .popup-container.size-medium,
    .popup-container.size-large {
        width: 95vw;
        max-width: 95vw;
    }
    
    .popup-type-corner {
        max-width: calc(100vw - 40px);
        width: calc(100vw - 40px);
    }
    
    .popup-type-corner.position-top-left,
    .popup-type-corner.position-bottom-left {
        left: 10px;
    }
    
    .popup-type-corner.position-top-right,
    .popup-type-corner.position-bottom-right {
        right: 10px;
    }
    
    .popup-header {
        padding: 15px 15px 0 15px;
    }
    
    .popup-body {
        padding: 0 15px;
    }
    
    .popup-footer {
        padding: 0 15px 15px 15px;
        flex-direction: column;
    }
    
    .popup-button {
        width: 100%;
        margin: 5px 0;
    }
    
    .popup-title {
        font-size: 1.3rem;
    }
    
    .popup-subtitle {
        font-size: 0.9rem;
    }
    
    .popup-text {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .popup-type-banner {
        font-size: 0.85rem;
    }
    
    .popup-type-corner {
        max-width: calc(100vw - 20px);
        width: calc(100vw - 20px);
    }
    
    .popup-type-corner.position-top-left,
    .popup-type-corner.position-bottom-left {
        left: 10px;
    }
    
    .popup-type-corner.position-top-right,
    .popup-type-corner.position-bottom-right {
        right: 10px;
    }
    
    .popup-type-corner.position-top-left,
    .popup-type-corner.position-top-right {
        top: 10px;
    }
    
    .popup-type-corner.position-bottom-left,
    .popup-type-corner.position-bottom-right {
        bottom: 10px;
    }
}

/* Acessibilidade */
@media (prefers-reduced-motion: reduce) {
    .popup-container,
    .popup-overlay {
        transition: none;
        animation: none;
    }
    
    .popup-animation-bounce .popup-container,
    .popup-animation-zoom .popup-container,
    .popup-animation-slide .popup-container {
        transition: none;
        transform: scale(1);
    }
}

/* Modo escuro */
@media (prefers-color-scheme: dark) {
    .popup-container {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .popup-subtitle {
        color: #a0aec0;
    }
    
    .popup-text {
        color: #e2e8f0;
    }
    
    .popup-close {
        background: rgba(255, 255, 255, 0.1);
        color: #e2e8f0;
    }
    
    .popup-close:hover {
        background: rgba(255, 255, 255, 0.2);
    }
}

/* Utilitários */
.popup-hidden {
    display: none !important;
}

.popup-no-scroll {
    overflow: hidden;
}

/* Efeitos especiais */
.popup-glow {
    box-shadow: 0 0 30px rgba(0, 123, 255, 0.3);
}

.popup-shadow-lg {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

/* Customizações para tipos específicos */
.popup-newsletter {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.popup-newsletter .popup-title,
.popup-newsletter .popup-text {
    color: white;
}

.popup-newsletter .popup-subtitle {
    color: rgba(255, 255, 255, 0.8);
}

.popup-promo {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.popup-promo .popup-title,
.popup-promo .popup-text {
    color: white;
}

.popup-promo .popup-subtitle {
    color: rgba(255, 255, 255, 0.9);
}

.popup-warning {
    border-left: 5px solid #ffc107;
    background: #fff3cd;
    color: #856404;
}

.popup-success {
    border-left: 5px solid #28a745;
    background: #d4edda;
    color: #155724;
}

.popup-info {
    border-left: 5px solid #17a2b8;
    background: #d1ecf1;
    color: #0c5460;
}

.popup-error {
    border-left: 5px solid #dc3545;
    background: #f8d7da;
    color: #721c24;
}