/* Demo page — extends theme.css */

/* ── Demo Header ── */
.demo-header {
  padding: 60px 48px 48px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}

.demo-header-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.demo-header h1 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 2.8rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 12px 0 16px;
  color: var(--fg);
}

.demo-header .hero-sub {
  max-width: 640px;
  font-size: 0.95rem;
  color: var(--fg-muted);
  line-height: 1.65;
}

/* ── Demo Main Layout ── */
.demo-main {
  display: grid;
  grid-template-columns: 480px 1fr;
  gap: 0;
  max-width: 1200px;
  margin: 0 auto;
  min-height: calc(100vh - 280px);
}

/* ── Input Panel ── */
.input-panel {
  padding: 36px 40px;
  border-right: 1px solid var(--border);
  position: sticky;
  top: 65px;
  max-height: calc(100vh - 65px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.input-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--fg-muted);
  font-size: 0.8rem;
}

.input-divider::before,
.input-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.input-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mono-input {
  background: var(--terminal-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--t-val);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  padding: 10px 14px;
  transition: border-color 0.2s;
  width: 100%;
}

.mono-input:focus {
  outline: none;
  border-color: var(--accent-dim);
  background: var(--bg-surface);
}

.mono-textarea {
  resize: vertical;
  min-height: 100px;
}

.input-hint {
  font-size: 0.75rem;
  color: var(--fg-muted);
  line-height: 1.4;
}

/* ── Analyze Button ── */
.analyze-btn {
  background: var(--accent);
  color: #0a0a0d;
  border: none;
  border-radius: 6px;
  padding: 12px 20px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  letter-spacing: 0.02em;
  width: 100%;
}

.analyze-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.analyze-btn:not(:disabled):hover {
  background: var(--accent-dim);
}

.analyze-btn.loading {
  opacity: 0.8;
  cursor: wait;
}

/* Loading dots animation */
@keyframes dot-blink {
  0%, 20% { opacity: 0; }
  40%, 100% { opacity: 1; }
}

.dots::after {
  content: '';
  animation: dot-blink 1.4s infinite;
  animation-delay: 0.2s;
}

.dots::before {
  content: '';
  animation: dot-blink 1.4s infinite;
}

/* ── Example Links ── */
.example-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--fg-muted);
}

.example-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--fg-muted);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  padding: 4px 10px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.example-btn:hover {
  border-color: var(--accent-dim);
  color: var(--accent);
}

/* ── Reasoning Panel ── */
.reasoning-panel {
  padding: 36px 40px;
  overflow-y: auto;
  max-height: calc(100vh - 65px);
}

/* Placeholder state */
.panel-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 400px;
  color: var(--fg-muted);
  text-align: center;
  gap: 12px;
}

.placeholder-icon { opacity: 0.5; }
.placeholder-sub {
  font-size: 0.8rem;
  color: var(--fg-muted);
  opacity: 0.7;
  max-width: 320px;
  line-height: 1.5;
}

/* ── Reasoning Output ── */
.reasoning-output { display: flex; flex-direction: column; gap: 20px; }

.reasoning-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}

.step-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.step-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  color: var(--fg-muted);
  background: var(--terminal-bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 8px;
}

.step-body {
  padding: 18px 20px;
  font-size: 0.88rem;
  color: var(--fg);
  line-height: 1.7;
}

.step-body.collapsed { display: none; }

/* ── Metadata Bar ── */
.meta-bar {
  background: var(--terminal-bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 14px 18px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  line-height: 1.8;
  color: var(--fg-muted);
  margin-bottom: 20px;
}

.meta-bar strong { color: var(--fg); }

.error-output {
  background: rgba(200,60,60,0.08);
  border: 1px solid rgba(200,60,60,0.3);
  border-radius: 8px;
  padding: 20px 24px;
  color: #e07070;
  font-size: 0.88rem;
  line-height: 1.6;
}

.error-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: #e07070;
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}

/* ── Confidence Badge ── */
.confidence-high { color: #6bc46a; }
.confidence-medium { color: var(--accent); }
.confidence-low { color: #e07070; }

/* ── Mobile ── */
@media (max-width: 900px) {
  .demo-main { grid-template-columns: 1fr; }
  .input-panel { position: static; max-height: none; border-right: none; border-bottom: 1px solid var(--border); }
  .reasoning-panel { max-height: none; }
  .demo-header { padding: 40px 24px 32px; }
  .demo-header h1 { font-size: 2rem; }
}