/* ═══════════════════════════════════════════════════════════════
   Notificações Premium — Sininho + Dropdown em tempo real
   
   Arquivo:    notificacoes-premium.css
   Descrição:  Estilos para o sistema de notificações push no header.
               Sininho com badge, dropdown com listagem e estados.
               Segue padrão BEM e paleta do header-premium.
   
   Sumário:
     1. Variáveis
     2. Bell Container
     3. Badge (contagem)
     4. Dropdown
     5. Dropdown Header
     6. Dropdown Items
     7. Item Icon (por tipo)
     8. Item Body
     9. Estado Vazio
     10. Animações
     11. Responsivo (≤ 576px)
     12. Dark Theme
   
   Paleta: Navy (#0B1F33), Teal (#0EA5A4), Gold (#D6B15E)
   ═══════════════════════════════════════════════════════════════ */


/* ══════════════════════════════════════
   1. VARIÁVEIS
   ══════════════════════════════════════ */

:root {
    --notif-bg: #ffffff;
    --notif-bg-hover: #f8f9fb;
    --notif-bg-unread: rgba(14, 165, 164, 0.04);
    --notif-border: #e6edf5;
    --notif-text: #0f172a;
    --notif-text-secondary: #526173;
    --notif-text-tertiary: #8b9bb0;
    --notif-shadow: 0 8px 40px rgba(11, 31, 51, 0.14);
    --notif-radius: 16px;
    --notif-badge-bg: #e53e3e;
    --notif-badge-text: #ffffff;
}


/* ══════════════════════════════════════
   2. BELL CONTAINER
   ══════════════════════════════════════ */

.notif-bell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 4px;
    border: none;
    background: transparent;
    color: var(--hp-muted, #526173);
    transition: color 0.3s ease;
    -webkit-user-select: none;
    user-select: none;
}

.notif-bell:hover {
    color: var(--hp-gold, #D6B15E);
}

.notif-bell svg {
    display: block;
    flex-shrink: 0;
}


/* ══════════════════════════════════════
   3. BADGE (contagem)
   ══════════════════════════════════════ */

.notif-bell__badge {
    position: absolute;
    top: -2px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--notif-badge-bg);
    color: var(--notif-badge-text);
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
    animation: notif-pulse 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 2px 6px rgba(229, 62, 62, 0.35);
}

/* Estado de loading do badge (pulsação contínua) */
.notif-bell__badge--loading {
    animation: notif-badge-loading 1.5s ease-in-out infinite;
}

@keyframes notif-badge-loading {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
}


/* ══════════════════════════════════════
   4. DROPDOWN
   ══════════════════════════════════════ */

.notif-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: -8px;
    width: 360px;
    max-height: 420px;
    background: var(--notif-bg);
    border: 1px solid var(--notif-border);
    border-radius: var(--notif-radius);
    box-shadow: var(--notif-shadow);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    pointer-events: none;
    overflow: hidden;
}

.notif-dropdown--open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}


/* ══════════════════════════════════════
   5. DROPDOWN HEADER
   ══════════════════════════════════════ */

.notif-dropdown__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--notif-border);
    flex-shrink: 0;
}

.notif-dropdown__title {
    font-family: 'Manrope', sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--notif-text);
}

.notif-dropdown__mark-all {
    border: none;
    background: transparent;
    color: var(--hp-teal, #0EA5A4);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
}

.notif-dropdown__mark-all:hover {
    background: rgba(14, 165, 164, 0.08);
    color: #0c8f8e;
}


/* ══════════════════════════════════════
   6. DROPDOWN ITEMS (lista)
   ══════════════════════════════════════ */

.notif-dropdown__list {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.notif-dropdown__item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--notif-border);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.15s ease;
}

.notif-dropdown__item:last-child {
    border-bottom: none;
}

.notif-dropdown__item:hover {
    background: var(--notif-bg-hover);
}

.notif-dropdown__item--unread {
    background: var(--notif-bg-unread);
}

.notif-dropdown__item--unread:hover {
    background: rgba(14, 165, 164, 0.07);
}


/* ══════════════════════════════════════
   7. ITEM ICON (por tipo)
   ══════════════════════════════════════ */

