/* ============================================================
   ALDEAPATH — Notification Panel & Toast Polish
   ------------------------------------------------------------
   Drop-in override that slims the notification dropdown and
   toast cards into a clean, professional, brand-aligned view.

   Goals
     • Tighter, calmer rows (less padding, smaller icons)
     • Brand teal accent (replaces hard-coded blue #2563eb)
     • Subtle unread treatment (left bar, no heavy bg tint)
     • Slimmer tab strip with pill-style active state
     • Compact toast cards with restrained icons
     • Better dark mode contrast

   Include AFTER /user/assets/css/improvements.css and
   /user/assets/css/style-patch.css:
     <link rel="stylesheet" href="/user/assets/css/notifications-polish.css?v=1">
   ============================================================ */

:root {
  --np-teal: var(--brand, #00796b);
  --np-teal-soft: rgba(0, 201, 183, 0.10);
  --np-teal-line: rgba(0, 201, 183, 0.32);
  --np-navy: #1a3560;
  --np-divider: rgba(15, 23, 42, 0.06);
  --np-divider-strong: rgba(15, 23, 42, 0.10);
}
[data-theme="dark"] {
  --np-divider: rgba(255, 255, 255, 0.06);
  --np-divider-strong: rgba(255, 255, 255, 0.10);
}

/* ── BELL BUTTON ─────────────────────────────────────────── */
.notif-btn {
  padding: 0.4rem !important;
  border-radius: 10px;
  transition: background 0.15s ease, color 0.15s ease;
}
.notif-btn:hover {
  color: var(--np-teal) !important;
  background: var(--np-teal-soft);
}
.notif-btn svg {
  width: 1.05rem !important;
  height: 1.05rem !important;
  stroke-width: 1.8;
}

/* Slimmer, brand-colored badge */
.notif-badge {
  background: var(--np-teal) !important;
  color: var(--color-on-brand, #fff) !important;
  font-size: .75rem !important;
  font-weight: 800 !important;
  min-width: 0.85rem !important;
  height: 0.85rem !important;
  top: 0.05rem !important;
  right: 0.05rem !important;
  border-width: 1.5px !important;
  letter-spacing: 0.01em;
}

/* ── PANEL CONTAINER ─────────────────────────────────────── */
.notif-panel {
  width: min(340px, calc(100vw - 1.5rem)) !important;
  border-radius: 14px !important;
  border: 1px solid var(--np-divider-strong) !important;
  box-shadow:
    0 14px 40px -8px rgba(15, 23, 42, 0.16),
    0 4px 12px -2px rgba(15, 23, 42, 0.06) !important;
  overflow: hidden;
}

/* Header — tighter, cleaner */
.notif-panel-header {
  padding: 0.7rem 0.85rem 0.6rem !important;
  border-bottom: 1px solid var(--np-divider) !important;
}
.notif-panel-title {
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em !important;
}
.notif-mark-read,
.notif-clear-read {
  font-size: .75rem !important;
  font-weight: 600 !important;
  color: var(--np-teal) !important;
  padding: 0.25rem 0.55rem !important;
  border-radius: 999px !important;
}
.notif-mark-read:hover,
.notif-clear-read:hover {
  background: var(--np-teal-soft) !important;
}

/* ── TAB STRIP — overrides the inline-styled tabs ──────── */
#notif-tabs,
.notif-tabs {
  padding: 0.45rem 0.5rem 0.5rem !important;
  gap: 0.2rem !important;
  border-bottom: 1px solid var(--np-divider) !important;
  background: transparent !important;
}

.notif-tab-btn {
  flex: 1 !important;
  padding: 0.32rem 0.4rem !important;
  border: none !important;
  border-radius: 7px !important;
  font-size: .75rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em !important;
  background: transparent !important;
  color: var(--muted, #64748b) !important;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease !important;
  white-space: nowrap;
}

.notif-tab-btn:hover {
  background: var(--np-divider) !important;
  color: var(--text, #0f172a) !important;
}

.notif-tab-btn.active {
  background: var(--np-teal-soft) !important;
  color: var(--np-teal) !important;
  font-weight: 700 !important;
  box-shadow: inset 0 0 0 1px var(--np-teal-line);
}

/* ── LIST CONTAINER ──────────────────────────────────────── */
.notif-list {
  max-height: 360px !important;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--np-divider-strong) transparent;
}
.notif-list::-webkit-scrollbar { width: 6px; }
.notif-list::-webkit-scrollbar-thumb {
  background: var(--np-divider-strong);
  border-radius: 999px;
}
.notif-list::-webkit-scrollbar-track { background: transparent; }

/* Group date headers — smaller, calmer */
.notif-group-header {
  padding: 0.5rem 0.85rem 0.25rem !important;
  font-size: .75rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  color: var(--muted, #64748b) !important;
  text-transform: uppercase;
  background: var(--surface) !important;
}

/* ── ITEM ROWS — slimmer, no heavy bg tint ──────────────── */
.notif-item {
  display: flex !important;
  gap: 0.6rem !important;
  padding: 0.6rem 0.85rem !important;
  border-bottom: 1px solid var(--np-divider) !important;
  position: relative;
  cursor: pointer !important;
  transition: background 0.12s ease;
}
.notif-item:last-child { border-bottom: none !important; }
.notif-item:hover {
  background: var(--np-divider) !important;
}

/* Unread — kill the heavy brand-light tint, use a subtle teal bar */
.notif-item.unread {
  background: transparent !important;
  opacity: 1 !important;
}
.notif-item.unread::before {
  content: "";
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 2.5px !important;
  background: var(--np-teal) !important;
  border-radius: 0 2px 2px 0 !important;
}
.notif-item.unread .notif-title {
  font-weight: 700 !important;
  color: var(--text, #0f172a);
}

/* Read — gentle de-emphasis */
.notif-item.read {
  opacity: 0.78 !important;
}
.notif-item.read .notif-title {
  font-weight: 600 !important;
}

/* Icon wrapper — smaller, softer */
.notif-icon-wrap {
  width: 1.85rem !important;
  height: 1.85rem !important;
  border-radius: 8px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.notif-icon-wrap i {
  font-size: 0.78rem !important;
}

/* Content column */
.notif-content {
  flex: 1;
  min-width: 0;
}
.notif-title {
  font-size: 0.76rem !important;
  font-weight: 600;
  color: var(--text, #0f172a);
  line-height: 1.35;
  margin-bottom: 0.1rem;
  letter-spacing: -0.005em;
  /* Truncate to one line for the cleanest read */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notif-message {
  font-size: .75rem !important;
  font-weight: 400;
  color: var(--muted, #64748b);
  line-height: 1.4;
  margin-bottom: 0.2rem;
  /* Limit to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notif-time {
  font-size: .75rem !important;
  font-weight: 500 !important;
  color: var(--muted, #94a3b8) !important;
  letter-spacing: 0.01em;
}

/* Mark-as-read tick button — subtle, only on hover */
.notif-mark-read-btn {
  width: 1.5rem;
  height: 1.5rem;
  border: none;
  background: transparent;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted, #94a3b8);
  cursor: pointer;
  flex-shrink: 0;
  align-self: center;
  font-size: .75rem;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.notif-item:hover .notif-mark-read-btn {
  opacity: 1;
}
.notif-mark-read-btn:hover {
  background: var(--np-teal-soft);
  color: var(--np-teal);
}

/* Hide the legacy left-side dot — we use a bar now */
.notif-dot { display: none !important; }

/* ── EMPTY STATE — calmer, smaller icon ─────────────────── */
.notif-empty {
  padding: 2.25rem 1rem !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.notif-empty i {
  font-size: 1.4rem !important;
  color: var(--muted, #cbd5e1) !important;
  margin-bottom: 0.25rem !important;
}
.notif-empty-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text, #0f172a);
  letter-spacing: -0.005em;
}
.notif-empty-sub {
  font-size: .75rem;
  font-weight: 400;
  color: var(--muted, #94a3b8);
  text-align: center;
  line-height: 1.45;
  max-width: 220px;
}

/* ── TOAST NOTIFICATION — compact, restrained ───────────── */
.toast-notification {
  gap: 0.55rem !important;
  padding: 0.7rem 0.75rem !important;
  border-radius: 12px !important;
  border-color: var(--np-divider-strong) !important;
  box-shadow:
    0 12px 32px -8px rgba(15, 23, 42, 0.18),
    0 2px 6px rgba(15, 23, 42, 0.06) !important;
  max-width: 360px;
}

.toast-notif-icon {
  width: 1.7rem !important;
  height: 1.7rem !important;
  border-radius: 8px !important;
  font-size: .75rem !important;
  margin-top: 1px;
}

.toast-title {
  font-size: .75rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.005em;
  margin-bottom: 0.15rem !important;
  /* Keep the title to a single tight line */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toast-message {
  font-size: .75rem !important;
  line-height: 1.45 !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.toast-close {
  width: 1.3rem;
  height: 1.3rem;
  padding: 0 !important;
  border-radius: 6px !important;
  font-size: .75rem !important;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.55;
}
.toast-close:hover { opacity: 1; }

/* Subtle teal accent strip on the toast left edge */
.toast-notification {
  position: relative;
  overflow: hidden;
}
.toast-notification::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2.5px;
  background: var(--np-teal);
  border-radius: 0 2px 2px 0;
  opacity: 0.85;
}

/* ── DARK MODE ───────────────────────────────────────────── */
[data-theme="dark"] .notif-panel {
  box-shadow:
    0 18px 50px -10px rgba(0, 0, 0, 0.55),
    0 4px 14px rgba(0, 0, 0, 0.30) !important;
}
[data-theme="dark"] .notif-tab-btn.active {
  background: rgba(0, 201, 183, 0.16) !important;
}
[data-theme="dark"] .notif-group-header {
  background: var(--surface, #0d1a32) !important;
}
[data-theme="dark"] .toast-notification {
  box-shadow:
    0 16px 40px -10px rgba(0, 0, 0, 0.65),
    0 3px 10px rgba(0, 0, 0, 0.35) !important;
}

/* ── REDUCED MOTION ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .notif-item,
  .notif-tab-btn,
  .notif-mark-read-btn,
  .toast-notification {
    transition: none !important;
  }
}
