/* ═══════════════════════════════════════════════════════════════════════
 * Explainer Base Styles — Shared by all 4 healthcare explainers
 *   1. llm-foundations-explainer.html
 *   2. embeddings-explainer.html
 *   3. transformer-explainer.html
 *   4. rag-explainer.html
 *
 * Built on the workshop's style.css design tokens (Synapxe purple).
 * Adds AI Glass animated cards, tab navigation, narrator boxes, healthcare
 * example boxes, callouts, capability tables, and use-case grids — all per
 * the interactive-explainer skill.
 * ═══════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ─── Hero ─── */
.exp-hero {
  background: linear-gradient(135deg, #0B0514 0%, #1A0A2E 100%);
  color: #fff;
  padding: 3rem 2rem 2.25rem;
  position: relative;
  overflow: hidden;
}
.exp-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 25% 50%, rgba(167,139,250,.15) 0%, transparent 55%),
              radial-gradient(ellipse at 75% 80%, rgba(217,70,239,.10) 0%, transparent 50%);
  pointer-events: none;
}
.exp-hero::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, #A78BFA, #D946EF, #A78BFA, transparent);
}
.exp-hero > * { position: relative; z-index: 1; }
.exp-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600;
  color: rgba(255,255,255,.7);
  text-decoration: none; margin-bottom: 12px;
  transition: color .2s;
}
.exp-back:hover { color: #fff; }
.mod-badge {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; font-weight: 700;
  letter-spacing: 1.5px;
  color: #A78BFA;
  background: rgba(167,139,250,.12);
  border: 1px solid rgba(167,139,250,.28);
  padding: 5px 12px; border-radius: 6px; margin-bottom: 10px;
}
.exp-hero h1 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 900; letter-spacing: -.5px;
  margin-bottom: 12px;
}
.exp-hero h1 .accent {
  background: linear-gradient(135deg, #C4B5FD, #F0ABFC, #ffffff);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% 200%;
  animation: heroGradientShift 6s ease-in-out infinite;
}
@keyframes heroGradientShift {
  0%,100% { background-position: 0% 50%; }
  50%     { background-position: 100% 50%; }
}
.exp-hero .subtitle {
  font-size: 17px;
  color: #C4B5FD;
  max-width: 720px;
  margin-bottom: 14px;
  line-height: 1.5;
}
.meta-row { display: flex; gap: 8px; flex-wrap: wrap; }
.meta-pill {
  font-size: 12px; font-weight: 600;
  color: #C4B5FD;
  background: rgba(167,139,250,.08);
  border: 1px solid rgba(167,139,250,.2);
  padding: 4px 11px; border-radius: 14px;
}

/* ─── Tab Navigation ─── */
.tab-nav {
  display: flex; gap: 0;
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(14px);
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
}
.tab-nav button {
  flex: 1; min-width: 130px;
  padding: 14px 14px;
  border: none; background: transparent;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px; font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .25s var(--ease);
  position: relative; white-space: nowrap;
}
.tab-nav button:hover { color: var(--brand); background: var(--brand-glow); }
.tab-nav button.active { color: var(--brand); }
.tab-nav button.active::after {
  content: ''; position: absolute;
  bottom: -2px; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-magenta));
  border-radius: 2px 2px 0 0;
}
.tab-nav button .tab-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--brand-glow);
  font-size: 10px; font-weight: 800;
  margin-right: 6px;
  color: var(--brand);
  transition: all .25s var(--ease);
}
.tab-nav button.active .tab-num { background: var(--brand); color: #fff; }

.tab-content {
  display: none;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 72px;
  animation: tabFadeIn .35s var(--ease);
}
.tab-content.active { display: block; }
@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── AI Glass Cards ─── */
.exp-card {
  background: var(--bg-white);
  border-radius: 18px;
  padding: 28px;
  border: 1.5px solid var(--border);
  box-shadow: 0 2px 12px rgba(0,0,0,.04);
  margin-bottom: 20px;
  position: relative; overflow: hidden;
  transition: all .35s var(--ease);
  animation: cardBorderGlow 6s ease-in-out infinite;
}
.exp-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(192,132,252,0) 20%, rgba(192,132,252,.4) 50%, rgba(244,114,182,.3) 60%, rgba(192,132,252,0) 80%, transparent 100%);
  background-size: 200% 100%;
  animation: cardShimmer 5s linear infinite;
}
.exp-card > * { position: relative; z-index: 1; }
.exp-card:hover {
  border-color: rgba(192,132,252,.4);
  box-shadow: 0 8px 28px rgba(91,33,182,.08), 0 0 24px rgba(91,33,182,.05);
}
.exp-card h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 22px; font-weight: 800;
  color: var(--text-heading);
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px;
  letter-spacing: -.2px;
}
.exp-card h2 .icon {
  font-size: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  background: var(--brand-glow);
  border-radius: 12px;
  flex-shrink: 0;
  animation: iconFloat 4s ease-in-out infinite;
}
.exp-card h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 18px; font-weight: 700;
  color: var(--text-heading);
  margin: 22px 0 8px;
}
.exp-card p { font-size: 15.5px; color: var(--text-body); margin-bottom: 12px; line-height: 1.7; }
.exp-card strong { color: var(--text-heading); font-weight: 700; }
.exp-card code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px; background: var(--brand-glow);
  color: var(--brand); padding: 2px 7px; border-radius: 4px;
}

