/* ============================================
   NOTIFICATION CENTER CSS (issue 855)
   ============================================
   Consumed by js/components/pages/NotificationCenter.js (route
   "notifications"). Title comes from the shell PageHeader.

   Tokens only — applyTheme rewrites :root per theme (themeConfig.js).
   Contrast, worst theme across all 8 + defaults:
   - --text-primary on --bg-page 8.58:1 / on --bg-card 9.62:1
   - --color-structure-deep (body, time, button) on --bg-page 5.45:1 /
     on --bg-card 6.11:1
   - --color-danger-dark on --color-danger-bg (violation rows) 7.06:1 */

.notif-center {
  min-height: 100%;
  background: var(--bg-page);
  padding: var(--space-sm) 0 var(--space-2xl);
}

@media (min-width: 768px) {
  .notif-center {
    max-width: 720px;
    margin: 0 auto;
  }
}

/* ─── Toolbar ─────────────────────────────────────────────────── */

.notif-center__toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 0 var(--space-base) var(--space-sm);
}

.notif-center__mark-all {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: 44px;
  padding: 0 var(--space-base);
  background: transparent;
  border: var(--border-width-thin) solid var(--color-structure-deep);
  border-radius: var(--border-radius-full);
  color: var(--color-structure-deep);
  font-family: var(--font-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  cursor: pointer;
}

.notif-center__mark-all:focus-visible {
  outline: 2px solid var(--color-action-primary);
  outline-offset: 2px;
}

.notif-center__mark-all:disabled {
  cursor: default;
  opacity: 0.6;
}

/* ─── List + rows ─────────────────────────────────────────────── */

.notif-center__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.notif-center__row {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-base);
  background: transparent;
  border: none;
  border-bottom: var(--border-width-thin) solid var(--border-medium);
  color: var(--text-primary);
  font-family: var(--font-primary);
  text-align: left;
  cursor: pointer;
  position: relative;
}

.notif-center__row:focus-visible {
  outline: 2px solid var(--color-action-primary);
  outline-offset: -2px;
}

/* Unread: card surface + left rule + bold title + trailing dot. Not colour
   alone — the rule, weight, and dot all carry it (plus SR "Unread:"). */
.notif-center__row--unread {
  background: var(--bg-card);
}

.notif-center__row--unread::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--color-action-primary);
}

.notif-center__row--unread .notif-center__title {
  font-weight: var(--font-weight-black);
}

.notif-center__row--violation {
  background: var(--color-danger-bg);
  color: var(--color-danger-dark);
  border-bottom-color: var(--border-danger);
}

.notif-center__icon {
  flex-shrink: 0;
  display: inline-flex;
  margin-top: var(--space-2xs);
  color: var(--color-structure-deep);
}

.notif-center__icon--violation {
  color: var(--color-danger-dark);
}

.notif-center__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
}

.notif-center__title {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  overflow-wrap: anywhere;
}

.notif-center__body {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  color: var(--color-structure-deep);
  overflow-wrap: anywhere;
}

.notif-center__row--violation .notif-center__body {
  color: var(--color-danger-dark);
}

.notif-center__meta {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-xs);
}

.notif-center__time {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  color: var(--color-structure-deep);
  white-space: nowrap;
}

.notif-center__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--border-radius-full);
  background: var(--color-action-primary);
}

/* ─── Status / empty / error ──────────────────────────────────── */

.notif-center__status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-2xl) var(--space-base);
}

.notif-center__empty {
  margin: 0;
  padding: var(--space-2xl) var(--space-base);
  text-align: center;
  color: var(--color-structure-deep);
  font-size: var(--font-size-base);
}

.notif-center__error {
  margin: 0 var(--space-base) var(--space-sm);
  color: var(--color-danger-dark);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

@media (prefers-reduced-motion: reduce) {
  .notif-center .spinner {
    animation: none;
  }
}

/* Scoped visually-hidden helper — don't depend on the Tailwind CDN's sr-only. */
.notif-center__sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
