/* ────────────────────────────────────────────────────────────────────────
   atom-presentation.css — touchscreen-TV polish layer.

   Visual additions that turn the flow chart into a great live-presentation
   surface without changing how the underlying interactions work:

     - Tap-ring feedback: expanding ring at every click/touch so the back
       row sees the gesture.
     - Cinema spotlight: soft pulsing halo around the cinema-mode iframe
       whenever a scenario is driving it, so the audience eye follows the
       narration into the live app.
     - Edge data-flow particles: continuous faint dots streaming along
       every edge on the active scenario path (chart looks alive).
   ──────────────────────────────────────────────────────────────────────── */

/* Tap-ring feedback. Lightweight: one absolutely-positioned ring per tap,
   scales up + fades out, then auto-removes. */
.tap-ring {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px; /* center on the tap point */
  border-radius: 50%;
  border: 2px solid rgba(34, 197, 219, 0.85);
  background: rgba(34, 197, 219, 0.08);
  box-shadow: 0 0 18px rgba(34, 197, 219, 0.45);
  opacity: 1;
  transform: scale(0.4);
  animation: tapRingExpand 720ms cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.tap-ring.color-pink {
  border-color: rgba(255, 53, 211, 0.85);
  background: rgba(255, 53, 211, 0.08);
  box-shadow: 0 0 18px rgba(255, 53, 211, 0.45);
}
@keyframes tapRingExpand {
  0%   { transform: scale(0.4); opacity: 0.95; }
  60%  { transform: scale(1.6); opacity: 0.6;  }
  100% { transform: scale(2.4); opacity: 0;    }
}

/* Cinema spotlight: pulsing halo around the cinema-mode iframe while a
   scenario is narrating. Pulls the audience eye into the live app. */
body.scenario-playing.cinema-mode .cinema-pane {
  box-shadow:
    0 0 0 1px rgba(34, 197, 219, 0.55),
    0 0 36px rgba(34, 197, 219, 0.35),
    0 0 90px rgba(34, 197, 219, 0.18),
    0 0 160px rgba(255, 53, 211, 0.10);
  animation: cinemaSpotlight 2.6s ease-in-out infinite;
}
@keyframes cinemaSpotlight {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(34, 197, 219, 0.45),
      0 0 36px rgba(34, 197, 219, 0.28),
      0 0 90px rgba(34, 197, 219, 0.12),
      0 0 160px rgba(255, 53, 211, 0.06);
  }
  50% {
    box-shadow:
      0 0 0 2px rgba(34, 197, 219, 0.75),
      0 0 50px rgba(34, 197, 219, 0.55),
      0 0 120px rgba(34, 197, 219, 0.30),
      0 0 200px rgba(255, 53, 211, 0.18);
  }
}

/* Edge data-flow particles: SVG circles riding along active edges while
   a scenario plays. Each particle is animated via inline transform.
   The particles fade in/out smoothly so the chart breathes. */
.edge-particle {
  fill: currentColor;
  pointer-events: none;
  filter: drop-shadow(0 0 4px currentColor) drop-shadow(0 0 8px currentColor);
  opacity: 0;
  transition: opacity 0.4s;
}
.edge-particle.on { opacity: 0.85; }

/* Stats overlay: small ticker on first-load that says "21 modules /
   31 connections / 17 scenarios" as a confidence anchor for the
   audience. Auto-fades after a few seconds. */
#statsOverlay {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  display: flex;
  gap: 22px;
  padding: 10px 22px;
  background: rgba(7, 11, 31, 0.85);
  border: 1px solid rgba(34, 197, 219, 0.35);
  border-radius: 999px;
  box-shadow: 0 0 28px rgba(34, 197, 219, 0.18);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
#statsOverlay.on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
#statsOverlay .stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
}
#statsOverlay .stat-num {
  color: var(--cyan, #22C5DB);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
}
#statsOverlay .stat-label {
  color: var(--text-dim, #8A95B2);
  font-size: 9.5px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
}
@media (max-width: 720px) {
  #statsOverlay { gap: 12px; padding: 8px 14px; top: 70px; }
  #statsOverlay .stat-num { font-size: 14px; }
  #statsOverlay .stat-label { font-size: 8px; letter-spacing: 1.6px; }
}

/* Wake-up sweep: brief left-to-right pulse across every node when the
   chart first becomes interactive (after the TED overlay dismisses).
   Tells the audience the chart is ALIVE without trying to be a movie. */
#canvas .node.wake-pulse .node-body {
  animation: wakePulseBody 900ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
@keyframes wakePulseBody {
  0%   { filter: drop-shadow(0 0 0 rgba(34, 197, 219, 0)); }
  35%  { filter: drop-shadow(0 0 16px rgba(34, 197, 219, 0.85))
                 drop-shadow(0 0 36px rgba(255, 53, 211, 0.30)); }
  100% { filter: drop-shadow(0 0 0 rgba(34, 197, 219, 0)); }
}
#canvas .node.wake-pulse .node-glow-ring {
  opacity: 1 !important;
  transform-origin: center;
  animation: wakePulseRing 900ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
@keyframes wakePulseRing {
  0%   { transform: scale(0.55); opacity: 0; }
  40%  { transform: scale(1.18); opacity: 1; }
  100% { transform: scale(1);    opacity: 0.92; }
}
