/* ===== Documentation Layout ===== */
.docs-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  padding-top: 73px;
}

/* ===== Sidebar ===== */
.docs-sidebar {
  position: sticky;
  top: 73px;
  height: calc(100vh - 73px);
  overflow-y: auto;
  padding: 32px 24px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
}

.docs-nav-section {
  margin-bottom: 28px;
}

.docs-nav-section h4 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.docs-nav-section a {
  display: block;
  padding: 8px 12px;
  margin: 0 -12px;
  font-size: 14px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.docs-nav-section a:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.docs-nav-section a.active {
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.1);
}

/* ===== Main Content ===== */
.docs-content {
  padding: 48px 64px;
  max-width: 900px;
}

.docs-header {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-color);
}

.docs-header h1 {
  font-size: 36px;
  font-weight: 700;
  margin: 16px 0 12px;
}

.docs-header p {
  font-size: 18px;
  color: var(--text-secondary);
}

/* ===== Sections ===== */
.docs-section {
  margin-bottom: 64px;
  scroll-margin-top: 100px;
}

.docs-section h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.docs-section h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 32px 0 16px;
}

.docs-section h4 {
  font-size: 16px;
  font-weight: 600;
  margin: 24px 0 12px;
}

.docs-section p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}

.docs-section ul,
.docs-section ol {
  margin: 16px 0;
  padding-left: 24px;
  color: var(--text-secondary);
}

.docs-section li {
  margin-bottom: 8px;
  line-height: 1.6;
}

.docs-section code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 2px 6px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  color: var(--accent-primary);
}

/* ===== Code Blocks ===== */
.code-block {
  margin: 20px 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.code-block.compact {
  margin: 12px 0;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
  font-size: 12px;
  color: var(--text-muted);
}

.copy-btn {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
}

.copy-btn:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.code-block pre {
  padding: 16px;
  margin: 0;
  overflow-x: auto;
}

.code-block code {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  background: none;
  padding: 0;
  color: var(--text-secondary);
}

/* ===== Tables ===== */
.docs-table {
  width: 100%;
  margin: 20px 0;
  border-collapse: collapse;
  font-size: 14px;
}

.docs-table th,
.docs-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.docs-table th {
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.docs-table td {
  color: var(--text-secondary);
}

.docs-table td code {
  font-size: 12px;
}

/* ===== Callouts ===== */
.callout {
  display: flex;
  gap: 16px;
  padding: 20px;
  margin: 24px 0;
  border-radius: var(--radius-md);
  border: 1px solid;
}

.callout-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.callout-content strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.callout-content p {
  margin: 0;
  font-size: 14px;
}

.callout.info {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.2);
}

.callout.warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
}

.callout.success {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.2);
}

/* ===== Steps ===== */
.steps {
  margin: 24px 0;
}

.step {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
}

.step-num {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-gradient);
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-content h4 {
  margin: 0 0 8px;
  font-size: 15px;
}

/* ===== Command Grid ===== */
.command-grid {
  display: grid;
  gap: 20px;
  margin: 24px 0;
}

.command-card {
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.command-header {
  margin-bottom: 12px;
}

.command-header code {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-primary);
  background: none;
  padding: 0;
}

.command-card p {
  margin-bottom: 16px;
  font-size: 14px;
}

/* ===== Agent Docs Grid ===== */
.agent-docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.agent-doc-card {
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.agent-doc-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.agent-doc-emoji {
  font-size: 28px;
}

.agent-doc-header h4 {
  margin: 0 0 4px;
  font-size: 16px;
}

.agent-doc-card p {
  font-size: 13px;
  margin: 0;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: 4px;
}

.badge.generalist {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.badge.specialist {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
}

.badge.challenger {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

/* ===== Vote Types ===== */
.vote-types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.vote-type {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid;
}

.vote-label {
  display: inline-block;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 4px;
  margin-bottom: 8px;
}

.vote-type p {
  font-size: 13px;
  margin: 0;
}

.vote-type.approve {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.2);
}

.vote-type.approve .vote-label {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.vote-type.revise {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
}

.vote-type.revise .vote-label {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.vote-type.reject {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
}

.vote-type.reject .vote-label {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error);
}

.vote-type.abstain {
  background: rgba(113, 113, 122, 0.08);
  border-color: rgba(113, 113, 122, 0.2);
}

.vote-type.abstain .vote-label {
  background: rgba(113, 113, 122, 0.2);
  color: var(--text-muted);
}

/* ===== Help Section ===== */
.docs-help {
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.docs-help h2 {
  border: none;
  padding: 0;
  margin-bottom: 8px;
}

.help-links {
  display: flex;
  gap: 16px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.help-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  transition: var(--transition);
}

.help-link:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-primary);
}

.help-link svg {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
}

/* ===== Docs Footer ===== */
.docs-footer {
  margin-left: 260px;
  padding: 32px 0;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    display: none;
  }

  .docs-content {
    padding: 32px 24px;
  }

  .docs-footer {
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  .docs-header h1 {
    font-size: 28px;
  }

  .docs-section h2 {
    font-size: 24px;
  }

  .vote-types,
  .agent-docs-grid {
    grid-template-columns: 1fr;
  }
}
