/**
 * Notifications — aligned with #index .homeLanding (cream field, teal, frosted cards, DM Sans).
 */

body.logged-out #notifications {
  display: none !important;
}

#notifications.notificationsBodySection {
  --notifNavy: var(--color-text, #2c3340);
  --notifTeal: var(--color-accent, #5c9120);
  --notifTealDeep: var(--color-accent-dark, #487f14);
  --notif-viewport-offset: 76px;
  position: relative;
  box-sizing: border-box;
  overflow-x: hidden;
  padding-bottom: clamp(16px, 3vw, 40px);
  min-height: calc(100vh - var(--notif-viewport-offset));
  min-height: calc(100svh - var(--notif-viewport-offset));
  min-height: calc(100dvh - var(--notif-viewport-offset));
  color: #2f3a48;
  background:
    radial-gradient(ellipse 95% 55% at 50% 28%, rgba(232, 210, 175, 0.14) 0%, transparent 58%),
    radial-gradient(ellipse 125% 78% at 50% -12%, rgba(255, 255, 255, 0.92) 0%, transparent 52%),
    radial-gradient(ellipse 68% 44% at 92% 6%, rgba(255, 236, 214, 0.35) 0%, transparent 42%),
    linear-gradient(172deg, #fffefb 0%, #faf7f2 42%, #f3eee6 70%, #e9e2d6 100%);
}

#notifications::before {
  content: "";
  position: absolute;
  inset: 0;
  min-height: 100%;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.45) 0%, transparent 11%),
    radial-gradient(circle at 80% 16%, rgba(212, 175, 110, 0.07) 0%, transparent 13%),
    radial-gradient(circle at 50% 88%, rgba(230, 215, 195, 0.26) 0%, transparent 38%);
  opacity: 0.52;
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  #notifications .notificationsCard,
  #notifications .notificationsToolbar,
  #notifications .notificationsItem {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  #notifications .notificationsCard {
    background: #fffcf9;
  }

  #notifications .notificationsToolbar {
    background: rgba(255, 252, 249, 0.94);
  }

  #notifications .notificationsItem {
    background: #fffcf9;
  }

  #notifications.notificationsBodySection > .bodyTitle {
    background: rgba(255, 252, 249, 0.96);
  }
}

#notifications.notificationsBodySection > .bodyTitle {
  position: relative;
  z-index: 1;
  font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--notifNavy, #2c3340);
  margin: clamp(8px, 1.5vw, 14px) clamp(10px, 2vw, 18px) 0;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: blur(14px) saturate(1.06);
  backdrop-filter: blur(14px) saturate(1.06);
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 16px;
  border-bottom: 1px solid rgba(74, 139, 181, 0.08);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.88) inset,
    0 8px 28px rgba(74, 139, 181, 0.06);
  box-sizing: border-box;
}

#notifications .notificationsMain {
  position: relative;
  z-index: 1;
  max-width: min(1040px, 100%);
  margin: 0 auto;
  padding: clamp(16px, 2.5vw, 28px) clamp(12px, 2vw, 20px) 48px;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
}

#notifications .notificationsCard {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(16px) saturate(1.06);
  backdrop-filter: blur(16px) saturate(1.06);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 10px 36px rgba(74, 139, 181, 0.07),
    0 2px 8px rgba(74, 139, 181, 0.04);
  padding: 22px 22px 24px;
  text-align: left;
  box-sizing: border-box;
}


#notifications .notificationsResponse {
  color: red;
  height: 0;
  font-size: 12px;
  margin: auto;
  padding: 0 10px;
  text-align: center;
  width: fit-content;
  margin-bottom: 10px;
  overflow: hidden;
  transition: height 0.3s ease, padding 0.3s ease;
}

#notifications .notificationsResponse.show {
  height: 50px;
  padding: 10px;
}

#notifications .notificationsToolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.65);
  -webkit-backdrop-filter: blur(12px) saturate(1.04);
  backdrop-filter: blur(12px) saturate(1.04);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.88);
  margin-bottom: 16px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 4px 18px rgba(74, 139, 181, 0.05);
}

#notifications .notificationsToolbarRight {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

#notifications .notificationsToolbarLeft {
  display: flex;
  align-items: center;
  gap: 10px;
}

#notifications .notificationsToolbarTitle {
  font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--notifNavy, #2c3340);
}

#notifications .notificationsFilter {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #2f3a48;
  font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
}

#notifications .notificationsSelect {
  font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
  padding: 8px 32px 8px 12px;
  border: 2px solid rgba(92, 145, 32, 0.38);
  border-radius: 12px;
  background-color: rgba(232, 246, 249, 0.95);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--notifNavy, #2c3340);
  cursor: pointer;
  appearance: none;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.75) inset,
    0 2px 10px rgba(92, 145, 32, 0.1);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='%231b6b7a'%3E%3Cpath d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

