/* ============================================================
   SXMeets Mobile — Cross-OS handoff card (WS-E)
   ------------------------------------------------------------
   Renders the orange "Daniel is bringing Élise · ETA 6:55"
   card on the recipient OS's home screen. Card colors are
   driven by the SENDER's OS so the user instantly sees where
   the handoff came from.

   Required:
     _shared/tokens.css (--text, --muted) — falls back to literal colors
   ============================================================ */

/* ── Stack container ─────────────────────────────────────────
   Host page mounts: <div id="sxHandoffStack" data-handoff-stack></div>
   Multiple cards stack vertically inside.
   ───────────────────────────────────────────────────────────── */
.sx-ho-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Base card (sender_os colors override via CSS vars) ──── */
.sx-ho {
  --ho-accent:    #FF8C42;
  --ho-accent-bg: rgba(255, 140, 66, .08);
  --ho-accent-bd: rgba(255, 140, 66, .25);
  --ho-accent-mute: rgba(255, 140, 66, .85);

  position: relative;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--ho-accent-bg);
  border: 1px solid var(--ho-accent-bd);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text, rgba(255, 255, 255, .9));
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  cursor: pointer;
  animation: sx-ho-in .35s cubic-bezier(.2, .9, .3, 1);
  transition: transform .12s, box-shadow .15s;
}
.sx-ho:active { transform: scale(.985); }
.sx-ho:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, .15);
}

@keyframes sx-ho-in {
  from { opacity: 0; transform: translateY(-6px) scale(.96); }
  to   { opacity: 1; transform: none; }
}

/* Sender icon — small circular badge */
.sx-ho-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--ho-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}

/* Title block */
.sx-ho-body {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}
.sx-ho-title {
  display: block;
  font-weight: 700;
  color: var(--ho-accent);
  letter-spacing: -.1px;
}
.sx-ho-sub {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted, rgba(255, 255, 255, .65));
  margin-top: 1px;
}

/* Trailing meta (e.g. "via Transitos · 6:55") */
.sx-ho-meta {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  font-weight: 700;
  color: var(--ho-accent-mute);
  letter-spacing: .3px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Dismiss button (×) */
.sx-ho-x {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--muted, rgba(255, 255, 255, .45));
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: background .15s;
}
.sx-ho-x:hover { background: rgba(255, 255, 255, .06); }
.sx-ho-x:active { transform: scale(.9); }
body.bright .sx-ho-x:hover { background: rgba(10, 26, 46, .05); }

/* Live pulse — small dot near top-right of the card to indicate
   "this is live, not a stale read" */
