/* ── Notification module styles ── */

.notif-wrap { max-width: 900px; margin: 0 auto; padding: 24px 16px 48px; }

/* Header */
.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 22px;
}
.notif-header-left { display: flex; align-items: center; gap: 14px; }
.notif-header-icon {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, #1565c0, #1976d2);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.2rem;
}
.notif-header h1 { font-size: 1.5rem; font-weight: 700; margin: 0; }
.notif-header-sub { font-size: .82rem; color: #888; margin-top: 2px; }
.notif-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.badge-unread {
  display: inline-block; background: #e53935; color: #fff;
  border-radius: 20px; padding: 2px 10px; font-size: .75rem; font-weight: 700;
}

/* Buttons */
.n-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px; border: none;
  font-size: .85rem; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: opacity .15s, transform .1s;
}
.n-btn:active { transform: scale(.97); }
.n-btn:disabled { opacity: .5; cursor: not-allowed; }
.n-btn-primary { background: #1565c0; color: #fff; }
.n-btn-primary:hover { background: #0d47a1; color: #fff; }
.n-btn-outline { background: transparent; border: 1.5px solid #ccc; color: #333; }
.n-btn-outline:hover { background: #f5f5f5; color: #333; }
.n-btn-ghost { background: transparent; color: #888; border: 1.5px solid #e0e0e0; }
.n-btn-ghost:hover { background: #fce4ec; color: #c62828; border-color: #ef9a9a; }
.n-icon-btn {
  width: 30px; height: 30px; border-radius: 7px; border: none;
  background: transparent; color: #aaa; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s;
}
.n-icon-btn:hover { background: #f0f0f0; color: #333; }

/* Filter bar */
.notif-filter-bar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px; margin-bottom: 16px;
  padding: 10px 14px;
  background: #f8f9fa; border: 1px solid #e0e0e0; border-radius: 10px;
}
.notif-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.n-select {
  padding: 5px 10px; border: 1px solid #ccc; border-radius: 7px;
  font-size: .83rem; background: #fff; cursor: pointer;
}
.n-toggle-label {
  display: flex; align-items: center; gap: 6px;
  font-size: .83rem; color: #555; cursor: pointer; user-select: none;
}

/* Notification list */
.notif-list { display: flex; flex-direction: column; gap: 6px; }

.notif-item {
  display: flex; align-items: flex-start; gap: 0;
  background: #fff; border: 1px solid #e0e0e0; border-radius: 10px;
  overflow: hidden; transition: opacity .25s, box-shadow .15s;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.notif-item:hover { box-shadow: 0 3px 10px rgba(0,0,0,.09); }
.notif-item.is-read { opacity: .6; background: #fafafa; }

.notif-type-bar { width: 4px; flex-shrink: 0; }
.notif-item.type-info    .notif-type-bar { background: #1976d2; }
.notif-item.type-success .notif-type-bar { background: #2e7d32; }
.notif-item.type-warning .notif-type-bar { background: #e65100; }
.notif-item.type-error   .notif-type-bar { background: #c62828; }

.notif-item-icon {
  padding: 14px 10px 14px 12px; font-size: 1.1rem; flex-shrink: 0;
}
.notif-item.type-info    .notif-item-icon { color: #1976d2; }
.notif-item.type-success .notif-item-icon { color: #2e7d32; }
.notif-item.type-warning .notif-item-icon { color: #e65100; }
.notif-item.type-error   .notif-item-icon { color: #c62828; }

.notif-item-body { flex: 1; padding: 12px 8px; min-width: 0; }
.notif-item-title { font-weight: 600; font-size: .9rem; margin-bottom: 3px; }
.notif-item-msg { font-size: .83rem; color: #666; margin-bottom: 6px; line-height: 1.5; }
.notif-item-meta { display: flex; align-items: center; gap: 8px; }
.notif-module-tag {
  background: #e3f2fd; color: #1565c0; border-radius: 5px;
  padding: 1px 7px; font-size: .72rem; font-weight: 600;
}
.notif-time { font-size: .75rem; color: #aaa; }

.notif-item-actions {
  display: flex; align-items: center; gap: 2px;
  padding: 8px 8px 8px 4px; flex-shrink: 0;
}

/* Empty state */
.notif-empty {
  text-align: center; padding: 48px 20px; color: #aaa;
}
.notif-empty i { font-size: 2.5rem; margin-bottom: 12px; display: block; opacity: .4; }
.notif-empty p { margin: 0; font-size: .95rem; }

/* ── Settings styles ── */
.settings-section-label {
  font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: #888; margin: 0 0 8px 4px;
}
.settings-module-list { display: flex; flex-direction: column; gap: 6px; }

.settings-card {
  background: #fff; border: 1px solid #e0e0e0; border-radius: 10px;
  padding: 14px 16px; box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.settings-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.settings-card-title { font-weight: 600; font-size: .9rem; }
.settings-card-sub { font-size: .78rem; color: #aaa; margin-top: 2px; }

.toggle-pair { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.toggle-label { font-size: .78rem; color: #888; white-space: nowrap; }

/* Toggle switch */
.n-switch { position: relative; display: inline-block; width: 38px; height: 22px; }
.n-switch input { opacity: 0; width: 0; height: 0; }
.n-switch-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #ccc; border-radius: 22px; transition: .2s;
}
.n-switch-slider::before {
  content: ''; position: absolute;
  width: 16px; height: 16px; border-radius: 50%;
  left: 3px; bottom: 3px; background: #fff;
  transition: .2s;
}
.n-switch input:checked + .n-switch-slider { background: #1565c0; }
.n-switch input:checked + .n-switch-slider::before { transform: translateX(16px); }

/* ── Bell animations ── */
@keyframes bell-shake {
  0%,100% { transform: rotate(0deg); }
  15%      { transform: rotate(18deg); }
  30%      { transform: rotate(-16deg); }
  45%      { transform: rotate(12deg); }
  60%      { transform: rotate(-8deg); }
  75%      { transform: rotate(4deg); }
}
@keyframes badge-pop {
  0%   { transform: scale(0.4); opacity: 0; }
  70%  { transform: scale(1.3); }
  100% { transform: scale(1);   opacity: 1; }
}
.notif-bell-btn.shake i { animation: bell-shake .55s ease; }
.notif-badge.pop { animation: badge-pop .35s cubic-bezier(.175,.885,.32,1.275); }

/* ── Header Bell ── */
.notif-bell-wrap {
  position: relative; display: flex; align-items: center;
}
.notif-bell-btn {
  background: transparent; border: none; color: rgba(255,255,255,.85);
  font-size: 1.1rem; padding: 6px 8px; cursor: pointer; border-radius: 8px;
  position: relative; transition: color .15s, background .15s;
}
.notif-bell-btn:hover { background: rgba(255,255,255,.15); color: #fff; }
.notif-badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 16px; height: 16px; border-radius: 10px;
  background: #f44336; color: #fff;
  font-size: .65rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px; pointer-events: none;
  border: 1.5px solid var(--primary-color, #1565c0);
}
.notif-badge.hidden { display: none; }

/* ── Dropdown ── */
.notif-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 340px; background: #fff; border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,.18); border: 1px solid #e0e0e0;
  z-index: 1050; display: none; overflow: hidden;
  color: #212121;  /* explicit dark text — overrides any header inheritance */
}
.notif-dropdown.open { display: block; }
.notif-dd-head {
  padding: 12px 16px; border-bottom: 1px solid #f0f0f0;
  display: flex; align-items: center; justify-content: space-between;
  background: #fff;
}
.notif-dd-head-title { font-weight: 700; font-size: .9rem; color: #212121; }
.notif-dd-list { max-height: 320px; overflow-y: auto; }
.notif-dd-item {
  display: flex; gap: 10px; padding: 11px 16px;
  border-bottom: 1px solid #f5f5f5; transition: background .1s; cursor: default;
  color: #212121;
}
.notif-dd-item:hover { background: #f5f5f5; }
.notif-dd-item.unread { background: #e8f0fe; }
.notif-dd-item.unread:hover { background: #dce8fd; }
.notif-dd-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px;
}
.notif-dd-item.type-info    .notif-dd-dot { background: #1976d2; }
.notif-dd-item.type-success .notif-dd-dot { background: #2e7d32; }
.notif-dd-item.type-warning .notif-dd-dot { background: #e65100; }
.notif-dd-item.type-error   .notif-dd-dot { background: #c62828; }
.notif-dd-title { font-size: .83rem; font-weight: 600; margin-bottom: 2px; color: #1a1a1a; }
.notif-dd-time  { font-size: .72rem; color: #757575; }
.notif-dd-empty { padding: 24px; text-align: center; color: #999; font-size: .85rem; }
.notif-dd-footer {
  padding: 10px 16px; border-top: 1px solid #f0f0f0; background: #fafafa;
  display: flex; justify-content: center;
}
.notif-dd-footer a {
  font-size: .83rem; color: #1565c0; text-decoration: none; font-weight: 600;
}
.notif-dd-footer a:hover { text-decoration: underline; }

/* ── Toast notifications ── */
.notif-toast-container {
  position: fixed; top: 68px; right: 16px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(110%); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); max-height: 80px; margin-bottom: 0; }
  to   { opacity: 0; transform: translateX(110%); max-height: 0; margin-bottom: -8px; }
}
.notif-toast {
  background: #fff; border-radius: 10px; padding: 12px 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,.18); border: 1px solid #e0e0e0;
  min-width: 280px; max-width: 340px; pointer-events: auto;
  animation: toast-in .35s cubic-bezier(.175,.885,.32,1.1) forwards;
  display: flex; gap: 10px; align-items: flex-start;
  color: #212121;
}
.notif-toast.removing {
  animation: toast-out .3s ease forwards;
}
.notif-toast-dot {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; margin-top: 4px;
}
.notif-toast.type-info    .notif-toast-dot { background: #1976d2; }
.notif-toast.type-success .notif-toast-dot { background: #2e7d32; }
.notif-toast.type-warning .notif-toast-dot { background: #e65100; }
.notif-toast.type-error   .notif-toast-dot { background: #c62828; }
.notif-toast-title { font-size: .83rem; font-weight: 700; margin-bottom: 2px; }
.notif-toast-body  { font-size: .78rem; color: #555; line-height: 1.4; }
.notif-toast-time  { font-size: .7rem; color: #aaa; margin-top: 3px; }
.notif-toast-close {
  margin-left: auto; background: none; border: none; color: #bbb;
  cursor: pointer; font-size: .85rem; padding: 0 0 0 6px; flex-shrink: 0;
  line-height: 1;
}
.notif-toast-close:hover { color: #666; }