.notif-dropdown__item-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #ffffff;
}

.notif-dropdown__item-icon svg {
    width: 16px;
    height: 16px;
}

.notif-dropdown__item-icon--lead {
    background: #38a169;
}

.notif-dropdown__item-icon--link {
    background: #3182ce;
}

.notif-dropdown__item-icon--formulario {
    background: #805ad5;
}

.notif-dropdown__item-icon--aprovado {
    background: #38a169;
}

.notif-dropdown__item-icon--rejeitado {
    background: #e53e3e;
}

.notif-dropdown__item-icon--convertido {
    background: #d69e2e;
}


/* ══════════════════════════════════════
   8. ITEM BODY
   ══════════════════════════════════════ */

.notif-dropdown__item-body {
    flex: 1;
    min-width: 0;
}

.notif-dropdown__item-titulo {
    font-size: 13px;
    font-weight: 600;
    color: var(--notif-text);
    line-height: 1.35;
    margin: 0 0 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notif-dropdown__item-mensagem {
    font-size: 12px;
    color: var(--notif-text-secondary);
    line-height: 1.4;
    margin: 0 0 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notif-dropdown__item-data {
    font-size: 11px;
    color: var(--notif-text-tertiary);
    line-height: 1;
    margin: 0;
}


/* ══════════════════════════════════════
   9. ESTADO VAZIO
   ══════════════════════════════════════ */

.notif-dropdown__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.notif-dropdown__empty-icon {
    color: var(--notif-text-tertiary);
    opacity: 0.45;
    margin-bottom: 12px;
}

.notif-dropdown__empty-text {
    font-size: 0.88rem;
    color: var(--notif-text-secondary);
    margin: 0;
}


/* ══════════════════════════════════════
   10. ANIMAÇÕES
   ══════════════════════════════════════ */

@keyframes notif-pulse {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    60% {
        transform: scale(1.15);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}


/* ══════════════════════════════════════
   11. RESPONSIVO (≤ 576px)
   ══════════════════════════════════════ */

@media (max-width: 576px) {
    .notif-dropdown {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        width: 100%;
        max-height: calc(100vh - 64px - 20px);
        border-radius: 0 0 var(--notif-radius) var(--notif-radius);
        border-left: none;
        border-right: none;
    }
}


/* ══════════════════════════════════════
   12. DARK THEME
   ══════════════════════════════════════ */

[data-bs-theme=dark] {
    --notif-bg: #0f2845;
    --notif-bg-hover: rgba(214, 177, 94, 0.06);
    --notif-bg-unread: rgba(214, 177, 94, 0.04);
    --notif-border: rgba(214, 177, 94, 0.15);
    --notif-text: #D6B15E;
    --notif-text-secondary: rgba(214, 177, 94, 0.60);
    --notif-text-tertiary: rgba(214, 177, 94, 0.40);
    --notif-shadow: 0 8px 40px rgba(0, 0, 0, 0.55);
}

[data-bs-theme=dark] .notif-dropdown {
    background: rgba(9, 25, 43, 0.97);
    backdrop-filter: saturate(160%) blur(24px);
    -webkit-backdrop-filter: saturate(160%) blur(24px);
    border: 1px solid rgba(214, 177, 94, 0.20);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(214, 177, 94, 0.08);
}

[data-bs-theme=dark] .notif-bell {
    color: rgba(214, 177, 94, 0.55);
}

[data-bs-theme=dark] .notif-bell:hover {
    color: #D6B15E;
}

[data-bs-theme=dark] .notif-dropdown__mark-all {
    color: #D6B15E;
}

[data-bs-theme=dark] .notif-dropdown__mark-all:hover {
    background: rgba(214, 177, 94, 0.10);
    color: #e0be6e;
}

[data-bs-theme=dark] .notif-dropdown__item--unread {
    background: rgba(214, 177, 94, 0.04);
}

[data-bs-theme=dark] .notif-dropdown__item--unread:hover {
    background: rgba(214, 177, 94, 0.08);
}

[data-bs-theme=dark] .notif-dropdown__empty-icon {
    color: rgba(214, 177, 94, 0.30);
}
