/* ── Bell icon button ─────────────────────────────── */
.notif-bell-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 17px;
  padding: 4px 7px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.18s, background 0.18s;
  flex-shrink: 0;
}
.notif-bell-btn:hover {
  color: var(--accent);
  background: var(--bg-tertiary);
}
.notif-bell-badge {
  position: absolute;
  top: -1px;
  right: -1px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 13px;
  height: 13px;
  border-radius: 7px;
  padding: 2px 3px 0px 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  line-height: 1;

}

/* ── Notification panel overlay ──────────────────── */
.notif-panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 398;
  background: transparent;
}

/* ── Notification panel ───────────────────────────── */
.notif-panel {
  position: fixed;
  top: 68px;
  right: 12px;
  z-index: 400;
  width: 300px;
  max-width: calc(100vw - 24px);
  max-height: 420px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: notif-panel-in 0.15s cubic-bezier(0.2,0,0,1);
}
@keyframes notif-panel-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.notif-panel-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.notif-panel-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.notif-mark-all-btn {
  background: none;
  border: none;
  padding: 2px 6px;
  font-size: 11px;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 4px;
  transition: color 0.12s, background 0.12s;
  white-space: nowrap;
}
.notif-mark-all-btn:hover {
  color: var(--accent);
  background: rgba(233,69,96,0.08);
}
.notif-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
  padding: 2px 5px;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.12s;
}
.notif-close-btn:hover { color: var(--text-primary); }

/* ── Panel list ───────────────────────────────────── */
.notif-panel-list {
  overflow-y: auto;
  flex: 1;
}
.notif-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  padding: 28px 16px;
}
.notif-item {
  display: flex;
  align-items: baseline;
  gap: 0;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  position: relative;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-tertiary); }
.notif-item.unread { background: rgba(233,69,96,0.05); }
.notif-item.unread::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
}
.notif-body { flex: 1; min-width: 0; }
.notif-text {
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.4;
  word-break: break-word;
}
.notif-text strong { font-weight: 600; color: var(--text-primary); }
.notif-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 230px;
}
.notif-time {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
  white-space: nowrap;
  padding-left: 8px;
  align-self: flex-start;
  margin-top: 2px;
}

/* ── @mention autocomplete ────────────────────────── */
.mention-autocomplete {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.28);
  max-height: 200px;
  overflow-y: auto;
  z-index: 50;
  margin-bottom: 4px;
  animation: mention-in 0.12s ease;
}
@keyframes mention-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.mention-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.1s;
  border-radius: 0;
}
.mention-item:first-child { border-radius: 10px 10px 0 0; }
.mention-item:last-child  { border-radius: 0 0 10px 10px; }
.mention-item:only-child  { border-radius: 10px; }
.mention-item:hover,
.mention-item.active { background: var(--accent); color: #fff; }
.mention-item:hover .mention-username,
.mention-item.active .mention-username { color: #fff; }
.mention-item:hover .mention-displayname,
.mention-item.active .mention-displayname { color: rgba(255,255,255,0.8); }
.mention-avatar-mini {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.mention-avatar-mini img { width: 100%; height: 100%; object-fit: cover; }
.mention-username {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.mention-displayname {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* ── Mention highlight in messages ───────────────── */
.mention-tag {
  display: inline;
  background: rgba(99,102,241,0.12);
  color: var(--accent);
  border-radius: 4px;
  padding: 0 3px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
}
.mention-tag:hover { background: rgba(99,102,241,0.22); }
.mention-tag.self {
  background: rgba(245,158,11,0.15);
  color: #d97706;
}
/* Mentions inside own (blue) bubble need contrasting colors */
.msg.own .mention-tag {
  background: rgba(255,255,255,0.22);
  color: #fff;
}
.msg.own .mention-tag:hover { background: rgba(255,255,255,0.35); }
.msg.own .mention-tag.self {
  background: rgba(255,220,100,0.25);
  color: #ffe082;
}
