/* ============================================================================
   SISTEMA DE ACEITAÇÃO DE COOKIES/PRIVACIDADE - DESIGN MODERNO
   ============================================================================
   
   Características:
   - Glassmorphism elegante e profissional
   - Harmonização automática de cores (via JavaScript)
   - Responsividade total (desktop → mobile ≥360px)
   - Animações suaves e acessíveis
   - Overlay sutil para foco
   
   Compatibilidade: Multi-cliente (genérico para todos os cartórios)
   Criado: 09/11/2025
   ============================================================================ */

/* ============================================================================
   OVERLAY DE FUNDO
   ============================================================================ */
.cookie-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 2147483646; /* Abaixo do container */
    opacity: 0;
    animation: fadeInOverlay 0.4s ease-out forwards;
}

@keyframes fadeInOverlay {
    to {
        opacity: 1;
    }
}

/* Animação de fechamento */
@keyframes slideOutDown {
    from {
        transform: translateX(-50%) translateY(0) scale(1);
        opacity: 1;
    }
    to {
        transform: translateX(-50%) translateY(150px) scale(0.8);
        opacity: 0;
    }
}

@keyframes fadeOutOverlay {
    from {
        opacity: 1;
        backdrop-filter: blur(2px);
    }
    to {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
}

.cookie-consent-closing {
    animation: slideOutDown 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards !important;
}

.cookie-overlay-closing {
    animation: fadeOutOverlay 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards !important;
}

/* ============================================================================
   CONTAINER PRINCIPAL
   ============================================================================ */
.cookie-consent-container {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    z-index: 2147483647; /* Máximo z-index */
    
    /* Dimensões */
    width: 90%;
    max-width: 580px;
    min-height: 200px;
    
    /* Glassmorphism */
    background: rgba(35, 35, 35, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    
    /* Bordas e sombras */
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    
    /* Espaçamento interno */
    padding: 32px;
    
    /* Animação de entrada */
    opacity: 0;
    animation: slideUpFadeIn 0.5s ease-out 0.1s forwards;
    
    /* Transições suaves */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUpFadeIn {
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ============================================================================
   HEADER (ÍCONE + TÍTULO)
   ============================================================================ */
.cookie-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.cookie-icon {
    /* Dimensões */
    width: 48px;
    height: 48px;
    min-width: 48px;
    
    /* Layout */
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Estilo */
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
    
    /* Ícone interno */
    font-size: 24px;
    color: #ffffff;
    
    /* Transição para harmonização */
    transition: all 0.3s ease;
}

.cookie-title {
    flex: 1;
    font-family: 'OpenSans', 'Segoe UI', Arial, sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
    margin: 0;
}

/* ============================================================================
   DESCRIÇÃO (MENSAGEM)
   ============================================================================ */
.cookie-description {
    font-family: 'OpenSans', 'Segoe UI', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 24px 0;
    text-align: justify;
}

.cookie-description strong {
    color: #ffffff;
    font-weight: 600;
}

/* Link para PDF */
.cookie-link {
    color: #4a90e2;
    text-decoration: none; /* Remove underline padrão */
    font-weight: 600;
    border-bottom: 1px solid transparent; /* Borda invisível por padrão */
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    outline: none; /* Remove outline padrão do navegador */
}

.cookie-link:hover {
    color: #5fa3ef;
    border-bottom-color: #5fa3ef; /* Borda aparece no hover */
}

/* Foco visível para acessibilidade (sem retângulo azul) */
.cookie-link:focus {
    outline: 2px solid rgba(74, 144, 226, 0.5); /* Outline sutil harmonizado */
    outline-offset: 3px;
    border-radius: 3px;
}

.cookie-link:focus:not(:focus-visible) {
    outline: none; /* Remove outline em cliques (apenas teclado) */
}

.cookie-link i {
    font-size: 14px;
}

/* ============================================================================
   BOTÕES DE AÇÃO
   ============================================================================ */
.cookie-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-end;
}

/* Botão Principal (Ok, Entendi) */
.cookie-button-accept {
    /* Layout */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    
    /* Dimensões */
    padding: 14px 32px;
    min-width: 160px;
    
    /* Estilo */
    background: linear-gradient(135deg, #51b451 0%, #3d8b3d 100%);
    color: #ffffff;
    font-family: 'OpenSans', 'Segoe UI', Arial, sans-serif;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    
    /* Sombra e elevação */
    box-shadow: 
        0 4px 12px rgba(81, 180, 81, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.2);
    
    /* Transições */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Posição relativa para shimmer */
    position: relative;
    overflow: hidden;
}

/* Efeito shimmer no botão */
.cookie-button-accept::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s ease;
}

.cookie-button-accept:hover::before {
    left: 100%;
}

/* Hover do botão */
.cookie-button-accept:hover {
    background: linear-gradient(135deg, #5ac45a 0%, #427b42 100%);
    box-shadow: 
        0 6px 16px rgba(81, 180, 81, 0.5),
        0 3px 6px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

/* Active do botão */
.cookie-button-accept:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 8px rgba(81, 180, 81, 0.4),
        0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Ícone do botão */
.cookie-button-accept i {
    font-size: 16px;
}

/* ============================================================================
   BOTÃO DE FECHAR (OPCIONAL)
   ============================================================================ */
.cookie-button-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cookie-button-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    transform: rotate(90deg);
}

/* ============================================================================
   RESPONSIVIDADE
   ============================================================================ */

/* Tablet (≤768px) */
@media (max-width: 768px) {
    .cookie-consent-container {
        width: 92%;
        max-width: 500px;
        padding: 28px 24px;
        bottom: 20px;
    }
    
    .cookie-header {
        gap: 12px;
        margin-bottom: 16px;
    }
    
    .cookie-icon {
        width: 44px;
        height: 44px;
        min-width: 44px;
        font-size: 22px;
    }
    
    .cookie-title {
        font-size: 20px;
    }
    
    .cookie-description {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    .cookie-button-accept {
        padding: 12px 28px;
        min-width: 140px;
        font-size: 14px;
    }
}

/* Mobile (≤576px) */
@media (max-width: 576px) {
    .cookie-consent-container {
        width: 94%;
        max-width: none;
        padding: 24px 20px;
        bottom: 16px;
        border-radius: 12px;
    }
    
    .cookie-header {
        gap: 10px;
        margin-bottom: 14px;
    }
    
    .cookie-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
        font-size: 20px;
        border-radius: 10px;
    }
    
    .cookie-title {
        font-size: 18px;
    }
    
    .cookie-description {
        font-size: 13px;
        line-height: 1.5;
        margin-bottom: 18px;
        text-align: left; /* Melhor legibilidade em mobile */
    }
    
    .cookie-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .cookie-button-accept {
        width: 100%;
        padding: 12px 24px;
        min-width: auto;
        font-size: 14px;
    }
    
    .cookie-button-close {
        width: 28px;
        height: 28px;
        font-size: 16px;
        top: 12px;
        right: 12px;
    }
}

/* Mobile Pequeno (≤360px) */
@media (max-width: 360px) {
    .cookie-consent-container {
        width: 96%;
        padding: 20px 16px;
        bottom: 12px;
    }
    
    .cookie-icon {
        width: 36px;
        height: 36px;
        min-width: 36px;
        font-size: 18px;
    }
    
    .cookie-title {
        font-size: 17px;
    }
    
    .cookie-description {
        font-size: 12px;
    }
    
    .cookie-button-accept {
        padding: 11px 20px;
        font-size: 13px;
    }
}

/* ============================================================================
   ACESSIBILIDADE
   ============================================================================ */

/* Foco visível para navegação por teclado */
.cookie-button-accept:focus,
.cookie-button-close:focus,
.cookie-link:focus {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

/* Respeitar preferência de movimento reduzido */
@media (prefers-reduced-motion: reduce) {
    .cookie-consent-container,
    .cookie-overlay,
    .cookie-button-accept,
    .cookie-button-close,
    .cookie-link,
    .cookie-icon {
        animation: none;
        transition: none;
    }
    
    .cookie-button-accept::before {
        display: none;
    }
}

/* ============================================================================
   ANIMAÇÃO DE SAÍDA (FADE OUT)
   ============================================================================ */
.cookie-consent-container.fade-out {
    animation: fadeOutSlideDown 0.4s ease-in forwards;
}

.cookie-overlay.fade-out {
    animation: fadeOutOverlay 0.4s ease-in forwards;
}

@keyframes fadeOutSlideDown {
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(100px);
    }
}

@keyframes fadeOutOverlay {
    to {
        opacity: 0;
    }
}

/* ============================================================================
   CLASSES DE HARMONIZAÇÃO (Aplicadas via JavaScript)
   ============================================================================ */

/* Estas classes serão aplicadas dinamicamente pelo JavaScript
   para harmonizar com as cores do cliente */

.cookie-consent-container.harmonized .cookie-icon {
    /* Background e box-shadow serão aplicados via JavaScript */
    /* baseado nas cores detectadas do cliente */
    transition: all 0.3s ease;
}

.cookie-consent-container.harmonized .cookie-link {
    /* Cor será aplicada via JavaScript */
    /* baseado nas cores detectadas do cliente */
    transition: all 0.3s ease;
}

/* ============================================================================
   FIM DO ARQUIVO
   ============================================================================ */
