/* Demo page styles — OpsStack brand */

.demo-main {
  padding: 100px 2rem 80px;
  min-height: 100vh;
}
.demo-container {
  max-width: 1100px;
  margin: 0 auto;
}

/* Header */
.demo-eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 600;
  margin-bottom: 0.75rem;
}
.demo-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 800;
  color: var(--fg);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}
.demo-subtitle {
  font-size: 1rem;
  color: var(--fg-2);
  max-width: 600px;
  line-height: 1.65;
  margin-bottom: 0;
}

/* Sections */
.demo-section {
  margin-top: 3rem;
}

/* Scenario Grid */
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.scenario-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: border-color 0.2s, transform 0.2s;
}
.scenario-card:hover {
  border-color: rgba(245,158,11,0.25);
  transform: translateY(-2px);
}

/* Tier Badge */
.scenario-tier {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tier-hot { color: #22c55e; }
.tier-warm { color: #f59e0b; }
.tier-cold { color: #8b8fa8; }
.tier-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

/* Lead info */
.scenario-lead {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.lead-field {
  display: flex;
  gap: 0.75rem;
  font-size: 0.82rem;
}
.field-label {
  color: var(--fg-2);
  width: 55px;
  flex-shrink: 0;
}
.field-val {
  color: var(--fg);
  font-weight: 500;
}
.scenario-message {
  font-size: 0.85rem;
  color: var(--fg-2);
  line-height: 1.55;
  border-left: 2px solid var(--border);
  padding-left: 1rem;
  font-style: italic;
  flex: 1;
}

/* Run Buttons */
.run-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  border: none;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  margin-top: auto;
}
.run-btn:hover { opacity: 0.88; transform: scale(0.98); }
.run-btn:active { transform: scale(0.95); }
.run-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.run-btn-hot {
  background: #22c55e;
  color: #0f1117;
}
.run-btn-warm {
  background: var(--accent);
  color: #0f1117;
}
.run-btn-cold {
  background: var(--surface-2);
  color: var(--fg-2);
  border: 1px solid var(--border);
}
.btn-icon { font-size: 0.7rem; }

/* Pipeline Status */
.pipeline-status {
  margin-top: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: opacity 0.3s;
}
.pipeline-status.hidden { display: none; }
.pipeline-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}
.pipeline-step {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--fg-2);
  transition: all 0.3s;
}
.pipeline-step.done {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.3);
  color: #22c55e;
}
.pipeline-step.running {
  background: var(--accent-dim);
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--accent);
  animation: pulse 1s ease-in-out infinite;
}
.pipeline-arrow {
  color: var(--border);
  font-size: 0.75rem;
  padding: 0 0.25rem;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Result Panel */
.result-panel {
  margin-top: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: opacity 0.3s, transform 0.3s;
}
.result-panel.hidden { display: none; }
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.result-run-id {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--fg-2);
}
.result-status {
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font-display);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
}
.result-status.completed {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
}
.result-status.failed {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}
.result-section {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.result-section:last-child { border-bottom: none; }
.result-section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 600;
  margin-bottom: 1rem;
}

/* Score display */
.score-display {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.score-number {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--fg);
  line-height: 1;
}
.score-tier-badge {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.score-tier-badge.hot {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.score-tier-badge.warm {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(245, 158, 11, 0.25);
}
.score-tier-badge.cold {
  background: var(--surface-2);
  color: var(--fg-2);
  border: 1px solid var(--border);
}
.score-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.breakdown-pill {
  font-size: 0.78rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
  color: var(--fg-2);
}
.breakdown-pill span {
  color: var(--accent);
  font-weight: 600;
}

/* Email */
.email-subject {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.75rem;
}
.email-body {
  font-size: 0.88rem;
  color: var(--fg-2);
  line-height: 1.65;
  white-space: pre-wrap;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
}
.email-skip-notice {
  font-size: 0.78rem;
  color: var(--accent);
  margin-top: 0.5rem;
  font-style: italic;
}

/* Integrations */
.integration-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.integration-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.int-label {
  font-size: 0.82rem;
  color: var(--fg-2);
}
.int-status {
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-display);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
}
.int-status.ok {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
}
.int-status.skipped {
  background: var(--surface-2);
  color: var(--fg-2);
}
.int-status.error {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

/* Recent Runs Table */
.runs-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.runs-table-header,
.runs-table-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 0.7fr 0.7fr 1.5fr;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  align-items: center;
}
.runs-table-header {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-2);
  font-family: var(--font-display);
  font-weight: 600;
}
.runs-table-row {
  border-bottom: 1px solid var(--border);
  font-size: 0.83rem;
  transition: background 0.15s;
}
.runs-table-row:last-child { border-bottom: none; }
.runs-table-row:hover { background: var(--surface-2); cursor: pointer; }
.run-leads { color: var(--fg); font-weight: 500; }
.run-company { color: var(--fg-2); font-size: 0.78rem; }
.run-run-id { color: var(--fg-2); font-family: monospace; font-size: 0.75rem; }
.run-score-num { font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; }
.run-tier { font-size: 0.75rem; font-weight: 600; font-family: var(--font-display); padding: 0.2rem 0.5rem; border-radius: 4px; }
.tier-hot-run { color: #22c55e; }
.tier-warm-run { color: var(--accent); }
.tier-cold-run { color: var(--fg-2); }
.run-status { font-size: 0.75rem; font-weight: 600; }
.run-view-btn {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 6px;
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  transition: background 0.2s;
}
.run-view-btn:hover { background: rgba(245, 158, 11, 0.2); }
.runs-empty { padding: 2rem; text-align: center; color: var(--fg-2); font-size: 0.88rem; }

/* Loading spinner in button */
.run-btn.loading::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 0.25rem;
}

/* Responsive */
@media (max-width: 900px) {
  .scenario-grid { grid-template-columns: 1fr; }
  .runs-table-header,
  .runs-table-row { grid-template-columns: 1fr 1fr 0.6fr 0.6fr; }
  .runs-table-header > *:last-child,
  .runs-table-row > *:last-child { display: none; }
}
@media (max-width: 600px) {
  .runs-table-header { display: none; }
  .runs-table-row { grid-template-columns: 1fr 1fr; }
  .pipeline-bar { gap: 0.25rem; }
  .pipeline-step { font-size: 0.72rem; padding: 0.4rem 0.6rem; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}