/* OP-028 — the notification centre: the bell's count, its popover (TopBar.razor, js/onix-notify.js), the toasts it
   raises, and the Notifications page (Components/Pages/Notifications). Tokens only (css/onix-theme.css): every one has
   its dark value. */

/* The bell's badge with a count: a pill over the glass circle (the dot of before stays for the to-dos alone). */
.shell-badge.shell-badge--count {
    top: -3px;
    right: -4px;
    width: auto;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--danger);
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
    font-family: var(--font-text);
}
.shell-notify > summary.shell-bell { position: relative; }

/* The popover: wider than the other shell panels, a list that scrolls under a fixed head and foot. */
.shell-pop-panel.shell-notify-panel {
    width: min(380px, calc(100vw - 32px));
    max-width: none;
    padding: 8px 6px;
    display: flex;
    flex-direction: column;
    max-height: min(72vh, 560px);
}
.shell-notify-readall {
    border: 0;
    background: none;
    padding: 2px 6px;
    font: inherit;
    font-family: var(--font-text);
    font-size: 11.5px;
    letter-spacing: 0;
    text-transform: none;
    color: var(--brand);
    cursor: pointer;
    border-radius: var(--radius-xs);
}
.shell-notify-readall:hover:not(:disabled) { background: var(--panel-hover); }
.shell-notify-readall:disabled { color: var(--muted-2); cursor: default; }

.shell-notify-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; overscroll-behavior: contain; flex: 1 1 auto; }

.shell-notify-row {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0 4px;
    padding: 2px 30px 2px 0;
    border-radius: 14px;
}
.shell-notify-row:hover { background: var(--panel-hover); }
a.shell-notify-row, .shell-notify-open {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1 1 100%;
    min-width: 0;
    padding: 8px 10px;
    color: var(--ink) !important;
    text-decoration: none !important;
}
.shell-notify-row--pinned { margin-bottom: 4px; background: var(--hue-amber-soft); padding-right: 10px; }
.shell-notify-row--pinned:hover { background: var(--hue-amber-soft); }

.shell-notify-mark {
    flex: none;
    width: 8px;
    height: 8px;
    margin-top: 6px;
    border-radius: 50%;
    background: var(--line-strong);
}
.shell-notify-row.is-unread .shell-notify-mark--info { background: var(--info); }
.shell-notify-row.is-unread .shell-notify-mark--success { background: var(--good); }
.shell-notify-row.is-unread .shell-notify-mark--warning, .shell-notify-mark--warning { background: var(--warn); }
.shell-notify-row.is-unread .shell-notify-mark--error { background: var(--danger); }

.shell-notify-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.shell-notify-title { font-size: 13px; line-height: 1.35; color: var(--ink); overflow-wrap: anywhere; }
.shell-notify-row.is-unread .shell-notify-title { font-weight: 600; }
.shell-notify-text {
    font-size: 12px;
    line-height: 1.35;
    color: var(--ink-soft);
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.shell-notify-meta { font-size: 11px; color: var(--muted); }
.shell-notify-company { color: var(--brand-strong); font-weight: 500; }

.shell-notify-ask { display: flex; gap: 6px; padding: 0 10px 8px 28px; }
.shell-notify-ask-state { font-size: 12px; color: var(--muted); padding: 0 10px 8px 28px; }

.shell-notify-dismiss {
    position: absolute;
    top: 6px;
    right: 4px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.12s ease, background 0.12s ease;
}
.shell-notify-dismiss svg { width: 12px; height: 12px; }
.shell-notify-row:hover .shell-notify-dismiss, .shell-notify-dismiss:focus-visible { opacity: 1; }
.shell-notify-dismiss:hover { background: var(--line); color: var(--ink); }
@media (hover: none) { .shell-notify-dismiss { opacity: 1; } }

.shell-notify-empty { margin: 10px 12px 14px; font-size: 12.5px; color: var(--muted); }

/* The offer of desktop notifications under the popover's head (js/onix-notify.js shows it while the browser has not
   been asked): a soft brand band with the sentence and Turn on / Not now. */
.shell-notify-desktop {
    display: flex; flex-direction: column; gap: 8px;
    margin: 0 4px 6px; padding: 10px 12px; border-radius: 12px;
    background: var(--brand-soft, var(--panel-hover)); font-size: 12.5px; line-height: 1.4; color: var(--ink);
}
.shell-notify-desktop[hidden] { display: none; }
.shell-notify-desktop-actions { display: flex; gap: 6px; }

/* Notifications → Settings: the desktop notifications of this browser. */
.desktop-notify { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.desktop-notify-state { margin: 0; font-size: 13px; color: var(--ink-soft); }
.desktop-notify-state.is-on { color: var(--good); font-weight: 600; }
.desktop-notify-state.is-blocked { color: var(--danger); }
.desktop-notify-kinds { display: flex; flex-direction: column; gap: 6px; }
.desktop-notify-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.shell-notify-foot { display: flex; justify-content: space-between; gap: 12px; }

/* A toast raised by a new notification: the app's toast, clickable, the title over the text. */
.toast.toast-notify { cursor: pointer; align-items: flex-start; }
.toast.toast-notify .toast-msg { display: flex; flex-direction: column; gap: 2px; }
.toast.toast-notify .toast-notify-title { font-weight: 600; }
.toast.toast-notify .toast-notify-text { font-size: 12px; color: var(--ink-soft); }

/* The Notifications page. */
.notify-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.notify-filters select { min-width: 160px; }
.notify-cell-title { display: flex; flex-direction: column; gap: 2px; white-space: normal; }
.notify-cell-title .notify-title { color: var(--ink); }
.notify-cell-title.is-unread .notify-title { font-weight: 600; }
.notify-cell-title .notify-text { font-size: 12px; color: var(--ink-soft); }
.notify-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.notify-dot.is-unread { background: var(--info); }
.notify-dot.is-unread.notify-dot--error { background: var(--danger); }
.notify-dot.is-unread.notify-dot--warning { background: var(--warn); }
.notify-dot.is-unread.notify-dot--success { background: var(--good); }
.notify-more { margin-top: 12px; display: flex; justify-content: center; }
.notify-settings-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.notify-mutes { display: grid; gap: 6px 16px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); margin: 8px 0 0; }
.notify-mutes label, .notify-switch { display: flex; align-items: center; gap: 8px; font-size: 13px; }

/* On a phone the actions are the bar's own flex items (css/onix-shell.css: .shell-actions is display: contents):
   the bell's popover keeps the bell's place; its panel reaches past the avatar to the screen's right margin. */
@media (max-width: 767.98px) {
    .shell-notify { order: 3; }
    .shell-pop-panel.shell-notify-panel { right: -44px; width: calc(100vw - 32px); }
}
