/* Call Flow Studio — interactive demo (self-contained, no backend).
   Reproduces the real CfsNode look: each node is a fully COLORED card
   (type fill) with a recessed translucent panel for its detail rows. */

.demo-wrap { max-width: 1500px; margin: 0 auto; padding: 0 20px; }

.demo-hd { text-align: center; margin: 28px 0 18px; }
.demo-hd h1 { font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: clamp(28px, 4vw, 42px); margin: 0 0 10px; }
.demo-hd p { color: var(--ink-mute, #6b7785); max-width: 700px; margin: 0 auto; line-height: 1.55; }

/* Browser-chrome frame */
.demo-frame { border: 1px solid rgba(255,255,255,0.10); border-radius: 12px; overflow: hidden; box-shadow: 0 24px 60px rgba(2,8,20,0.45); background: #0b1220; }
.demo-chrome { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: #131c2e; border-bottom: 1px solid rgba(255,255,255,0.07); }
.demo-dot { width: 12px; height: 12px; border-radius: 50%; }
.demo-dot.r { background: #ff5f57; } .demo-dot.y { background: #febc2e; } .demo-dot.g { background: #28c840; }
@keyframes demoAddrPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(91,163,245,0); } 50% { box-shadow: 0 0 0 3px rgba(91,163,245,0.4); } }
.demo-chrome-url { flex: 1; max-width: 560px; margin: 0 auto; text-align: center; text-align-last: center; font-family: 'JetBrains Mono', monospace; font-size: 13px; color: #b8cae3; background: #0b1220 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'><path d='M1 1l5 5 5-5' fill='none' stroke='%235ba3f5' stroke-width='2'/></svg>") no-repeat right 11px center; border: 1px solid rgba(91,163,245,0.5); border-radius: 6px; padding: 5px 30px 5px 14px; cursor: pointer; appearance: none; -webkit-appearance: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: border-color .15s, color .15s; }
.demo-chrome-url.pulse { animation: demoAddrPulse 1.6s ease-in-out 0.6s 3; }
.demo-chrome-url:hover { border-color: rgba(91,163,245,0.9); color: #e6eefb; }
@media (prefers-reduced-motion: reduce) { .demo-chrome-url.pulse { animation: none; } }

/* Toolbar */
.demo-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 11px 14px; background: #0e1626; border-bottom: 1px solid rgba(255,255,255,0.07); }
.demo-bar .grp { display: flex; align-items: center; gap: 8px; }
.demo-bar label { font-size: 12px; color: #7f93ac; text-transform: uppercase; letter-spacing: .04em; }
.demo-seg { display: inline-flex; background: #0a1120; border: 1px solid rgba(255,255,255,0.10); border-radius: 8px; padding: 2px; }
.demo-seg button { appearance: none; border: 0; background: transparent; color: #9fb2cc; font: inherit; font-size: 12.5px; padding: 6px 11px; border-radius: 6px; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.demo-seg button:hover { color: #e6eefb; }
.demo-seg button.on { background: #2563eb; color: #fff; }
.demo-bar .spacer { flex: 1; }
.demo-hint { font-size: 12px; color: #6b7e98; }

/* Canvas */
.demo-canvas { position: relative; height: 800px; overflow: hidden; background-color: #1a1f2e; background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px); background-size: 20px 20px; cursor: grab; touch-action: none; }
.demo-canvas.grabbing { cursor: grabbing; }
.demo-inner { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.demo-edges { position: absolute; top: 0; left: 0; overflow: visible; pointer-events: none; }
.demo-edge { fill: none; stroke: #a0c4e8; stroke-width: 2; transition: stroke .25s, opacity .25s; }
.demo-edge.active { stroke: #3d8ef0; stroke-width: 2.6; filter: drop-shadow(0 0 4px rgba(61,142,240,0.7)); }
.demo-edge.dim { opacity: 0.1; }
.demo-edge.hover { stroke: #ec4899; stroke-width: 2.9; opacity: 1; filter: drop-shadow(0 0 6px rgba(236,72,153,0.7)); }
.demo-edge-hit { fill: none; stroke: transparent; stroke-width: 14px; pointer-events: stroke; cursor: pointer; }

/* Nodes — fully colored card (bg + text set inline per type), recessed body panel */
.demo-node { position: absolute; width: 214px; border-radius: 9px; border: 1px solid rgba(255,255,255,0.10); box-shadow: 0 6px 16px rgba(0,0,0,0.4); font-family: 'IBM Plex Sans', system-ui, sans-serif; overflow: hidden; cursor: grab; transition: opacity .25s, filter .25s, box-shadow .12s; }
.demo-node.dragging { cursor: grabbing; }
.demo-node.dim { opacity: 0.15; filter: grayscale(0.65); }
.demo-node.hot { box-shadow: 0 0 0 2px #fff, 0 10px 26px rgba(0,0,0,0.55); z-index: 5; }
.demo-node-hd { display: flex; align-items: center; gap: 6px; padding: 7px 10px 2px; font-weight: 700; font-size: 10px; line-height: 1.2; text-transform: uppercase; letter-spacing: .07em; opacity: .82; }
.demo-node-hd svg { width: 12px; height: 12px; flex-shrink: 0; }
.demo-node-name { padding: 0 10px 7px; font-weight: 700; font-size: 13px; line-height: 1.25; }
.demo-node-hd .ttl { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-node-hd .badge { font-size: 8.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 2px 5px; border-radius: 4px; background: rgba(0,0,0,0.2); }
.demo-node-bd { margin: 0 7px 8px; background: rgba(0,0,0,0.2); border-radius: 6px; padding: 7px 9px; display: flex; flex-direction: column; gap: 4px; }
.demo-row { font-size: 11.5px; color: inherit; display: flex; align-items: center; gap: 6px; line-height: 1.3; }
.demo-row .num { font-family: 'JetBrains Mono', monospace; font-weight: 700; color: inherit; }
.demo-row .mono { font-family: 'JetBrains Mono', monospace; opacity: .8; }
.demo-dotm { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(0,0,0,0.25); }
.demo-sel { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: inherit; }
.demo-sel .key { font-family: 'JetBrains Mono', monospace; font-weight: 800; min-width: 14px; text-align: center; opacity: .95; }
.demo-meta { font-size: 10.5px; opacity: .72; color: inherit; }

/* Failover chip (queues) — mirrors the app's failover affordance */
.demo-fail { margin: 5px 7px 8px; display: inline-flex; align-self: flex-start; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 600; padding: 3px 8px; border-radius: 5px; background: rgba(0,0,0,0.22); color: inherit; }

/* Ports */
.demo-port { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: #fff; transform: translate(-50%, -50%); pointer-events: none; box-shadow: 0 0 0 1px rgba(0,0,0,0.3); transition: opacity .25s; }
.demo-port.dim { opacity: 0.12; }

/* Minimap */
.demo-minimap { position: absolute; right: 12px; bottom: 12px; width: 188px; height: 124px; background: rgba(10,16,28,0.85); border: 1px solid rgba(255,255,255,0.12); border-radius: 7px; overflow: hidden; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,0.4); }
.demo-minimap svg { display: block; width: 100%; height: 100%; }
.demo-mm-node { opacity: 0.9; }
.demo-mm-view { fill: rgba(120,170,255,0.15); stroke: #7aa6ff; stroke-width: 1.5; }

@media (max-width: 720px) {
  .demo-canvas { height: 560px; }
  .demo-bar { gap: 8px 10px; }
  .demo-hint { display: none; }
}