.sx-ho::before {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ho-accent);
  box-shadow: 0 0 0 0 var(--ho-accent);
  animation: sx-ho-pulse 1.8s ease-out infinite;
}
@keyframes sx-ho-pulse {
  0%   { box-shadow: 0 0 0 0 var(--ho-accent); }
  70%  { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .sx-ho::before { animation: none; }
}

/* Dismiss animation */
.sx-ho.dismissing {
  animation: sx-ho-out .25s ease-out forwards;
}
@keyframes sx-ho-out {
  to { opacity: 0; transform: translateY(-6px) scale(.96); height: 0; padding-top: 0; padding-bottom: 0; margin-top: 0; }
}

/* ============================================================
   Per-sender-OS color overrides
   Host sets sender_os in HTML via data-sender-os attribute
   ============================================================ */

.sx-ho[data-sender-os="transitos"],
.sx-ho[data-sender-os="transit"],
.sx-ho[data-sender-os="taxi"] {
  --ho-accent:    #D4A574;
  --ho-accent-bg: rgba(212, 165, 116, .10);
  --ho-accent-bd: rgba(212, 165, 116, .28);
  --ho-accent-mute: rgba(212, 165, 116, .85);
}

.sx-ho[data-sender-os="wellness"],
.sx-ho[data-sender-os="wellness-spa"] {
  --ho-accent:    #7BC8A4;
  --ho-accent-bg: rgba(123, 200, 164, .10);
  --ho-accent-bd: rgba(123, 200, 164, .28);
  --ho-accent-mute: rgba(123, 200, 164, .85);
}

.sx-ho[data-sender-os="services"] {
  --ho-accent:    #FF8C42;
  --ho-accent-bg: rgba(255, 140, 66, .10);
  --ho-accent-bd: rgba(255, 140, 66, .28);
  --ho-accent-mute: rgba(255, 140, 66, .85);
}

.sx-ho[data-sender-os="restos"] {
  --ho-accent:    #F5C842;
  --ho-accent-bg: rgba(245, 200, 66, .10);
  --ho-accent-bd: rgba(245, 200, 66, .28);
  --ho-accent-mute: rgba(245, 200, 66, .85);
}

.sx-ho[data-sender-os="fleet"],
.sx-ho[data-sender-os="bus"] {
  --ho-accent:    #0099D4;
  --ho-accent-bg: rgba(0, 153, 212, .10);
  --ho-accent-bd: rgba(0, 153, 212, .28);
  --ho-accent-mute: rgba(0, 153, 212, .85);
}

.sx-ho[data-sender-os="sports"] {
  --ho-accent:    #FF4D3D;
  --ho-accent-bg: rgba(255, 77, 61, .10);
  --ho-accent-bd: rgba(255, 77, 61, .28);
  --ho-accent-mute: rgba(255, 77, 61, .85);
}

.sx-ho[data-sender-os="hospitality"],
.sx-ho[data-sender-os="property"],
.sx-ho[data-sender-os="resort"] {
  --ho-accent:    #D4AF37;
  --ho-accent-bg: rgba(212, 175, 55, .10);
  --ho-accent-bd: rgba(212, 175, 55, .28);
  --ho-accent-mute: rgba(212, 175, 55, .85);
}

.sx-ho[data-sender-os="culture"] {
  --ho-accent:    #9B5DE5;
  --ho-accent-bg: rgba(155, 93, 229, .10);
  --ho-accent-bd: rgba(155, 93, 229, .28);
  --ho-accent-mute: rgba(155, 93, 229, .85);
}

.sx-ho[data-sender-os="education"] {
  --ho-accent:    #F59E0B;
  --ho-accent-bg: rgba(245, 158, 11, .10);
  --ho-accent-bd: rgba(245, 158, 11, .28);
  --ho-accent-mute: rgba(245, 158, 11, .85);
}

.sx-ho[data-sender-os="beauty"] {
  --ho-accent:    #EC4899;
  --ho-accent-bg: rgba(236, 72, 153, .10);
  --ho-accent-bd: rgba(236, 72, 153, .28);
  --ho-accent-mute: rgba(236, 72, 153, .85);
}

.sx-ho[data-sender-os="sales"] {
  --ho-accent:    #6366F1;
  --ho-accent-bg: rgba(99, 102, 241, .10);
  --ho-accent-bd: rgba(99, 102, 241, .28);
  --ho-accent-mute: rgba(99, 102, 241, .85);
}

.sx-ho[data-sender-os="terra"] {
  --ho-accent:    #16A34A;
  --ho-accent-bg: rgba(22, 163, 74, .10);
  --ho-accent-bd: rgba(22, 163, 74, .28);
  --ho-accent-mute: rgba(22, 163, 74, .85);
}

.sx-ho[data-sender-os="venue"] {
  --ho-accent:    #8B5CF6;
  --ho-accent-bg: rgba(139, 92, 246, .10);
  --ho-accent-bd: rgba(139, 92, 246, .28);
  --ho-accent-mute: rgba(139, 92, 246, .85);
}

.sx-ho[data-sender-os="pros"] {
  --ho-accent:    #0EA5E9;
  --ho-accent-bg: rgba(14, 165, 233, .10);
  --ho-accent-bd: rgba(14, 165, 233, .28);
  --ho-accent-mute: rgba(14, 165, 233, .85);
}

/* ============================================================
   Connection pill — shown when subscriber is offline / polling
   ============================================================ */

.sx-ho-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
}
.sx-ho-status.live {
  background: rgba(74, 222, 128, .14);
  color: #4ADE80;
}
.sx-ho-status.live::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ADE80;
  box-shadow: 0 0 0 0 #4ADE80;
  animation: sx-ho-pulse 1.6s ease-out infinite;
}
.sx-ho-status.poll {
  background: rgba(255, 176, 32, .14);
  color: #FFB020;
}
.sx-ho-status.poll::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #FFB020;
}

/* ============================================================
   Bright mode
   ============================================================ */
body.bright .sx-ho {
  color: var(--text, #0A1A2E);
}
body.bright .sx-ho-sub {
  color: var(--muted, rgba(10, 26, 46, .65));
}
body.bright .sx-ho-x {
  color: rgba(10, 26, 46, .45);
}
