/* Icon styling for the user-notifications bell action button.
   The button is rendered by XAF as a SimpleAction in the main-window toolbar
   (NotificationsBellController). RenderStyle=None drops `dxbl-btn-secondary`;
   CssClass adds `btn-secondary btn-header user-notifications-anchor`.

   The glyph itself is the vendored `notifications` icon, tinted by the shared chrome mask rule
   in visual-language.css (toolbar-glyph-tint.js tags this anchor's <img> the same way it tags
   toolbar action glyphs), so it matches the account/settings chrome glyphs and adapts to dark
   mode automatically. */

/* Badge positioning anchor + pointer cursor (matching the account/settings chrome buttons; the
   .dxbl-btn toolbar-item default is `default`). */
.user-notifications-anchor {
    position: relative;
    cursor: pointer;
}

/* Corner badge showing the unread count. It is the ONE mark for "unread" — the glyph itself
   keeps the chrome's own colour, so the fact is stated once rather than by a tinted bell and a
   badge together. */
.user-notifications-anchor.has-unread::after {
    content: attr(data-count);
    position: absolute;
    bottom: -2px;
    right: -2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--vl-accent);
    color: var(--vl-on-accent);
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    pointer-events: none;
    box-sizing: border-box;
}

/* Target type + record name line shown below the message preview in each notification row */
.notifications-target-line {
    font-size: 11px;
    color: var(--vl-text-muted);
    opacity: 0.75;
    margin-top: 2px;
}

/* DxDropDown body padding override for the notifications panel. The default
   .dxbl-modal-body padding pushes our header and rows inward, which makes the
   header separator stop short of the panel edges. Zeroing the popup body padding
   lets each section (header / body / footer) own its own padding so their borders
   span the full panel width. Doubled `.notifications-panel` selector raises
   specificity over the framework rule. */
.notifications-panel.notifications-panel .dxbl-modal-body {
    padding: 0;
    --dxbl-popup-body-padding-x: 0;
    --dxbl-popup-body-padding-y: 0;
}

/* The panel is a floating sheet — same corner and lift as every other one. The radius is
   repeated on the content child because the rows inside are edge-to-edge and would otherwise
   square off the corners they sit in. */
.notifications-panel.notifications-panel {
    border-radius: var(--vl-sheet-radius);
    box-shadow: var(--vl-shadow-panel);
}

.notifications-panel.notifications-panel > .dxbl-modal-content {
    border-radius: var(--vl-sheet-radius);
    overflow: hidden;
}

/* DxButton overrides for the notifications dropdown rows + inline link buttons.
   These live in a non-scoped stylesheet on purpose: Blazor CSS isolation does not
   apply the parent component's [b-xyz] attribute to a child component's root
   element, so scoped rules never match the <button> DxButton renders. The
   doubled-class selector (`.foo.foo`) raises specificity above DX's own
   `.dxbl-btn` and `.dxbl-btn:hover` rules without resorting to !important. */

/* Notification row — full-width, vertically-stacked content via the inner div. */
.notifications-dropdown-item.notifications-dropdown-item {
    display: flex;
    width: 100%;
    text-align: left;
    justify-content: flex-start;
    padding: 0;
    margin: 0;
    border: 0;
    border-bottom: 1px solid var(--vl-line-soft);
    border-radius: 0;
    background: transparent;
    background-color: transparent;
    box-shadow: none;
    color: inherit;
    font: inherit;
    line-height: inherit;
    cursor: pointer;
    min-height: 0;
    height: auto;
    white-space: normal;
}

.notifications-dropdown-item.notifications-dropdown-item:last-child {
    border-bottom: 0;
}

.notifications-dropdown-item.notifications-dropdown-item:not(:disabled):hover,
.notifications-dropdown-item.notifications-dropdown-item:not(:disabled):focus,
.notifications-dropdown-item.notifications-dropdown-item:not(:disabled):focus-visible {
    background: var(--vl-accent-softer);
    background-color: var(--vl-accent-softer);
    color: inherit;
    outline: none;
    box-shadow: none;
}

/* Inner wrapper inside the row button — vertical stack, owns padding + gap. */
.notifications-dropdown-item-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 8px 12px;
    width: 100%;
    text-align: left;
    white-space: normal;
}

.notifications-dropdown-item-message {
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.notifications-dropdown-item-time {
    font-size: 0.75rem;
    color: var(--vl-text-muted);
    opacity: 0.75;
    margin-top: 2px;
}

.notifications-dropdown-item-badge {
    margin-left: 6px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--vl-accent);
    color: var(--vl-on-accent);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.4;
}

/* Inline text-link DxButtons (clear-all, show-more). */
.notifications-panel-mark-all-read.notifications-panel-mark-all-read,
.notifications-panel-show-more.notifications-panel-show-more {
    display: inline-flex;
    align-items: center;
    background: transparent;
    background-color: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    min-height: 0;
    height: auto;
    box-shadow: none;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--vl-accent);
    text-decoration: none;
    width: auto;
    white-space: nowrap;
}

.notifications-panel-mark-all-read.notifications-panel-mark-all-read *,
.notifications-panel-show-more.notifications-panel-show-more * {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}

.notifications-panel-mark-all-read.notifications-panel-mark-all-read:not(:disabled):hover,
.notifications-panel-show-more.notifications-panel-show-more:not(:disabled):hover {
    text-decoration: underline;
    background: transparent;
    background-color: transparent;
    color: var(--vl-accent);
}

.notifications-panel-mark-all-read.notifications-panel-mark-all-read:disabled,
.notifications-panel-show-more.notifications-panel-show-more:disabled {
    opacity: 0.5;
}
