/**
 * Global floating notifications dock — shared across all main pages.
 * Uses CSS variables with fallbacks when a page omits :root tokens.
 */

.app-notif-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1190;
  background: rgba(0, 0, 0, 0.52);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.app-notif-backdrop.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.app-notif-dock {
  position: fixed;
  bottom: clamp(1rem, 4vw, 1.35rem);
  right: clamp(1rem, 4vw, 1.35rem);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.65rem;
}

.app-notif-panel {
  width: min(100vw - 2rem, 380px);
  max-height: min(70vh, 520px);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(165deg, #1a2029 0%, var(--surface, #12161c) 100%);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  pointer-events: none;
  visibility: hidden;
  transition:
    opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.28s ease;
}

.app-notif-panel.is-active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  visibility: visible;
}

.app-notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.app-notif-panel-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: rgba(248, 250, 252, 0.98);
}

.app-notif-panel-close {
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(200, 210, 224, 0.92);
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, color 0.2s ease;
}

.app-notif-panel-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text, #f0f3f7);
}

.app-notif-panel-scroll {
  overflow: auto;
  padding: 0.5rem 0.65rem 0.85rem;
  flex: 1;
  min-height: 0;
}

.app-notif-panel-empty {
  margin: 0;
  padding: 1.25rem 0.75rem;
  text-align: center;
  font-size: 0.86rem;
  color: var(--muted, #8b96a8);
}

.app-notif-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.app-notif-item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 0.55rem 0.62rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.app-notif-item:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

.app-notif-item.is-unread {
  border-color: rgba(110, 176, 255, 0.35);
  background: rgba(110, 176, 255, 0.09);
}

.app-notif-link {
  display: block;
  color: rgba(220, 232, 246, 0.96);
  text-decoration: none;
  font-size: 0.84rem;
  line-height: 1.35;
  cursor: pointer;
}

.app-notif-link:hover {
  color: #fff;
}

.app-notif-time {
  margin: 0.22rem 0 0;
  color: var(--muted, #8b96a8);
  font-size: 0.72rem;
}

.app-notif-fab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem 0.55rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(165deg, rgba(38, 47, 61, 0.74) 0%, rgba(24, 30, 40, 0.8) 100%),
    rgba(20, 25, 33, 0.58);
  color: rgba(240, 243, 247, 0.96);
  font-size: 0.82rem;
  font-weight: 650;
  font-family: inherit;
  cursor: pointer;
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.44),
    0 3px 10px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(158, 186, 221, 0.17),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(9px) saturate(130%);
  backdrop-filter: blur(9px) saturate(130%);
  transition:
    transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.24s ease,
    border-color 0.2s ease,
    filter 0.2s ease;
}

.app-notif-fab:hover {
  transform: translateY(-2px) scale(1.035);
  border-color: rgba(110, 176, 255, 0.35);
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.5),
    0 5px 14px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(110, 176, 255, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  filter: brightness(1.05);
}

.app-notif-fab-bell {
  font-size: 1.1rem;
  line-height: 1;
}

.app-notif-fab-label {
  letter-spacing: 0.02em;
}

.app-notif-badge {
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff6b7a 0%, #e8485c 100%);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(232, 72, 92, 0.45);
}
