/* Shared styling for the Rana AI Mentor plug-in demos.
 *
 * These files are plain static HTML served outside the Next.js app, so they cannot reference
 * app/globals.css's custom properties. The equivalent values from that file's :root block are
 * inlined here and kept in sync by hand -- the same approach the older demos in this directory
 * already take.
 */
:root {
  --bg: #ffffff;
  --bg-alt: #f4f7f6;
  --fg: #10231f;
  --fg-muted: #4b5f5a;
  --accent: #0f9d8f;
  --accent-contrast: #ffffff;
  --border: #dbe6e3;
  --danger: #dc2626;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

body { padding: 18px; }

.rw-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  background: var(--bg);
  max-width: 760px;
}

.rw-badge {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
}

.rw-title { margin: 0 0 4px; font-size: 1.15rem; font-weight: 700; }
.rw-subtitle { margin: 0 0 14px; font-size: 0.9rem; color: var(--fg-muted); }

.rw-selects {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.rw-select-wrap { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; }
.rw-select-label { color: var(--fg-muted); font-weight: 600; }

.rw-select {
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-size: 0.85rem;
}

.rw-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  resize: vertical;
}

.rw-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.rw-run,
.rw-clear {
  padding: 9px 16px;
  border-radius: 6px;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid transparent;
}

.rw-run { background: var(--accent); color: var(--accent-contrast); }
.rw-run:hover:not(:disabled) { opacity: 0.9; }
.rw-run:disabled { opacity: 0.6; cursor: default; }
.rw-clear { background: var(--bg); color: var(--fg); border-color: var(--border); }
.rw-clear:hover { background: var(--bg-alt); }

.rw-run:focus-visible,
.rw-clear:focus-visible,
.rw-input:focus-visible,
.rw-select:focus-visible,
.rw-wiring summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.rw-status { margin: 10px 0 0; font-size: 0.85rem; color: var(--danger); min-height: 1em; }

.rw-output { margin-top: 4px; max-height: 420px; overflow-y: auto; }

.rw-turn {
  border-top: 1px solid var(--border);
  margin-top: 14px;
  padding-top: 14px;
}

.rw-turn-prompt { margin: 0 0 8px; font-size: 0.88rem; color: var(--fg-muted); }

.rw-answer { font-size: 0.94rem; }
.rw-answer h3, .rw-answer h4, .rw-answer h5, .rw-answer h6 { margin: 14px 0 6px; font-size: 1rem; }
.rw-answer p { margin: 0 0 10px; }
.rw-answer ul { margin: 0 0 10px; padding-left: 20px; }
.rw-answer li { margin-bottom: 4px; }
.rw-answer code {
  background: var(--bg-alt);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.88em;
}

.rw-wiring { margin-top: 10px; font-size: 0.85rem; }
.rw-wiring summary { cursor: pointer; color: var(--accent); font-weight: 600; }

.rw-wiring-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 16px;
  margin: 10px 0 0;
  padding: 10px 12px;
  background: var(--bg-alt);
  border-radius: 6px;
}

.rw-wiring-grid dt { color: var(--fg-muted); }
.rw-wiring-grid dd { margin: 0; font-variant-numeric: tabular-nums; }

.rw-example { margin: 12px 0 0; font-size: 0.82rem; color: var(--fg-muted); font-style: italic; }

.rw-footer { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
.rw-footer-brand { margin: 0 0 3px; font-size: 0.76rem; color: var(--fg-muted); font-weight: 600; }
.rw-footer-note { margin: 0; font-size: 0.74rem; color: var(--fg-muted); }

/* Grounding passage shown above the auto-grounded controls, so a visitor can read exactly what
   the AI is summarising or quizzing on. */
.rw-source {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: var(--bg-alt);
  padding: 14px 16px;
  margin: 0 0 16px;
  max-width: 760px;
  font-size: 0.88rem;
}

.rw-source h2 { margin: 0 0 4px; font-size: 0.95rem; }
.rw-source .rw-source-note { margin: 0 0 10px; font-size: 0.8rem; color: var(--fg-muted); }
.rw-source p { margin: 0 0 8px; }
.rw-source p:last-child { margin-bottom: 0; }
