/* Trainero Workouts Demo – shared styles for workflow.html and index.html */

:root {
  --bg: #1a1d23;
  --surface: #242830;
  --border: #3b4048;
  --text: #e6e8ec;
  --text-muted: #9ca3af;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #22c55e;
  --panel-bg: #0f1115;
  --font: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

/* Layout */
.demo-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

.demo-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.demo-header h1 {
  margin: 0 0 0.25rem 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.demo-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Tabs / use case selector */
.demo-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.demo-tab {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
}

.demo-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.demo-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* Steps list */
.demo-steps {
  list-style: none;
  margin: 0 0 1.5rem 0;
  padding: 0;
}

.demo-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.demo-step:last-child {
  border-bottom: none;
}

.demo-step-label {
  flex: 0 0 2rem;
  font-weight: 600;
  color: var(--text-muted);
}

.demo-step-method {
  flex: 0 0 4rem;
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  color: var(--accent);
}

.demo-step-path {
  flex: 1;
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
  word-break: break-all;
}

/* Buttons */
.demo-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}

.demo-btn:hover {
  background: var(--accent-hover);
}

.demo-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.demo-btn-run {
  flex-shrink: 0;
}

/* Request / Response panels */
.demo-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

@media (max-width: 768px) {
  .demo-panels {
    grid-template-columns: 1fr;
  }
}

.demo-panel {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.demo-panel-title {
  margin: 0;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.demo-panel-body {
  padding: 1rem;
  max-height: 360px;
  overflow: auto;
}

.demo-panel-body pre {
  margin: 0;
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.demo-panel-body .status {
  display: inline-block;
  margin-bottom: 0.5rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.demo-panel-body .status-2xx {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.demo-panel-body .status-4xx {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

/* Workflow page – sections */
.workflow-section {
  margin-bottom: 2rem;
}

.workflow-section h2 {
  margin: 0 0 1rem 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}

.workflow-section .mermaid {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
}

.workflow-section table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.workflow-section th,
.workflow-section td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border: 1px solid var(--border);
}

.workflow-section th {
  background: var(--surface);
  font-weight: 600;
}

.workflow-section tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.workflow-section code {
  font-family: ui-monospace, monospace;
  font-size: 0.85em;
  padding: 0.15rem 0.35rem;
  background: var(--surface);
  border-radius: 4px;
}

/* Empty state */
.demo-empty {
  color: var(--text-muted);
  font-style: italic;
  padding: 1rem;
}
