/* Notification Bell Badge */
.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 2px solid #fff;
  animation: notif-pulse 2s ease-in-out infinite;
}

@keyframes notif-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Notification Dropdown */
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: -40px;
  width: 380px;
  max-height: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px);
  transition: max-height 0.3s ease, opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
  pointer-events: none;
}

.notif-dropdown-open {
  max-height: 520px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Header */
.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #f3f4f6;
}

.notif-header-title {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.notif-mark-read {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #1e40af;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
  font-family: inherit;
}

.notif-mark-read:hover {
  background: #eff6ff;
}

/* Notification List */
.notif-list {
  max-height: 420px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}

.notif-list::-webkit-scrollbar {
  width: 5px;
}

.notif-list::-webkit-scrollbar-track {
  background: transparent;
}

.notif-list::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

/* Notification Item */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
  border-bottom: 1px solid #f9fafb;
}

.notif-item:hover {
  background: #f9fafb;
}

.notif-item:last-child {
  border-bottom: none;
}

/* Notification Icon */
.notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #f3f4f6;
}

.notif-item[data-type="notice.new"] .notif-icon { background: #eff6ff; }
.notif-item[data-type="vacancy.new"] .notif-icon { background: #ecfdf5; }
.notif-item[data-type="user.welcome"] .notif-icon { background: #f5f3ff; }
.notif-item[data-type="application.submitted"] .notif-icon,
.notif-item[data-type="application.received"] .notif-icon { background: #fffbeb; }

/* Content */
.notif-content {
  flex: 1;
  min-width: 0;
}

.notif-title {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  line-height: 1.3;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notif-message {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notif-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  color: #1e40af;
  background: #eff6ff;
  padding: 1px 6px;
  border-radius: 4px;
  vertical-align: middle;
}

.notif-time {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 3px;
}

/* Empty State */
.notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  color: #9ca3af;
  gap: 12px;
}

.notif-empty p {
  font-size: 14px;
  margin: 0;
}

/* Loading skeleton */
.notif-skeleton {
  padding: 12px 16px;
  display: flex;
  gap: 12px;
  animation: notif-shimmer 1.5s infinite;
}

.notif-skeleton-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f3f4f6;
}

.notif-skeleton-lines {
  flex: 1;
}

.notif-skeleton-line {
  height: 10px;
  border-radius: 4px;
  background: #f3f4f6;
  margin-bottom: 8px;
}

.notif-skeleton-line:first-child { width: 70%; }
.notif-skeleton-line:nth-child(2) { width: 90%; }
.notif-skeleton-line:last-child { width: 40%; }

@keyframes notif-shimmer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Mobile responsive */
@media (max-width: 480px) {
  .notif-dropdown {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 0;
  }

  .notif-dropdown-open {
    max-height: 70vh;
  }

  .notif-list {
    max-height: calc(70vh - 50px);
  }
}

/* =====================================================
   Full-page notifications view
   ===================================================== */

.notif-page {
  min-height: calc(100vh - 80px);
  background: #f9fafb;
  padding: 24px 16px;
}

.notif-page__inner {
  max-width: 680px;
  margin: 0 auto;
}

.notif-page__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 0 2px;
}

.notif-page__title {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.notif-page__list {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

/* Page-specific item overrides */
.notif-item--page {
  padding: 14px 18px;
  position: relative;
}

.notif-item--page .notif-title {
  font-size: 14px;
  white-space: normal;
}

.notif-item--page .notif-message {
  font-size: 13px;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

.notif-item--unread {
  background: #f0fdf4;
}

.notif-item--unread:hover {
  background: #e8faf0;
}

.notif-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00A651;
  flex-shrink: 0;
  align-self: center;
  margin-left: 8px;
}

@media (max-width: 640px) {
  .notif-page {
    padding: 16px 0;
    background: #fff;
  }

  .notif-page__inner {
    max-width: 100%;
  }

  .notif-page__header {
    padding: 0 16px 12px;
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: 0;
  }

  .notif-page__list {
    border-radius: 0;
    box-shadow: none;
  }
}

/* Settings panel inside dropdown */
.notif-header-title {
  display: flex;
  align-items: center;
  gap: 6px;
}
.notif-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.notif-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.notif-icon-btn:hover { background: #f3f4f6; color: #1e40af; }
.notif-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  border-radius: 6px;
}
.notif-back:hover { background: #f3f4f6; color: #1e40af; }
.notif-back[hidden] { display: none; }

.notif-prefs {
  max-height: 440px;
  overflow-y: auto;
  padding: 4px 0 8px;
}
.notif-prefs__section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  padding: 10px 16px 4px;
  margin: 0;
}
.notif-pref-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid #f3f4f6;
}
.notif-pref-row:last-child { border-bottom: none; }
.notif-pref-row__info { min-width: 0; flex: 1; }
.notif-pref-row__name {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-pref-row__desc {
  font-size: 11px;
  color: #6b7280;
  margin: 0;
  line-height: 1.35;
}
.notif-pref-row--group .notif-pref-row__name {
  white-space: normal;
}
.notif-pref-row__channels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.notif-pref-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #6b7280;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  padding: 2px 8px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.notif-pref-chip[aria-pressed="true"] {
  background: #dbeafe;
  color: #1e40af;
  border-color: #93c5fd;
}
.notif-pref-chip[aria-disabled="true"] { opacity: 0.5; cursor: wait; }

/* Toggle switch (workflow on/off) */
.notif-switch {
  --w: 36px;
  --h: 20px;
  position: relative;
  display: inline-block;
  width: var(--w);
  height: var(--h);
  flex: 0 0 var(--w);
}
.notif-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.notif-switch__slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.18s;
}
.notif-switch__slider::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.18s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.notif-switch input:checked + .notif-switch__slider { background: #1e40af; }
.notif-switch input:checked + .notif-switch__slider::before { transform: translateX(16px); }
.notif-switch input:disabled + .notif-switch__slider { opacity: 0.5; cursor: wait; }
.notif-pref-row.is-disabled .notif-pref-row__channels .notif-pref-chip { opacity: 0.4; pointer-events: none; }