@keyframes cardBorderGlow {
  0%,100% { border-color: rgba(91,33,182,.18); box-shadow: 0 0 18px rgba(91,33,182,.04), 0 2px 12px rgba(0,0,0,.04); }
  33%     { border-color: rgba(34,211,238,.16); box-shadow: 0 0 18px rgba(34,211,238,.04), 0 2px 12px rgba(0,0,0,.04); }
  66%     { border-color: rgba(244,114,182,.14); box-shadow: 0 0 18px rgba(244,114,182,.03), 0 2px 12px rgba(0,0,0,.04); }
}
@keyframes cardShimmer {
  0%   { background-position: 200% 50%; }
  100% { background-position: -200% 50%; }
}
@keyframes iconFloat {
  0%,100% { transform: translateY(0) scale(1); }
  50%     { transform: translateY(-3px) scale(1.05); }
}

/* ─── Concept Cards ─── */
.cc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px; margin: 18px 0;
}
.cc {
  background: var(--bg-white);
  border-radius: 14px;
  padding: 20px;
  border: 1.5px solid var(--border);
  position: relative; overflow: hidden;
  transition: all .3s var(--ease);
}
.cc::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(192,132,252,.3) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: cardShimmer 6s linear infinite;
}
.cc:hover {
  transform: translateY(-3px);
  border-color: rgba(192,132,252,.4);
  box-shadow: 0 8px 24px rgba(91,33,182,.08);
}
.cc-icon {
  font-size: 28px; margin-bottom: 10px;
  width: 48px; height: 48px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-glow);
  border-radius: 12px;
  animation: iconFloat 5s ease-in-out infinite;
}
.cc h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 15px; font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 6px;
  letter-spacing: -.1px;
}
.cc p { font-size: 14px; color: var(--text-muted); margin: 0; line-height: 1.55; }

