/* ── ivx-demos.css — append to the bottom of styles.css ─────────────────────
   Keyword demo panel that replaces the old help-menu dropdown.
   The panel sits inside #ep, overlaying the editor + terminal.           */

/* ── Panel shell ─────────────────────────────────────────────────────────── */
#ivx-demo-panel {
  position: absolute;
  inset: 32px 0 0 0;          /* sits below the ep panel-hdr */
  z-index: 200;
  display: none;              /* toggled by JS */
  flex-direction: row;
  background: #0a0a0f;
  border-top: 1px solid #1e1e2e;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
#ivx-demo-sidebar {
  width: 148px;
  flex-shrink: 0;
  border-right: 1px solid #1a1a2e;
  padding: 10px 0;
  overflow-y: auto;
  background: #0a0a0f;
}

#ivx-demo-sidebar::-webkit-scrollbar { width: 4px; }
#ivx-demo-sidebar::-webkit-scrollbar-track { background: transparent; }
#ivx-demo-sidebar::-webkit-scrollbar-thumb { background: #1e1e2e; border-radius: 2px; }

.ivx-demo-section {
  margin-bottom: 10px;
}

.ivx-demo-section-label {
  font-size: 9px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  color: #374151;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0 12px 4px;
  user-select: none;
}

.ivx-demo-kw-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-left: 2px solid transparent;
  padding: 5px 12px;
  cursor: pointer;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 11.5px;
  color: #4b5563;
  letter-spacing: 0.02em;
  transition: color 0.08s, background 0.08s, border-color 0.08s;
}

.ivx-demo-kw-btn:hover {
  color: #9ca3af;
  background: rgba(255,255,255,0.03);
}

.ivx-demo-kw-btn--active {
  font-weight: 700;
  /* color, border-left-color, background set inline by JS to use demo.color */
}

/* ── Main area ───────────────────────────────────────────────────────────── */
#ivx-demo-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

/* ── Demo header row ─────────────────────────────────────────────────────── */
#ivx-demo-hdr {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid #1a1a2e;
  flex-shrink: 0;
  background: #0a0a0f;
}

#ivx-demo-title {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  /* color set inline by JS */
}

#ivx-demo-sep {
  width: 1px;
  height: 13px;
  background: #1e1e2e;
  flex-shrink: 0;
}

#ivx-demo-tagline {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 10px;
  color: #4b5563;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#ivx-demo-replay,
#ivx-demo-insert {
  background: none;
  border: 1px solid #1e1e2e;
  border-radius: 3px;
  color: #4b5563;
  cursor: pointer;
  padding: 2px 8px;
  font-size: 10px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  letter-spacing: 0.04em;
  transition: border-color 0.1s, color 0.1s;
  white-space: nowrap;
}

#ivx-demo-replay:hover { border-color: #4b5563; color: #9ca3af; }

#ivx-demo-insert {
  margin-left: auto;
  border-color: #2a2a3e;
  color: #6b7280;
}

#ivx-demo-insert:hover {
  border-color: #89b4fa;
  color: #89b4fa;
}

/* ── SVG viewport ────────────────────────────────────────────────────────── */
#ivx-demo-viewport {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 24px;
  overflow: hidden;
  background: #0a0a0f;
}

#ivx-demo-viewport > svg {
  width: 100%;
  height: 100%;
  max-width: 640px;
  border-radius: 8px;
  box-shadow: 0 0 0 1px #1a1a2e, 0 10px 36px rgba(0,0,0,0.5);
}

/* ── Keywords button active state ────────────────────────────────────────── */
#help-menu-btn.on {
  border-color: #89b4fa;
  color: #89b4fa;
  background: rgba(137,180,250,0.08);
}

/* ── Mobile: hide the panel on very small screens ────────────────────────── */
@media (max-width: 700px) {
  #ivx-demo-panel {
    inset: 38px 0 0 0;  /* below mobile header */
  }
  #ivx-demo-sidebar {
    width: 110px;
  }
  .ivx-demo-kw-btn {
    font-size: 10px;
    padding: 4px 8px;
  }
  #ivx-demo-tagline {
    display: none;
  }
}
/* ── ivx-examples.css — Example Programs Panel ───────────────────────────────
   Same overlay approach as the keyword demo panel.                         */

/* ── Panel shell ─────────────────────────────────────────────────────────── */
#ivx-ex-panel {
  position: absolute;
  inset: 32px 0 0 0;
  z-index: 200;
  display: none;
  flex-direction: row;
  background: #0a0a0f;
  border-top: 1px solid #1e1e2e;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
