/* Nomios web UI: the notification bell and its list (U65). Design system: docs/design/DESIGN_SYSTEM.md.
   The stylesheets are linked in this order: tokens, base, shell, components, tasks, pages, modal,
   meetings, connection, search, viewing, confirm, planner, bell. */

@layer bell {
  .icon-bell {
    --icon: url("/static/icons/bell.svg");
  }

  /* The bell (U65): a round button by the brand, a count in a small badge, a glass pop-over. */
  .sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    min-width: 0;
  }

  .bell {
    flex: none;
  }

  .bell-button {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    color: var(--color-text);
    text-decoration: none;
    border: 1px solid var(--color-border);
    background: var(--glass-raised-bg);
  }

  .bell-count {
    position: absolute;
    top: -0.25rem;
    inset-inline-end: -0.25rem;
    min-width: 1.15rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: var(--color-accent);
    color: var(--color-accent-contrast);
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.15rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
  }

  .bell-panel {
    inset: auto;
    margin: 0;
    position: fixed;
    top: 4.5rem;
    left: var(--space-4);
    width: min(24rem, calc(100vw - 2 * var(--space-4)));
    max-height: min(32rem, 80vh);
    overflow: auto;
    overscroll-behavior: contain; /* the list scrolls on its own, not the page behind */
    padding: var(--space-3);
    color: var(--color-text);
    background: var(--glass-overlay-bg);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(var(--glass-overlay-blur)) saturate(var(--glass-saturate));
  }

  .bell-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
  }

  .bell-panel-title {
    margin: 0;
    font-size: var(--text-base);
    font-weight: 600;
  }

  .bell-panel-foot {
    margin: var(--space-3) 0 0;
    text-align: end;
  }

  .feed-list {
    display: grid;
    gap: var(--space-1);
    margin: var(--space-3) 0 0;
    padding: 0;
    list-style: none;
  }

  .feed-item form {
    margin: 0;
  }

  .feed-entry {
    display: grid;
    gap: 0.125rem;
    width: 100%;
    padding: var(--space-2) var(--space-3);
    text-align: start;
    color: inherit;
    font: inherit;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
  }

  .feed-item.is-unread .feed-entry {
    background: var(--glass-raised-bg);
    border-color: var(--color-border);
  }

  .feed-kind {
    font-weight: 600;
  }

  .feed-dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    margin-inline-end: var(--space-2);
    border-radius: 50%;
    background: var(--color-accent);
  }

  .feed-title {
    overflow-wrap: anywhere;
  }

  .feed-when {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
  }

  .feed-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
  }
}
