/* ===================================================================
   Push-notification UX — soft-ask card + foreground toast.
   Scoped under `sp-push-*`. Theme-aware (light/dark) and responsive from
   320px up. The card sits ABOVE the mobile bottom-nav (≤1024px) and bottom-
   right on desktop; the toast drops in from the top.
   =================================================================== */

/* ---------------- soft-ask card ---------------- */
.sp-push-card {
  position: fixed;
  z-index: 1200;
  display: flex;
  gap: 14px;
  padding: 16px 16px 15px;
  background: #ffffff;
  border: 1px solid #eceef1;
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(17, 24, 34, 0.16), 0 2px 8px rgba(17, 24, 34, 0.06);
  animation: sp-push-in 0.42s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;

  /* mobile / tablet: full-width strip, lifted above the bottom app-bar */
  left: 12px;
  right: 12px;
  bottom: calc(74px + env(safe-area-inset-bottom, 0px));
}

/* desktop: a compact floating card, bottom-right (no bottom-nav there) */
@media (min-width: 1025px) {
  .sp-push-card {
    left: auto;
    right: 22px;
    bottom: 22px;
    width: 380px;
    max-width: 380px;
  }
}

.sp-push-ico {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #3a3a3a 0%, #0a0a0a 100%);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  position: relative;
}

/* soft pulsing ring so the bell reads as "live / new" */
.sp-push-ico::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 18px;
  border: 2px solid rgba(0, 0, 0, 0.3);
  animation: sp-push-ring 2s ease-out infinite;
}

.sp-push-body {
  flex: 1 1 auto;
  min-width: 0;
}

.sp-push-title {
  margin: 1px 0 3px;
  font-size: 15.5px;
  font-weight: 700;
  color: #14181d;
  line-height: 1.3;
}

.sp-push-text {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.5;
  color: #5b636d;
}

.sp-push-actions {
  display: flex;
  gap: 9px;
  align-items: center;
}

.sp-push-allow {
  flex: 0 0 auto;
  border: none;
  cursor: pointer;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #3a3a3a 0%, #0a0a0a 100%);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.sp-push-allow:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.4);
}

.sp-push-allow:active {
  transform: scale(0.97);
}

.sp-push-allow:disabled {
  filter: grayscale(0.3) opacity(0.75);
  cursor: default;
  transform: none;
}

.sp-push-later {
  flex: 0 0 auto;
  border: none;
  background: none;
  cursor: pointer;
  padding: 9px 10px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  color: #7a828c;
  transition: background 0.18s ease, color 0.18s ease;
}

.sp-push-later:hover {
  background: #f2f4f6;
  color: #14181d;
}

.sp-push-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: #f2f4f6;
  color: #8a929c;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.sp-push-close:hover {
  background: #e7eaee;
  color: #14181d;
}

/* ---------------- foreground toast ---------------- */
.sp-push-toast {
  position: fixed;
  z-index: 1250;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  text-decoration: none;
  background: #ffffff;
  border: 1px solid #eceef1;
  border-left: 4px solid #0a0a0a;
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(17, 24, 34, 0.18);
  animation: sp-push-drop 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;

  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 12px;
  right: 12px;
}

@media (min-width: 1025px) {
  .sp-push-toast {
    left: auto;
    right: 18px;
    top: 18px;
    width: 400px;
    max-width: 400px;
  }
}

.sp-push-toast-img {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  object-fit: cover;
}

.sp-push-toast-ic {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #3a3a3a 0%, #0a0a0a 100%);
}

.sp-push-toast-txt {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sp-push-toast-title {
  font-size: 14px;
  font-weight: 700;
  color: #14181d;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sp-push-toast-body {
  font-size: 12.5px;
  color: #5b636d;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------------- dark mode ---------------- */
.dark-mode .sp-push-card,
.dark-mode .sp-push-toast {
  background: #171b21;
  border-color: #262c34;
}

.dark-mode .sp-push-toast {
  /* on the dark card a lifted near-black keeps the accent visible */
  border-left-color: #4a4a4a;
}

.dark-mode .sp-push-title,
.dark-mode .sp-push-toast-title {
  color: #f2f4f7;
}

.dark-mode .sp-push-text,
.dark-mode .sp-push-toast-body {
  color: #aab3bd;
}

.dark-mode .sp-push-later {
  color: #aab3bd;
}

.dark-mode .sp-push-later:hover {
  background: #1f242b;
  color: #f2f4f7;
}

.dark-mode .sp-push-close {
  background: #262c34;
  color: #aab3bd;
}

.dark-mode .sp-push-close:hover {
  background: #303842;
  color: #f2f4f7;
}

/* ---------------- animations ---------------- */
@keyframes sp-push-in {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes sp-push-drop {
  from {
    opacity: 0;
    transform: translateY(-24px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes sp-push-ring {
  0% {
    transform: scale(0.85);
    opacity: 0.7;
  }
  70% {
    transform: scale(1.15);
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sp-push-card,
  .sp-push-toast {
    animation: none;
  }
  .sp-push-ico::after {
    animation: none;
  }
}