#ivx-ex-sidebar {
  width: 200px;
  flex-shrink: 0;
  border-right: 1px solid #1a1a2e;
  padding: 10px 0;
  overflow-y: auto;
  background: #0a0a0f;
}

#ivx-ex-sidebar::-webkit-scrollbar { width: 4px; }
#ivx-ex-sidebar::-webkit-scrollbar-track { background: transparent; }
#ivx-ex-sidebar::-webkit-scrollbar-thumb { background: #1e1e2e; border-radius: 2px; }

.ivx-ex-section {
  margin-bottom: 10px;
}

.ivx-ex-section-label {
  font-size: 9px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  color: #374151;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0 12px 4px;
  user-select: none;
}

.ivx-ex-prog-btn {
  display: flex;
  align-items: baseline;
  gap: 6px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-left: 2px solid transparent;
  padding: 4px 12px;
  cursor: pointer;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 10.5px;
  color: #4b5563;
  letter-spacing: 0.01em;
  transition: color 0.08s, background 0.08s;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ivx-ex-prog-btn:hover {
  color: #9ca3af;
  background: rgba(255,255,255,0.03);
}

.ivx-ex-prog-btn--active {
  color: #cdd6f4 !important;
  background: rgba(255,255,255,0.05) !important;
  border-left-color: #89b4fa !important;
}

.ivx-ex-verdict-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
  margin-top: 2px;
}

/* ── Main area ───────────────────────────────────────────────────────────── */
#ivx-ex-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
#ivx-ex-hdr {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid #1a1a2e;
  flex-shrink: 0;
  background: #0a0a0f;
  min-height: 40px;
}

#ivx-ex-title {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 12px;
  font-weight: 700;
  color: #cdd6f4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
  flex-shrink: 0;
}

#ivx-ex-verdict {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid;
  border-radius: 3px;
  padding: 1px 6px;
  flex-shrink: 0;
}

#ivx-ex-sep {
  width: 1px;
  height: 13px;
  background: #1e1e2e;
  flex-shrink: 0;
}

#ivx-ex-analysis {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 10px;
  color: #4b5563;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

#ivx-ex-load {
  background: none;
  border: 1px solid #2a2a3e;
  border-radius: 3px;
  color: #6b7280;
  cursor: pointer;
  padding: 2px 10px;
  font-size: 10px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  letter-spacing: 0.04em;
  transition: border-color 0.1s, color 0.1s;
  white-space: nowrap;
  margin-left: auto;
  flex-shrink: 0;
}

#ivx-ex-load:hover {
  border-color: #4ade80;
  color: #4ade80;
}

/* ── Code viewport ───────────────────────────────────────────────────────── */
#ivx-ex-viewport {
  flex: 1;
  overflow: auto;
  padding: 20px 24px;
  background: #0a0a0f;
}

#ivx-ex-viewport::-webkit-scrollbar { width: 6px; }
#ivx-ex-viewport::-webkit-scrollbar-track { background: transparent; }
#ivx-ex-viewport::-webkit-scrollbar-thumb { background: #1e1e2e; border-radius: 3px; }

#ivx-ex-code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 13px;
  line-height: 1.75;
  color: #cdd6f4;
  background: #12121a;
  border: 1px solid #1e1e2e;
  border-radius: 6px;
  padding: 16px 20px;
  white-space: pre;
  overflow-x: auto;
  box-shadow: 0 0 0 1px #1a1a2e inset;
  max-width: 680px;
}

/* ── Caveats bar ─────────────────────────────────────────────────────────── */
#ivx-ex-caveats {
  display: none;
  padding: 8px 24px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 10px;
  color: #f0a030;
  background: rgba(240,160,48,0.06);
  border-top: 1px solid rgba(240,160,48,0.15);
  flex-shrink: 0;
}

/* ── Examples button active state ────────────────────────────────────────── */
#ex-panel-btn.on {
  border-color: #4ade80;
  color: #4ade80;
  background: rgba(74,222,128,0.08);
}

@media (max-width: 700px) {
  #ivx-ex-panel { inset: 38px 0 0 0; }
  #ivx-ex-sidebar { width: 130px; }
  .ivx-ex-prog-btn { font-size: 9px; padding: 3px 8px; }
  #ivx-ex-analysis { display: none; }
  #ivx-ex-title { max-width: 180px; }
}

/* ── Node shape preview strip ─────────────────────────────────────────────── */
#ivx-demo-node-strip {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  border-bottom: 1px solid #1a1a2e;
  background: #080810;
  flex-shrink: 0;
}

#ivx-demo-node-label {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 9px;
  color: #374151;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

#ivx-demo-node {
  display: flex;
  align-items: center;
}
