/* ==========================================================================
   Live Donation Notifier — rotating donation / sponsorship pop-up card
   Accent: #f16628   Base: #1e5e62
   --------------------------------------------------------------------------
   Every selector is namespaced with `ldn-` so nothing can clash with a theme.
   Colours are CSS variables, so you can re-skin without touching this file:
   just change the two values in `.ldn-root` below.
   ========================================================================== */

.ldn-root{
  --ldn-accent:#f16628;
  --ldn-base:#1e5e62;
  --ldn-ink:#12292c;
  --ldn-muted:#6b7f81;
  --ldn-faint:#93a6a7;
  --ldn-line:rgba(30,94,98,.10);

  position:fixed;
  z-index:2147480000;
  width:344px;
  max-width:calc(100vw - 28px);
  pointer-events:none;
  font-family:'Poppins','Segoe UI',system-ui,-apple-system,sans-serif;
  font-size:16px;
  line-height:1.5;
  text-align:left;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

.ldn-root *,
.ldn-root *::before,
.ldn-root *::after{ box-sizing:border-box; }

/* ---------------------------------------------------------------- position */
.ldn-br{ right:22px; bottom:22px; }
.ldn-bl{ left:22px;  bottom:22px; }
.ldn-tr{ right:22px; top:22px; }
.ldn-tl{ left:22px;  top:22px; }

/* -------------------------------------------------------------------- card */
.ldn-card{
  position:relative;
  display:flex;
  align-items:center;
  gap:13px;
  padding:15px 38px 16px 16px;
  background:#fff;
  border:1px solid var(--ldn-line);
  border-radius:16px;
  box-shadow:0 18px 42px -18px rgba(30,94,98,.38), 0 4px 12px rgba(30,94,98,.08);
  opacity:0;
  transform:translate3d(26px,0,0);
  transition:opacity .42s cubic-bezier(.22,.61,.36,1), transform .52s cubic-bezier(.22,.61,.36,1);
  pointer-events:auto;
  overflow:hidden;
  will-change:opacity, transform;
}
.ldn-tr .ldn-card,
.ldn-tl .ldn-card{ transform:translate3d(0,-26px,0); }
.ldn-bl .ldn-card{ transform:translate3d(-26px,0,0); }

.ldn-root.ldn-open .ldn-card{
  opacity:1;
  transform:translate3d(0,0,0);
}

/* thin brand stripe on the left edge */
.ldn-card::before{
  content:"";
  position:absolute;
  left:0; top:0; bottom:0;
  width:4px;
  background:linear-gradient(180deg, var(--ldn-accent), var(--ldn-base));
}

/* ------------------------------------------------------------------ avatar */
.ldn-avatar{
  flex:0 0 46px;
  width:46px; height:46px;
  display:flex; align-items:center; justify-content:center;
  border-radius:50%;
  overflow:hidden;
  color:#fff;
  font-size:14.5px;
  font-weight:700;
  letter-spacing:.02em;
  background:linear-gradient(135deg, var(--ldn-accent), var(--ldn-base));
  box-shadow:0 6px 14px -6px rgba(30,94,98,.6), 0 0 0 2px rgba(255,255,255,.9), 0 0 0 3px rgba(241,102,40,.35);
  user-select:none;
}
/* Pet / donor photo. Falls back to initials when no photo is set. */
.ldn-avatar .ldn-photo{
  display:none;
  width:100%; height:100%;
  object-fit:cover;
  object-position:center 42%;   /* keeps faces centred in the circle */
  border-radius:50%;
}
.ldn-avatar.ldn-has-photo .ldn-photo{ display:block; }
.ldn-avatar.ldn-has-photo{ background:#eef4f3; }
.ldn-avatar.ldn-has-photo .ldn-initials{ display:none; }
.ldn-avatar .ldn-initials{
  font-size:14.5px;
  font-weight:700;
  letter-spacing:.02em;
  color:#fff;
}

/* -------------------------------------------------------------------- body */
.ldn-body{
  flex:1 1 auto;
  min-width:0;
  display:flex;
  flex-direction:column;
}

.ldn-name{
  font-size:14.5px;
  font-weight:700;
  color:var(--ldn-base);
  line-height:1.3;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.ldn-loc{
  font-weight:500;
  font-size:12px;
  color:var(--ldn-faint);
}

.ldn-msg{
  font-size:13px;
  color:var(--ldn-muted);
  line-height:1.45;
  margin-top:1px;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.ldn-meta{
  display:flex;
  align-items:center;
  gap:6px;
  margin-top:5px;
}
.ldn-amount{
  font-size:15px;
  font-weight:800;
  letter-spacing:-.01em;
  color:var(--ldn-accent);
}
.ldn-sep{ color:#cfdbdc; font-size:10px; }

.ldn-time{
  font-size:11.5px;
  color:var(--ldn-faint);
  white-space:nowrap;
}
.ldn-live{
  position:relative;
  flex:0 0 auto;
  width:6px; height:6px;
  border-radius:50%;
  background:var(--ldn-accent);
}
.ldn-live::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:50%;
  background:var(--ldn-accent);
  animation:ldn-pulse 1.9s cubic-bezier(.22,.61,.36,1) infinite;
}
@keyframes ldn-pulse{
  0%   { transform:scale(1);   opacity:.7; }
  70%  { transform:scale(3.6); opacity:0;  }
  100% { transform:scale(3.6); opacity:0;  }
}

/* ------------------------------------------------------------------- close */
.ldn-close{
  position:absolute;
  top:7px; right:7px;
  width:24px; height:24px;
  display:flex; align-items:center; justify-content:center;
  padding:0;
  border:0;
  border-radius:8px;
  background:transparent;
  color:#9badad;
  font-family:inherit;
  font-size:17px;
  line-height:1;
  cursor:pointer;
  transition:background .2s ease, color .2s ease;
}
.ldn-close:hover{ background:rgba(30,94,98,.08); color:var(--ldn-base); }

/* ----------------------------------------------------------- timer / bar  */
.ldn-progress{
  position:absolute;
  left:0; bottom:0;
  height:3px;
  width:100%;
  background:linear-gradient(90deg, var(--ldn-accent), var(--ldn-base));
  opacity:.95;
}

/* ------------------------------------------------------------------ mobile */
@media (max-width:600px){
  .ldn-root:not(.ldn-mobile){ display:none !important; }
  .ldn-root.ldn-mobile{
    width:auto;
    left:12px !important; right:12px !important;
    bottom:12px !important; top:auto !important;
  }
  .ldn-card{ padding:13px 34px 14px 13px; }
  .ldn-avatar{ flex-basis:40px; width:40px; height:40px; font-size:14px; }
  .ldn-name{ font-size:14px; }
  .ldn-msg{ font-size:12.5px; }
}

/* ------------------------------------------------------------------- print */
@media print{
  .ldn-root{ display:none !important; }
}

/* --------------------------------------------------------- reduced motion  */
@media (prefers-reduced-motion:reduce){
  .ldn-card{ transition:opacity .01ms linear; transform:none; }
  .ldn-live{ animation:none; }
  .ldn-progress{ display:none; }
}
