/* Shared notification bell used by the public header and the platform admin. */
.notification-wrapper {
  position: relative;
  display: inline-block;
  color: inherit;
  white-space: normal;
}

.notification-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  margin-right: 20px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.2) !important;
  color: inherit;
  text-decoration: none;
}

.notification-icon:hover {
  background-color: rgba(0, 0, 0, 0.35) !important;
  cursor: pointer;
  transform: scale(1.05);
  transition: all 0.2s ease;
}

.notification-icon i {
  transition: color 0.2s ease;
}

.notification-icon:hover i {
  color: #fff;
}

.notif-count {
  position: absolute;
  top: -5px;
  right: -5px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 50%;
  background-color: #e64545;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.notification-panel {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 2000;
  width: 340px;
  margin-top: 10px;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 48px rgba(17, 24, 39, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.48);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  backdrop-filter: blur(18px) saturate(135%);
}

.notification-panel.active {
  display: block !important;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.notification-panel::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 28px;
  width: 12px;
  height: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.62);
  border-left: 1px solid rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.88);
  transform: rotate(45deg);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  backdrop-filter: blur(18px) saturate(135%);
}

.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.07);
  border-radius: 14px 14px 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.12));
}

.notif-header p,
.notification-panel .notif-header p {
  margin: 0 !important;
  color: #4b5563;
  font-size: 13px;
  font-weight: 400 !important;
  line-height: 1.2;
}

.clear-all-btn {
  margin: 0;
  padding: 6px 10px;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 999px;
  background: rgba(248, 249, 251, 0.64);
  color: #7a838f;
  font-size: 9.5px !important;
  font-weight: 500;
  line-height: 1.05;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.clear-all-btn:hover {
  border-color: rgba(17, 24, 39, 0.16);
  background: rgba(238, 241, 244, 0.78);
  color: #374151;
}

.clear-all-btn:focus,
.clear-all-btn:focus-visible {
  outline: 0;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
}

.notif-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 390px;
  padding: 6px;
  overflow-y: auto;
}

.notif-list > p {
  margin: 0;
  padding: 18px 14px !important;
  color: #8b95a1 !important;
  font-size: 12px;
  text-align: center;
}

.notif-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: start;
  gap: 8px;
  padding: 10px 8px 10px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  transition: background 0.16s ease, box-shadow 0.16s ease;
}

.notif-item:hover {
  background: rgba(246, 247, 249, 0.7);
}

.notif-content {
  min-width: 0;
  color: #111827;
}

.notif-achievement-content {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
}

.notif-achievement-marker {
  flex: 0 0 auto;
  width: var(--site-card-flag-icon-size, 28px);
  height: var(--site-card-flag-icon-height, 43px);
  margin-top: 1px;
  object-fit: contain;
}

.notif-achievement-copy {
  min-width: 0;
}

.notif-achievement-title {
  margin: 0 0 2px;
  color: #111827;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.notif-achievement-text,
.notif-msg-short,
.notif-msg-full,
.notif-msg-full p {
  margin: 0;
  color: #1f2937 !important;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}

.notif-toggle {
  margin: 5px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #6b7280;
  font-size: 11px;
  line-height: 1.2;
  cursor: pointer;
}

.notif-toggle:hover {
  color: #111827;
}

.notif-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 7px;
}

.notif-time {
  color: #9aa3af;
  font-size: 11px;
  line-height: 1.2;
}

.notif-action {
  flex: 0 0 auto;
  max-width: 128px;
  padding: 5px 10px;
  overflow: hidden;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 999px;
  background: rgba(248, 249, 251, 0.64);
  color: #6b7280;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.notif-action:hover {
  border-color: rgba(17, 24, 39, 0.16);
  background: rgba(238, 241, 244, 0.78);
  color: #374151;
}

.notif-action:focus,
.notif-action:focus-visible {
  outline: 0;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
}

.notif-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin: -3px -3px 0 0;
  padding: 0;
  border-radius: 999px;
  color: #8b95a1;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.notif-menu:hover {
  background: rgba(236, 239, 243, 0.76);
  color: #111827;
}

.notif-dropdown {
  position: absolute;
  top: 28px;
  right: 0;
  display: none;
  min-width: 150px;
  overflow: hidden;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 34px rgba(17, 24, 39, 0.16);
  -webkit-backdrop-filter: blur(14px) saturate(128%);
  backdrop-filter: blur(14px) saturate(128%);
}

.notif-dropdown-floating {
  position: fixed;
  top: auto;
  right: auto;
  z-index: 3200;
  display: block;
}

.notif-dropdown button {
  width: 100%;
  padding: 9px 11px;
  border: 0;
  background: transparent;
  color: #374151;
  font-size: 12px;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}

.notif-dropdown button:hover {
  background: rgba(243, 244, 246, 0.78);
}

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
}

.toast {
  position: relative;
  min-width: 280px;
  max-width: 360px;
  margin-bottom: 10px;
  padding: 12px 16px 12px 42px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  color: #111;
  box-shadow: 0 12px 30px rgba(17, 24, 39, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.38);
  font-size: 13px;
  line-height: 1.4;
  opacity: 1;
  word-break: break-word;
  transition: opacity 0.35s ease, transform 0.2s ease;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.toast::before,
.toast::after {
  position: absolute;
  top: 50%;
  left: 16px;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
}

.toast::before {
  content: "";
  border-radius: 50%;
  background: rgba(17, 24, 39, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.toast::after {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111;
  font-size: 11px;
  font-weight: 700;
}

.toast-success::after {
  content: "\2713";
}

.toast-error::after {
  content: "!";
}

.toast-warning::after {
  content: "\2022";
  font-size: 16px;
}

.toast.hide {
  opacity: 0;
  transform: translateY(-6px);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .notification-panel,
  .notification-panel::before {
    background: rgba(255, 255, 255, 0.96);
  }

  .notif-dropdown {
    background: rgba(255, 255, 255, 0.98);
  }
}

.platform-admin .pa-userline .notification-icon {
  margin-right: 0;
}

.platform-admin .pa-userline .notification-panel {
  color: #111827;
  text-align: left;
  white-space: normal;
}

@media (max-width: 768px) {
  .notification-panel {
    position: fixed !important;
    top: 74px !important;
    right: 16px !important;
    left: 16px !important;
    width: auto !important;
    max-height: min(70vh, 520px);
    overflow: hidden;
    border-radius: 16px;
  }

  .notification-panel::before {
    display: none !important;
  }

  .clear-all-btn {
    white-space: nowrap;
  }

  .toast-container {
    right: 16px;
    left: 16px;
    max-width: none;
  }

  .toast {
    width: 100%;
    min-width: 0;
  }
}
