/* ─────────────────────────────────────────────────────────────────────────
   Photo pop-ups (Dec 2026)
   Small glass cards that pop out of the phone in a photo, one at a time, on
   a loop: "Salary received", "Saved to School fees" and so on.
   Used on: Home (Personal + Business sections), Personal hero, Business hero.
   Behaviour lives in assets/js/photo-pops.js.

   HOW TO EDIT
   - Change the words or amounts in the page's HTML (.pp-label / .pp-amount).
   - Where the phone is in the photo: data-anchor="x,y" on .photo-pops, as
     fractions of the photo (0,0 = top left, 1,1 = bottom right).
   - Which side the cards come out: data-side="right" or "left".
   - The face: data-face="x1,y1,x2,y2" (fractions). Cards are never placed over it.
   The look matches the old receipt card: dark glass, light icon circle.
   ───────────────────────────────────────────────────────────────────────── */

.photo-pops {
  position: absolute;
  inset: 0;
  pointer-events: none;      /* never blocks clicks on the photo or the page */
  z-index: 2;
}

.pp-card {
  position: absolute;
  left: 24px;                /* static fallback spot; the script moves it next to the phone */
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: 300px;
  padding: 14px 18px 14px 14px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(10, 25, 55, 0.18);
  opacity: 0;
  transform: translateX(var(--pp-from, -18px)) scale(0.86);
  transform-origin: var(--pp-origin, left center);
}

/* Without the script (or with "reduce motion" on): the first card simply shows. */
.photo-pops:not(.is-live) .pp-card:first-of-type,
.photo-pops.is-still .pp-card.is-in { opacity: 1; transform: none; }

/* Pop in from the phone with a small, gentle overshoot… */
.photo-pops.is-live:not(.is-still) .pp-card.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.45s ease, transform 0.65s cubic-bezier(0.34, 1.45, 0.64, 1);
}
/* …then drift up and fade before the next one. */
.photo-pops.is-live .pp-card.is-out {
  opacity: 0;
  transform: translateY(-14px) scale(0.98);
  transition: opacity 0.5s ease, transform 0.6s ease;
}

.pp-ico {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #f1f5fb;
  display: flex; align-items: center; justify-content: center;
}
.pp-ico svg { width: 22px; height: 22px; display: block; }

.pp-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pp-label  { margin: 0; font-size: 14px; line-height: 20px; color: rgba(255, 255, 255, 0.82); white-space: nowrap; }
.pp-amount { margin: 0; font-size: 22px; line-height: 28px; font-weight: 600; color: #fff; letter-spacing: -0.3px; white-space: nowrap; }

/* A soft ring on the phone each time a card pops, so the card reads as coming from it. */
.pp-ping {
  position: absolute;
  width: 18px; height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  opacity: 0;
  display: none;
}
.photo-pops.is-live .pp-ping { display: block; }
.pp-ping.is-on { animation: pp-ping 0.9s ease-out; }
@keyframes pp-ping {
  0%   { opacity: 0.9; transform: scale(0.4); }
  100% { opacity: 0;   transform: scale(2.6); }
}

/* Smaller photos (phones, narrow columns): smaller cards. */
.photo-pops.is-compact .pp-card { padding: 10px 14px 10px 10px; gap: 10px; border-radius: 16px; max-width: 240px; }
.photo-pops.is-compact .pp-ico  { width: 32px; height: 32px; }
.photo-pops.is-compact .pp-ico svg { width: 18px; height: 18px; }
.photo-pops.is-compact .pp-label  { font-size: 12px; line-height: 16px; }
.photo-pops.is-compact .pp-amount { font-size: 17px; line-height: 22px; }

@media (prefers-reduced-motion: reduce) {
  .pp-card, .pp-ping { transition: none !important; animation: none !important; }
}
