/* Docs-specific styles */

/* Layout */
.docs-layout {
  display: flex;
  min-height: calc(100vh - 65px);
}

/* Sidebar */
.docs-sidebar {
  width: 250px;
  flex-shrink: 0;
  position: sticky;
  top: 65px;
  height: calc(100vh - 65px);
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 0;
}

.docs-sidebar nav {
  padding: 0 16px;
}

.docs-sidebar .sidebar-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  padding: 0 12px;
  margin-bottom: 8px;
  margin-top: 20px;
}

.docs-sidebar .sidebar-title:first-child {
  margin-top: 0;
}

.docs-sidebar a {
  display: block;
  padding: 7px 12px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

.docs-sidebar a:hover {
  color: var(--text);
  background: var(--surface2);
}

.docs-sidebar a.active {
  color: var(--green);
  background: rgba(16,185,129,0.08);
}

/* Mobile sidebar toggle */
.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 50;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  border: none;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

/* Content */
.docs-content {
  flex: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 40px 96px;
}

.docs-content h1 {
  font-size: 2.25rem;
  margin-bottom: 8px;
}

.docs-content h1 + .text-dim {
  margin-bottom: 40px;
  display: block;
}

.docs-content h2 {
  font-size: 1.5rem;
  margin-top: 56px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.docs-content h3 {
  font-size: 1.15rem;
  margin-top: 36px;
  margin-bottom: 12px;
}

.docs-content h2 .anchor,
.docs-content h3 .anchor {
  color: var(--text-faint);
  text-decoration: none;
  margin-left: 8px;
  opacity: 0;
  transition: opacity 0.15s;
}

.docs-content h2:hover .anchor,
.docs-content h3:hover .anchor {
  opacity: 1;
}

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

.docs-content ul, .docs-content ol {
  color: var(--text-dim);
  margin-bottom: 16px;
  padding-left: 24px;
  line-height: 1.8;
}

.docs-content li {
  margin-bottom: 4px;
}

.docs-content a {
  color: var(--green);
  text-decoration: none;
}

.docs-content a:hover {
  text-decoration: underline;
}

/* Code */
.docs-content code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--surface2);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--green);
}

.docs-content pre {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  overflow-x: auto;
  margin-bottom: 24px;
  line-height: 1.6;
}

.docs-content pre code {
  background: none;
  padding: 0;
  font-size: 13px;
  color: var(--text);
}

/* Tables */
.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 14px;
}

.docs-content th,
.docs-content td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.docs-content th {
  color: var(--text-faint);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.docs-content td {
  color: var(--text-dim);
}

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

/* Docs Hub cards */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 32px;
}

.docs-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  transition: border-color 0.2s;
}

.docs-card:hover {
  border-color: var(--green);
  text-decoration: none;
}

.docs-card h3 {
  color: var(--text);
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1rem;
}

.docs-card p {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 0;
}

/* Rule filters */
.rule-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.rule-filters button {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font);
}

.rule-filters button:hover {
  border-color: var(--text-dim);
  color: var(--text);
}

.rule-filters button.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

/* Search bar */
.rule-search {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  margin-bottom: 16px;
  outline: none;
  transition: border-color 0.15s;
}

.rule-search:focus {
  border-color: var(--green);
}

.rule-search::placeholder {
  color: var(--text-faint);
}

/* Details/summary */
.docs-content details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  background: var(--surface);
}

.docs-content details[open] {
  border-color: var(--text-faint);
}

.docs-content summary {
  padding: 14px 20px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.docs-content summary::-webkit-details-marker {
  display: none;
}

.docs-content summary::after {
  content: "+";
  color: var(--text-faint);
  font-size: 18px;
  transition: transform 0.2s;
}

.docs-content details[open] summary::after {
  content: "-";
}

.docs-content details .details-body {
  padding: 0 20px 16px;
}

/* Command block */
.command-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
}

.command-block h4 {
  font-size: 15px;
  margin-bottom: 8px;
  color: var(--text);
}

.command-block p {
  font-size: 14px;
}

/* Severity badges in tables */
.sev-critical { color: var(--critical); font-weight: 600; }
.sev-high { color: var(--high); font-weight: 600; }
.sev-medium { color: var(--medium); font-weight: 600; }
.sev-low { color: var(--low); font-weight: 600; }

/* Pipeline (docs version) */
.docs-pipeline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 32px 0;
}

/* Callout / note box */
.callout {
  background: var(--surface);
  border-left: 3px solid var(--green);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 20px;
  margin-bottom: 24px;
}

.callout p {
  margin-bottom: 0;
}

.callout strong {
  color: var(--text);
}

/* Responsive */
@media (max-width: 900px) {
  .docs-sidebar {
    display: none;
    position: fixed;
    top: 65px;
    left: 0;
    width: 280px;
    z-index: 50;
    box-shadow: 4px 0 24px rgba(0,0,0,0.4);
  }

  .docs-sidebar.open {
    display: block;
  }

  .sidebar-toggle {
    display: block;
  }

  .docs-content {
    padding: 32px 20px 80px;
  }

  .docs-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .docs-content {
    padding: 24px 16px 80px;
  }

  .docs-content h1 {
    font-size: 1.75rem;
  }

  .docs-pipeline {
    flex-direction: column;
  }

  .docs-pipeline .pipeline-arrow {
    transform: rotate(90deg);
  }
}
