/* ============================ Sino de notificações ============================ */

.notif-bell {
    position: relative;
    display: none;
}
.notif-bell.show {
    display: inline-flex;
}

.notif-bell-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.notif-bell-btn svg {
    width: 20px;
    height: 20px;
}
.notif-bell-btn:hover,
.notif-bell.open .notif-bell-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #f0f4fc;
}

.notif-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px #0a0f1a;
}

.notif-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 400;
    width: min(360px, 92vw);
    max-height: min(70vh, 520px);
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #111a2b 0%, #0b1220 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}
.notif-panel[hidden] {
    display: none !important;
}

.notif-head {
    padding: 0.85rem 1rem 0.6rem;
    color: #f0f4fc;
    font-size: 1rem;
}
.notif-head strong {
    font-weight: 700;
}

.notif-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0 0.6rem 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    overflow-x: auto;
}
.notif-tab {
    flex: 0 0 auto;
    padding: 0.4rem 0.7rem;
    border: none;
    background: transparent;
    color: #94a3b8;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.notif-tab:hover {
    color: #e5edfb;
    background: rgba(255, 255, 255, 0.05);
}
.notif-tab.active {
    color: #e0f2fe;
    background: rgba(59, 130, 246, 0.22);
}

.notif-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.35rem;
}
.notif-loading,
.notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    text-align: center;
    color: #94a3b8;
    padding: 2.5rem 1rem;
    font-size: 0.9rem;
}
.notif-empty-icon svg {
    width: 42px;
    height: 42px;
    color: rgba(148, 163, 184, 0.4);
}

.notif-item {
    display: flex;
    gap: 0.6rem;
    padding: 0.65rem 0.7rem;
    border-radius: 10px;
    transition: background 0.15s;
}
.notif-item + .notif-item {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.notif-item:hover {
    background: rgba(255, 255, 255, 0.04);
}
.notif-item--unread {
    background: rgba(59, 130, 246, 0.08);
}
.notif-item-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #60a5fa;
}
.notif-item-icon svg {
    width: 17px;
    height: 17px;
}
.notif-item-main {
    min-width: 0;
    flex: 1;
}
.notif-item-title {
    color: #f0f4fc;
    font-weight: 700;
    font-size: 0.88rem;
    line-height: 1.3;
}
.notif-item-body {
    color: #cbd5e1;
    font-size: 0.82rem;
    line-height: 1.4;
    margin-top: 0.15rem;
    word-break: break-word;
}
.notif-item-meta {
    color: #7c8aa0;
    font-size: 0.72rem;
    margin-top: 0.25rem;
}

/* ---- Variante dentro do menu do perfil (item da lista) ---- */
.notif-bell--menu {
    display: none;
}
.notif-bell--menu.show {
    display: block;
}
.notif-bell--menu .notif-bell-btn {
    width: 100%;
    height: auto;
    border: none;
    border-radius: 0;
    background: transparent;
    justify-content: flex-start;
    gap: 0.55rem;
    padding: 0.55rem 0.85rem;
    color: #e2e8f0;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 600;
}
.notif-bell--menu .notif-bell-btn:hover,
.notif-bell--menu.open .notif-bell-btn {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}
.notif-bell--menu .notif-bell-btn svg {
    width: 18px;
    height: 18px;
}
.notif-bell--menu .notif-bell-label {
    flex: 1;
    text-align: left;
}
.notif-bell--menu .notif-badge {
    position: static;
    box-shadow: none;
    margin-left: auto;
}
/* Painel abre para o lado esquerdo do menu para não ficar cortado */
.notif-bell--menu .notif-panel {
    top: 0;
    right: calc(100% + 10px);
    left: auto;
}
@media (max-width: 640px) {
    .notif-bell--menu .notif-panel {
        top: calc(100% + 6px);
        right: 0;
        left: auto;
    }
}

/* Tema claro */
html.a11y-light .notif-panel {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.14);
}
html.a11y-light .notif-head,
html.a11y-light .notif-item-title {
    color: #0f172a;
}
html.a11y-light .notif-item-body {
    color: #334155;
}
html.a11y-light .notif-bell-btn {
    color: #334155;
    border-color: rgba(15, 23, 42, 0.15);
    background: rgba(15, 23, 42, 0.03);
}
