/* Shared notification bell + dropdown (site + admin) */
.admin-notif-bell,
.site-notif-bell {
  position: relative;
}

.notif-bell-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  line-height: 1;
  position: relative;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.notif-bell-btn i {
  font-size: 1.1rem;
}

.notif-bell-btn:hover {
  background: rgba(15, 23, 42, 0.06);
}

.notif-bell-btn:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}

.notif-bell-btn::after {
  display: none !important;
}

.admin-notif-bell .notif-bell-btn {
  color: #334155;
  border-color: rgba(15, 23, 42, 0.08);
  background: #fff;
}

.admin-notif-bell .notif-bell-btn:hover {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.12);
}

.notif-badge {
  position: absolute;
  top: 2px;
  inset-inline-end: 2px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff !important;
  font-size: 0.62rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.35);
}

.notif-dropdown-menu.dropdown-menu {
  --bs-dropdown-padding-x: 0;
  --bs-dropdown-padding-y: 0;
  --bs-dropdown-border-radius: 16px;
  --bs-dropdown-border-color: rgba(15, 23, 42, 0.08);
  --bs-dropdown-bg: #fff;
  --bs-dropdown-link-color: #0f172a;
  --bs-dropdown-link-hover-color: #0f172a;
  --bs-dropdown-link-hover-bg: #f8fafc;
  --notif-accent: #2563eb;
  width: min(380px, calc(100vw - 1.5rem));
  padding: 0 !important;
  margin-top: 0.55rem !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  border-radius: 16px !important;
  overflow: hidden;
  background: #fff !important;
  color: #334155 !important;
  z-index: 1080;
  box-shadow:
    0 4px 6px rgba(15, 23, 42, 0.04),
    0 18px 40px rgba(15, 23, 42, 0.12) !important;
  animation: notifDropdownIn 0.22s ease;
}

@keyframes notifDropdownIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.notif-dropdown-header-main {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.notif-dropdown-header-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #002147, #0a3d7a);
  color: #fff !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(0, 33, 71, 0.22);
}

.notif-dropdown-header-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.notif-dropdown-header-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a !important;
  line-height: 1.2;
}

.notif-dropdown-header-count {
  font-size: 0.75rem;
  color: #64748b !important;
  font-weight: 500;
}

.notif-mark-all-form {
  margin: 0;
  flex-shrink: 0;
}

.notif-mark-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.65rem;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.06);
  color: #1d4ed8 !important;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.notif-mark-all-btn:hover {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.28);
  color: #1e40af !important;
}

.notif-mark-all-btn i {
  font-size: 0.85rem;
}

.notif-dropdown-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2.25rem 1.25rem;
  text-align: center;
  color: #64748b !important;
}

.notif-dropdown-empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #94a3b8 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.notif-dropdown-empty p {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 500;
  color: #64748b !important;
}

.notif-dropdown-list {
  max-height: 340px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

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

.notif-dropdown-list::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.14);
  border-radius: 999px;
}

.notif-dropdown-item {
  display: flex !important;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.85rem 1rem !important;
  text-decoration: none !important;
  color: #334155 !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  position: relative;
  transition: background 0.18s ease;
  white-space: normal;
}

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

.notif-dropdown-item::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  transition: background 0.18s ease;
}

.notif-dropdown-item:hover,
.notif-dropdown-item:focus {
  background: #f8fafc !important;
  color: #0f172a !important;
}

.notif-dropdown-item.is-unread {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.06), rgba(37, 99, 235, 0.02)) !important;
}

.notif-dropdown-item.is-unread::before {
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
}

.notif-dropdown-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}

.notif-type-enrollment_pending .notif-dropdown-icon,
.notif-type-enrollment_approved .notif-dropdown-icon,
.notif-type-enrollment_rejected .notif-dropdown-icon {
  background: rgba(0, 33, 71, 0.1);
  color: #002147 !important;
}

.notif-type-cert_request_pending .notif-dropdown-icon,
.notif-type-certificate_issued .notif-dropdown-icon,
.notif-type-certificate_rejected .notif-dropdown-icon {
  background: rgba(255, 140, 0, 0.12);
  color: #c45f00 !important;
}

.notif-type-quiz_submitted .notif-dropdown-icon,
.notif-type-quiz_graded .notif-dropdown-icon {
  background: rgba(16, 185, 129, 0.12);
  color: #059669 !important;
}

.notif-type-contact_message .notif-dropdown-icon {
  background: rgba(139, 92, 246, 0.12);
  color: #7c3aed !important;
}

.notif-dropdown-content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
}

.notif-dropdown-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.notif-dropdown-title {
  font-weight: 700;
  font-size: 0.86rem;
  color: #0f172a !important;
  line-height: 1.35;
}

.notif-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2563eb;
  flex-shrink: 0;
  margin-top: 0.35rem;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.notif-dropdown-text {
  font-size: 0.8rem;
  color: #64748b !important;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notif-dropdown-time {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: #94a3b8 !important;
  margin-top: 0.1rem;
}

.notif-dropdown-time i {
  font-size: 0.68rem;
  opacity: 0.85;
  color: #94a3b8 !important;
}

.notif-dropdown-footer {
  padding: 0.7rem 1rem;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  background: #f8fafc;
}

.notif-view-all-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: #002147 !important;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none !important;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.notif-view-all-link:hover {
  background: #002147;
  border-color: #002147;
  color: #fff !important;
}

.notif-view-all-link i {
  font-size: 0.8rem;
  transition: transform 0.2s ease;
  color: inherit !important;
}

.notif-view-all-link:hover i {
  transform: translateX(2px);
}

[dir="rtl"] .notif-view-all-link:hover i {
  transform: translateX(-2px);
}

/* Full notifications page list */
.admin-notif-list,
.notif-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-notif-item,
.notif-list-item {
  display: flex;
  gap: 0.85rem;
  padding: 1rem;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
}

.admin-notif-item:hover,
.notif-list-item:hover {
  border-color: rgba(37, 99, 235, 0.2);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.admin-notif-item.is-unread,
.notif-list-item.is-unread {
  border-color: rgba(37, 99, 235, 0.25);
  background: rgba(37, 99, 235, 0.03);
}

.admin-notif-icon,
.notif-list-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.admin-notif-title,
.notif-list-title {
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.admin-notif-text,
.notif-list-text {
  color: #64748b;
  font-size: 0.9rem;
}

.admin-notif-time,
.notif-list-time {
  color: #94a3b8;
  font-size: 0.78rem;
  margin-top: 0.35rem;
}

/* Site header: bell on orange navbar */
.site-notif-bell .notif-bell-btn {
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.12);
}

.site-notif-bell .notif-bell-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.32);
}

.site-notif-bell .notif-badge {
  border-color: #ff8c00;
}

@media (max-width: 420px) {
  .notif-mark-all-btn span {
    display: none;
  }

  .notif-dropdown-header {
    padding: 0.75rem 0.85rem;
  }

  .notif-dropdown-item {
    padding: 0.75rem 0.85rem !important;
  }
}