.cc.purple { border-color: rgba(123,47,190,.18); }
.cc.purple .cc-icon { background: rgba(123,47,190,.08); color: #5B21B6; }
.cc.cyan { border-color: rgba(34,211,238,.16); }
.cc.cyan .cc-icon { background: rgba(34,211,238,.08); color: #0891B2; }
.cc.pink { border-color: rgba(244,114,182,.16); }
.cc.pink .cc-icon { background: rgba(244,114,182,.08); color: #DB2777; }
.cc.green { border-color: rgba(52,211,153,.16); }
.cc.green .cc-icon { background: rgba(52,211,153,.1); color: #059669; }
.cc.amber { border-color: rgba(251,191,36,.18); }
.cc.amber .cc-icon { background: rgba(251,191,36,.1); color: #D97706; }
.cc.indigo { border-color: rgba(99,102,241,.18); }
.cc.indigo .cc-icon { background: rgba(99,102,241,.08); color: #4F46E5; }

/* ─── SVG visualizations ─── */
.pipeline-svg, .viz-svg {
  width: 100%;
  background: linear-gradient(180deg, #FAFAFE 0%, #F5F3FF 100%);
  border-radius: 16px;
  padding: 24px 12px;
  border: 1.5px solid var(--border);
  margin: 20px 0;
}
.pipeline-svg svg, .viz-svg svg { width: 100%; height: auto; display: block; }

.dag-svg-node { cursor: pointer; transition: all .3s var(--ease); }
.dag-svg-node .node-bg {
  fill: rgba(255,255,255,.95);
  stroke: rgba(91,33,182,.25);
  stroke-width: 1.5;
  transition: all .3s var(--ease);
  filter: drop-shadow(0 2px 6px rgba(91,33,182,.06));
}
.dag-svg-node:hover .node-bg {
  stroke: rgba(91,33,182,.5);
  filter: drop-shadow(0 4px 14px rgba(91,33,182,.14));
}
.dag-svg-node.active .node-bg {
  stroke: var(--brand);
  stroke-width: 2.5;
  fill: #fff;
  filter: drop-shadow(0 0 18px rgba(91,33,182,.25));
}
.dag-svg-node .node-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px; font-weight: 700;
  fill: var(--text-heading);
  pointer-events: none;
}
.dag-svg-node .node-sublabel {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 500;
  fill: var(--text-muted);
  pointer-events: none;
}
.dag-svg-node.active .node-label { fill: var(--brand); }

.edge-line {
  stroke: rgba(91,33,182,.3);
  stroke-width: 2;
  fill: none;
  stroke-dasharray: 6 4;
  animation: edgeDash 2s linear infinite;
}
@keyframes edgeDash { from { stroke-dashoffset: 20; } to { stroke-dashoffset: 0; } }

.flow-particle {
  fill: var(--brand);
  filter: drop-shadow(0 0 4px rgba(167,139,250,.6));
}

/* ─── Narrator ─── */
.narrator-box {
  background: linear-gradient(135deg, rgba(91,33,182,.04), rgba(217,70,239,.03));
  border: 1.5px solid rgba(91,33,182,.12);
  border-radius: 14px;
  padding: 18px 22px;
  margin: 18px 0;
  display: flex; align-items: flex-start; gap: 14px;
  min-height: 64px;
  transition: all .4s var(--ease);
}
.narrator-icon {
  font-size: 28px;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(91,33,182,.08);
  border-radius: 12px;
  flex-shrink: 0;
}
.narrator-content { flex: 1; }
.narrator-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 800; font-size: 15px;
  color: var(--brand);
  margin-bottom: 4px;
}
.narrator-text {
  font-size: 14.5px;
  color: var(--text-body);
  line-height: 1.6;
}

/* ─── Auto-play button ─── */
.autoplay-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 24px;
  border-radius: 26px;
  border: 2px solid rgba(91,33,182,.3);
  background: rgba(91,33,182,.05);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px; font-weight: 700;
  color: var(--brand);
  cursor: pointer;
  transition: all .3s var(--ease);
  letter-spacing: .3px;
  margin: 14px 0;
}
.autoplay-btn:hover {
  background: rgba(91,33,182,.1);
  border-color: rgba(91,33,182,.5);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(91,33,182,.15);
}
.autoplay-btn.playing {
  background: var(--gradient-brand);
  color: #fff; border-color: transparent;
  box-shadow: 0 6px 24px rgba(91,33,182,.3);
}

/* ─── Healthcare example box ─── */
.hc-example {
  background: linear-gradient(135deg, rgba(91,33,182,.04), rgba(13,148,136,.03));
  border-left: 3px solid var(--brand);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 14px 0;
}
.hc-example .hc-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--brand);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.hc-example .hc-content {
  font-size: 15px;
  color: var(--text-body);
  font-style: italic;
  line-height: 1.55;
}
.hc-example .hc-content strong { font-style: normal; color: var(--text-heading); }

/* ─── Callouts ─── */
.callout {
  border-radius: 12px;
  padding: 16px 20px;
  margin: 16px 0;
  display: flex; gap: 12px; align-items: flex-start;
}
.callout.tip { background: var(--teal-bg); border: 1px solid rgba(13,148,136,.2); }
.callout.tip .callout-icon { color: var(--teal); }
.callout.warning { background: var(--amber-bg); border: 1px solid rgba(217,119,6,.2); }
.callout.warning .callout-icon { color: var(--amber); }
.callout.insight { background: var(--blue-bg); border: 1px solid rgba(37,99,235,.2); }
.callout.insight .callout-icon { color: var(--blue); }
.callout-icon { font-size: 20px; flex-shrink: 0; }
.callout-text { font-size: 14.5px; color: var(--text-body); line-height: 1.6; }
.callout-text strong { color: var(--text-heading); }

/* ─── Capability table ─── */
.cap-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  margin: 16px 0;
}
.cap-table th {
  background: var(--brand-glow);
  color: var(--brand);
  padding: 12px 16px;
  text-align: left;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  border-bottom: 2px solid rgba(91,33,182,.15);
}
.cap-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14.5px;
  color: var(--text-body);
  vertical-align: top;
}
.cap-table tr:last-child td { border-bottom: none; }
.cap-table tr:hover td { background: rgba(91,33,182,.02); }
.cap-icon { font-size: 18px; }

/* ─── One-Hot vs Dense Embeddings (embeddings explainer) ─── */
.onehot-viz {
  margin: 18px 0; display: flex; flex-direction: column; gap: 12px;
}
.onehot-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.onehot-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px; font-weight: 700;
  color: var(--brand);
  width: 96px; min-width: 96px;
  text-align: right;
}
.onehot-cells { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.oh {
  width: 30px; height: 30px;
  background: #F3F4F6;
  border: 1px solid var(--border);
  border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; font-weight: 600;
  color: #94A3B8;
}
.oh.active {
  background: var(--gradient-brand);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(91,33,182,.3);
}
.dense-cells { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.dc {
  padding: 6px 10px;
  background: rgba(91,33,182,.06);
  border: 1px solid rgba(91,33,182,.2);
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; font-weight: 600;
  color: var(--brand);
}

/* ─── Footer ─── */
.exp-footer {
  text-align: center;
  padding: 40px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.exp-footer .next-up {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 14px 24px;
  text-decoration: none;
  transition: all .3s var(--ease);
  margin-bottom: 18px;
}
.exp-footer .next-up:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(91,33,182,.1);
}
.exp-footer .next-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  text-transform: uppercase;
}
.exp-footer .next-title {
  font-family: 'Outfit', sans-serif;
  font-size: 15px; font-weight: 700;
  color: var(--text-heading);
}
.exp-footer .next-arrow { font-size: 20px; color: var(--brand); }
.exp-footer .copyright { font-size: 13px; color: var(--text-muted); }

@media (max-width: 768px) {
  .exp-hero { padding: 2rem 1.25rem; }
  .tab-nav button { min-width: 100px; font-size: 12px; padding: 12px 8px; }
  .tab-content { padding: 22px 14px 56px; }
  .exp-card { padding: 22px 18px; }
  .cc-grid { grid-template-columns: 1fr; }
  .onehot-cells, .dense-cells { width: 100%; }
}
