/* Notifications: bell button in chat-top header + dropdown panel.
   Matches the dashboard's neutral header tone (sibling of #disp-badge,
   #proc-badge, #theme-toggle). The dropdown anchors visually under the
   bell when open. */

#notif-bell {
  position: relative;
  background: transparent;
  border: 1px solid var(--border, rgba(255,255,255,.12));
  color: var(--fg, #e9eaee);
  border-radius: 8px;
  padding: 4px 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#notif-bell:hover {
  background: rgba(255,255,255,.06);
}

#notif-bell .notif-badge {
  position: absolute;
  top: -4px;
  inset-inline-end: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #d4b96a;       /* firm gold */
  color: #1a1a1a;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  border: 1px solid rgba(0,0,0,.2);
  pointer-events: none;
}

/* Pulsing animation while there are unread items so the user notices
   even out of the corner of their eye. */
#notif-bell:has(.notif-badge:not([hidden])) {
  animation: notif-pulse 2.4s ease-in-out infinite;
}

@keyframes notif-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 185, 106, 0); }
  50%      { box-shadow: 0 0 0 6px rgba(212, 185, 106, .18); }
}

/* Dropdown panel — anchored to the bell. We position it via fixed coords
   computed in JS so it never gets clipped by overflow: hidden on parents. */
.notif-dropdown {
  position: fixed;
  top: 56px;
  inset-inline-end: 12px;
  width: 360px;
  max-height: 70vh;
  background: var(--panel, #1f2128);
  border: 1px solid var(--border, rgba(255,255,255,.12));
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.45);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* CRITICAL: a specific `display: flex` above out-specifies the user-agent
   `[hidden] { display: none }` rule, so the JS toggle that sets the `hidden`
   attribute on .notif-dropdown LOOKS open even when the attribute says
   hidden. Re-assert display:none on [hidden] with matching specificity (and
   !important to beat any future override). Without this rule, the dropdown
   appears permanently open and the bell looks broken to the user. */
.notif-dropdown[hidden] {
  display: none !important;
}

.notif-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,.08));
  font-weight: 700;
  font-size: 13px;
  color: var(--fg, #e9eaee);
}

.notif-mark-all {
  background: transparent;
  border: none;
  color: #d4b96a;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}
.notif-mark-all:hover { background: rgba(212, 185, 106, .08); }

.notif-list {
  overflow-y: auto;
  flex: 1 1 auto;
}

.notif-empty {
  padding: 24px 14px;
  text-align: center;
  color: var(--muted, #888);
  font-size: 13px;
}

.notif-item {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background .15s ease;
}

.notif-item:hover { background: rgba(212, 185, 106, .06); }
.notif-item:last-child { border-bottom: none; }

.notif-item.is-unread {
  background: rgba(212, 185, 106, .04);
  border-inline-start: 3px solid #d4b96a;
}

.notif-item-row1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.notif-item-title {
  font-weight: 700;
  color: var(--fg, #e9eaee);
  font-size: 13px;
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-item-persona {
  font-size: 11px;
  color: #d4b96a;
  flex-shrink: 0;
}

.notif-item-summary {
  font-size: 12px;
  color: var(--muted, #aaa);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notif-item-meta {
  font-size: 11px;
  color: var(--muted, #888);
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
}

.notif-status-blocked {
  color: #f59e0b;
  font-weight: 700;
}

/* Light theme overrides */
body.theme-light .notif-dropdown {
  background: #fff;
  border-color: #ddd;
  color: #222;
}
body.theme-light #notif-bell {
  border-color: #ddd;
  color: #222;
}
body.theme-light #notif-bell:hover { background: rgba(0,0,0,.04); }
body.theme-light .notif-hdr { border-color: #eee; color: #222; }
body.theme-light .notif-item { border-color: rgba(0,0,0,.05); }
body.theme-light .notif-item:hover { background: rgba(212, 185, 106, .12); }
body.theme-light .notif-item-title { color: #222; }
body.theme-light .notif-item-summary { color: #555; }
body.theme-light .notif-item-meta { color: #888; }