#notifications .notificationsSelect:hover {
  border-color: rgba(92, 145, 32, 0.55);
  background-color: rgba(218, 240, 245, 0.98);
}

#notifications .notificationsSelect:focus {
  outline: none;
  border-color: var(--notifTeal, #5c9120);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 0 0 3px rgba(92, 145, 32, 0.18);
}

#notifications .notificationsMarkAllReadButton {
  font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(180deg, var(--notifTeal, #5c9120) 0%, var(--notifTealDeep, #487f14) 100%);
  color: #ffffff;
  border-radius: 9999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.12s ease, box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.2) inset,
    0 4px 14px rgba(92, 145, 32, 0.2);
}

#notifications .notificationsMarkAllReadButton:hover {
  background: linear-gradient(180deg, #56851f 0%, #3f6e12 100%);
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.22) inset,
    0 6px 18px rgba(92, 145, 32, 0.24);
}

#notifications .notificationsMarkAllReadButton:active {
  transform: translateY(1px);
}

#notifications .notificationsMarkAllReadButton:focus-visible {
  outline: 2px solid var(--notifTeal, #5c9120);
  outline-offset: 2px;
}

#notifications .notificationsMarkAllReadButton:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
  background: linear-gradient(180deg, #94a3b8 0%, #64748b 100%);
}

#notifications .notificationsList {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#notifications .notificationsEmpty {
  font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
  padding: 18px 16px;
  border: 1px dashed rgba(92, 145, 32, 0.28);
  border-radius: 14px;
  color: #5a6578;
  font-size: 14px;
  line-height: 1.55;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

#notifications .notificationsItem {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 14px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(10px) saturate(1.03);
  backdrop-filter: blur(10px) saturate(1.03);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 4px 14px rgba(74, 139, 181, 0.04);
  transition: background 1.2s ease, border-color 1.2s ease, box-shadow 1.2s ease;
}

#notifications .notificationsItem.notificationsUnread {
  background: rgba(232, 246, 249, 0.92);
  border-color: rgba(92, 145, 32, 0.35);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.75) inset,
    0 6px 18px rgba(92, 145, 32, 0.12);
}

#notifications .notificationsItem.notificationsReadFade {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 4px 14px rgba(74, 139, 181, 0.04);
}

#notifications .notificationsItemLink {
  text-decoration: none;
  color: inherit;
  display: contents;
}

#notifications .notificationsItemLeft {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(232, 246, 249, 0.65);
  border: 1px solid rgba(74, 139, 181, 0.1);
  box-sizing: border-box;
}

#notifications .notificationsItemAvatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#notifications .notificationsItemIcon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(232, 246, 249, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--notifTeal, #5c9120);
  border: 1px solid rgba(74, 139, 181, 0.1);
  box-sizing: border-box;
}

#notifications .notificationsItemLeft .notificationsItemIcon {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
}

#notifications .notificationsIconUnread {
  color: var(--notifTealDeep, #487f14);
}

#notifications .notificationsItemActions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

#notifications .notificationsActionBtn {
  appearance: none;
  border: 1px solid rgba(74, 139, 181, 0.22);
  border-radius: 10px;
  padding: 7px 12px;
  font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  color: #1f2a37;
  background: rgba(255, 255, 255, 0.9);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

#notifications .notificationsActionBtn:hover {
  border-color: rgba(92, 145, 32, 0.45);
  background: #fff;
}

#notifications .notificationsActionAccept {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(180deg, #6fad2c 0%, #5c9120 100%);
}

#notifications .notificationsActionAccept:hover {
  background: linear-gradient(180deg, #78b832 0%, #54841d 100%);
  color: #fff;
}

#notifications .notificationsActionReject {
  color: #9b2c2c;
  border-color: rgba(155, 44, 44, 0.28);
  background: rgba(255, 245, 245, 0.95);
}

#notifications .notificationsActionReject:hover {
  border-color: rgba(155, 44, 44, 0.45);
  background: #fff;
  color: #9b2c2c;
}

#notifications .notificationsActionView {
  display: inline-flex;
  align-items: center;
}

#notifications .notificationsActionBtn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

#notifications .notificationsActionDone {
  font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 650;
  color: #5a6578;
}

#notifications .notificationsItemTitle {
  font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--notifNavy, #2c3340);
  margin-bottom: 4px;
  letter-spacing: 0.01em;
}

#notifications .notificationsItemMessage {
  font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #2f3a48;
  margin-bottom: 6px;
}

#notifications .notificationsItemMeta {
  font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 12px;
  color: #5a6578;
}

@media (max-width: 767px) {
  #notifications.notificationsBodySection {
    padding-left: max(8px, env(safe-area-inset-left));
    padding-right: max(8px, env(safe-area-inset-right));
  }

  #notifications .notificationsToolbar {
    flex-direction: column;
    align-items: stretch;
  }
  #notifications .notificationsFilter {
    justify-content: space-between;
  }
  #notifications .notificationsToolbarRight {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }
}

