/* NexusTrading — Notification Center
   A bell in the top bar with an unread badge, a dropdown panel listing
   entry/exit events as styled bubbles (read/unread), plus a transient
   "pop" bubble that slides in on each new event. All markup is injected
   by notifications.js; this file only styles it. Dark-terminal tokens
   come from app.css (:root). */

/* ── Bell button ───────────────────────────────────────────────── */
.nx-bell-wrap { position: relative; display: inline-flex; }

.nx-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 30px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color .15s, border-color .15s, background .15s;
}
.nx-bell:hover { color: var(--accent); border-color: var(--accent); background: var(--bg-hover); }
.nx-bell svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nx-bell.is-open { color: var(--accent); border-color: var(--accent); }

/* Unread count badge */
.nx-bell-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--bg-secondary);
    transform: scale(0);
    transition: transform .18s cubic-bezier(.34, 1.56, .64, 1);
}
.nx-bell-badge.show { transform: scale(1); }

/* Pulsing red ring when an unread danger/alert is waiting */
.nx-bell.has-alert { color: var(--red); border-color: var(--red); }
.nx-bell.has-alert .nx-bell-badge { background: var(--red); }
.nx-bell.has-alert::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 6px;
    border: 1px solid var(--red);
    animation: nx-pulse 1.6s ease-out infinite;
    pointer-events: none;
}
@keyframes nx-pulse {
    0%   { opacity: .7; transform: scale(1); }
    100% { opacity: 0;  transform: scale(1.35); }
}

/* ── Dropdown panel ────────────────────────────────────────────── */
.nx-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 372px;
    max-width: calc(100vw - 2rem);
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .55);
    z-index: 1000;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity .15s ease, transform .15s ease;
}
.nx-panel.open { opacity: 1; transform: translateY(0); pointer-events: auto; }

.nx-panel-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .7rem .85rem;
    border-bottom: 1px solid var(--border);
}
.nx-panel-title { font-size: .82rem; font-weight: 600; color: var(--text-primary); margin-right: auto; }
.nx-act {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: .72rem;
    padding: .2rem .35rem;
    border-radius: 5px;
    transition: color .15s, background .15s;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}
.nx-act:hover { color: var(--accent); background: var(--bg-hover); }
.nx-act.danger:hover { color: var(--red); }
.nx-act svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Tab strip: All | Unread */
.nx-tabs { display: flex; gap: .25rem; padding: .5rem .85rem 0; }
.nx-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: .75rem;
    padding: .25rem .35rem .4rem;
    transition: color .15s, border-color .15s;
}
.nx-tab:hover { color: var(--text-primary); }
.nx-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.nx-tab .nx-tab-count { font-size: .66rem; color: var(--text-muted); margin-left: .2rem; }

/* ── List ──────────────────────────────────────────────────────── */
.nx-list { overflow-y: auto; padding: .1rem .25rem .25rem; flex: 1; }
.nx-empty {
    padding: 2.2rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: .78rem;
}
.nx-empty svg { width: 30px; height: 30px; display: block; margin: 0 auto .5rem; opacity: .4; fill: none; stroke: currentColor; stroke-width: 1.5; }

/* A clean list row — NOT a boxed card. No per-item border, radius or fill;
   rows are separated by a faint inset hairline. Level + read state read
   through the glyph colour, the title weight and a small dot — not a frame
   (anh 2026-06-06: bỏ thẻ cứng nhắc, minimalist/compact). */
.nx-item {
    position: relative;
    display: flex;
    gap: .55rem;
    align-items: flex-start;
    padding: .5rem .4rem;
    cursor: default;
    transition: background .12s;
}
.nx-item + .nx-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: .4rem;
    right: .4rem;
    height: 1px;
    background: var(--border);
    opacity: .55;
}
.nx-item:hover { background: rgba(255, 255, 255, .03); }
/* A linked row navigates to its pair on click — signal it's clickable. */
.nx-item.nx-link { cursor: pointer; }
.nx-item.nx-link:hover .nx-title { color: var(--accent); }
/* Read rows recede (muted, lighter weight); unread keep the bright title. */
.nx-item:not(.unread) .nx-title { color: var(--text-secondary); font-weight: 500; }

/* Bare colour-coded glyph — the filled disc made every row look like a chip.
   The stroke colour alone carries the level. */
.nx-ic {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}
.nx-ic svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.lvl-success .nx-ic { color: var(--green); }
.lvl-danger  .nx-ic { color: var(--red); }
.lvl-warn    .nx-ic { color: var(--yellow); }
.lvl-info    .nx-ic { color: var(--accent); }

.nx-main { min-width: 0; flex: 1; }
.nx-title { font-size: .78rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-body { font-size: .73rem; color: var(--text-secondary); margin-top: .05rem; word-break: break-word; }
.nx-time { font-size: .65rem; color: var(--text-muted); margin-top: .15rem; }

/* Small level-coloured dot is the whole unread signal (no card fill). */
.nx-dot {
    flex: 0 0 auto;
    align-self: center;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}
.nx-item:not(.unread) .nx-dot { visibility: hidden; }
.lvl-success .nx-dot { background: var(--green); }
.lvl-danger  .nx-dot { background: var(--red); }
.lvl-warn    .nx-dot { background: var(--yellow); }
.lvl-info    .nx-dot { background: var(--accent); }

/* ── Transient pop bubbles (top-right, slide in) ───────────────── */
.nx-pop-stack {
    position: fixed;
    bottom: 20px;
    right: 18px;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    z-index: 1100;
    pointer-events: none;
}
/* The transient bubble floats over the chart, so it keeps a single thin
   border + soft shadow — but no heavy left bar; the glyph colour signals
   the level, same as the list rows. */
.nx-pop {
    display: flex;
    gap: .5rem;
    align-items: flex-start;
    width: 280px;
    max-width: calc(100vw - 2rem);
    padding: .55rem .65rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .42);
    pointer-events: auto;
    cursor: pointer;
    opacity: 0;
    transform: translateX(120%);
    transition: opacity .2s ease, transform .25s cubic-bezier(.34, 1.4, .64, 1);
}
.nx-pop.show { opacity: 1; transform: translateX(0); }
.nx-pop.hide { opacity: 0; transform: translateX(120%); }
.nx-pop .nx-ic { margin-top: 1px; }
.nx-pop .nx-title { white-space: normal; }
