/* =====================================================================
   notify.css — notifications bell + dropdown + account Messages inbox.
   Self-contained (uses design tokens from tokens.css) so it works on both
   index.html and account.html regardless of which other CSS is loaded.
   ===================================================================== */

/* --- bell button (matches the topbar icon buttons) --- */
.notify-bell {
  position: relative;
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; flex: none;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel-2, #fff); color: var(--ink);
  cursor: pointer; padding: 0;
}
.notify-bell svg { width: 20px; height: 20px; }
.notify-bell:hover { border-color: var(--accent); color: var(--accent-ink, var(--accent)); }
.notify-bell.on { border-color: var(--accent); color: var(--accent-ink, var(--accent)); background: var(--accent-soft); }
.notify-bell:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.notify-bell.has-unread svg { animation: notify-wiggle .6s ease 1; transform-origin: 50% 4px; }
@keyframes notify-wiggle { 0%,100%{transform:rotate(0)} 20%{transform:rotate(12deg)} 40%{transform:rotate(-10deg)} 60%{transform:rotate(6deg)} 80%{transform:rotate(-4deg)} }
@media (prefers-reduced-motion: reduce) { .notify-bell.has-unread svg { animation: none; } }

/* --- unread badge --- */
.notify-badge {
  position: absolute; top: -5px; right: -5px;
  min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box;
  display: grid; place-items: center;
  background: #e5604d; color: #fff;
  font-family: var(--sans); font-size: 11px; font-weight: 700; line-height: 1;
  border-radius: 99px; border: 2px solid var(--panel, #fff);
}

/* --- dropdown panel --- */
.notify-panel {
  position: fixed; z-index: 90; width: 340px; max-width: calc(100vw - 16px);
  background: var(--panel, #fff); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 16px 44px rgba(0,0,0,.18); overflow: hidden;
}
.notify-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 15px; border-bottom: 1px solid var(--line-2, var(--line));
}
.notify-head b { font-family: var(--sans); font-size: .9375rem; font-weight: 700; color: var(--ink); }
.notify-allread {
  border: none; background: none; cursor: pointer;
  font-family: var(--sans); font-size: .75rem; font-weight: 600; color: var(--accent);
}
.notify-allread:hover { text-decoration: underline; }

.notify-list { max-height: 60vh; overflow-y: auto; }
.notify-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 15px; border-bottom: 1px solid var(--line-2, var(--line));
  text-decoration: none; color: inherit; cursor: pointer;
}
.notify-item:last-child { border-bottom: none; }
.notify-item:hover { background: var(--panel-2, #f7f8fb); }
.notify-item.unread { background: var(--accent-soft); }
.notify-item.unread:hover { background: var(--accent-soft); filter: brightness(.985); }

.notify-dot { width: 8px; height: 8px; border-radius: 99px; background: transparent; margin-top: 6px; flex: none; }
.unread .notify-dot { background: #e5604d; }

.notify-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notify-text b { font-family: var(--sans); font-size: .8125rem; font-weight: 600; color: var(--ink); }
.notify-text > span { font-family: var(--sans); font-size: .78rem; color: var(--muted); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notify-text time { font-family: var(--mono); font-size: .68rem; color: var(--faint); margin-top: 2px; }

.notify-empty { padding: 28px 16px; text-align: center; font-family: var(--sans); font-size: .8125rem; color: var(--faint); }
.notify-foot {
  display: block; padding: 11px 15px; text-align: center;
  font-family: var(--sans); font-size: .78rem; font-weight: 600; color: var(--accent);
  text-decoration: none; border-top: 1px solid var(--line-2, var(--line)); background: var(--panel-2, #fafbfd);
}
.notify-foot:hover { text-decoration: underline; }

/* --- account "Messages" inbox --- */
.inbox-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.inbox-head h2 { font-family: var(--sans); font-size: 1.125rem; font-weight: 700; color: var(--ink); margin: 0; }
.notify-inbox { display: flex; flex-direction: column; gap: 10px; }
.inbox-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 15px 16px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel, #fff); text-decoration: none; color: inherit; cursor: pointer;
}
.inbox-item:hover { border-color: var(--accent); }
.inbox-item.unread { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: var(--accent-soft); }
.inbox-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.inbox-text b { font-family: var(--sans); font-size: .9375rem; font-weight: 600; color: var(--ink); }
.inbox-text p { font-family: var(--sans); font-size: .8125rem; color: var(--muted); line-height: 1.5; margin: 0; }
.inbox-text time { font-family: var(--mono); font-size: .7rem; color: var(--faint); margin-top: 2px; }
.inbox-item .notify-dot { margin-top: 7px; }

/* ---------- learning momentum: streak badge + resume button ---------- */
.streak-badge {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  height: 32px; padding: 0 12px; border-radius: 99px;
  background: var(--accent-soft); border: 1px solid var(--accent-soft);
  color: var(--accent-ink, var(--accent));
  font-family: var(--sans); font-size: 13px; font-weight: 600; line-height: 1;
}
.streak-badge b { font-weight: 700; }
.resume-btn { background: var(--accent-soft) !important; color: var(--accent-ink, var(--accent)) !important; border: 1px solid var(--accent-soft) !important; }
.resume-btn:hover { filter: brightness(.97); }
