/* BATbern Documentation Portal Styles */

/* Import shared base styles */
@import 'base.css';

/* Main Layout */
.main-layout {
  display: flex;
  min-height: 100vh;
  padding-top: var(--header-height);
}

.main-layout.no-sidebar {
  display: block;
}

.main-layout.no-sidebar .main-content {
  margin-left: 0;
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--card);
  border-right: 1px solid var(--border);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  position: fixed;
  left: 0;
  top: var(--header-height);
  z-index: var(--z-sidebar);
}

.sidebar-content {
  padding: var(--space-6);
}

/* Search */
.search-container {
  position: relative;
  margin-bottom: var(--space-6);
}

.search-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  padding-right: var(--space-10);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  background: var(--muted);
  color: var(--foreground);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px oklch(0.685 0.169 237.323 / 0.2);
}

.search-button {
  position: absolute;
  right: var(--space-2);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  color: var(--muted-foreground);
}

/* Navigation */
.sidebar-nav {
  margin-bottom: var(--space-8);
}

.nav-section {
  margin-bottom: var(--space-6);
}

.nav-section-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-3);
  cursor: pointer;
  user-select: none;
}

.nav-section-title:hover {
  color: var(--primary);
}

/* User Guide Primary Section */
.nav-section-primary {
  background: linear-gradient(135deg, rgba(21, 101, 192, 0.05), rgba(21, 101, 192, 0.02));
  border-left: 3px solid var(--primary-color);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-8);
}

.nav-section-primary .nav-section-title {
  color: var(--primary-color);
  font-size: var(--text-base);
  margin-bottom: var(--space-4);
}

.nav-section-badge {
  background: var(--accent-color);
  color: white;
  font-size: 0.625rem;
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-section-count {
  background: var(--gray-400);
  color: var(--text-muted);
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  margin-left: auto;
}

.nav-section-toggle {
  margin-left: auto;
  font-size: var(--text-xs);
  transition: transform var(--transition-fast);
}

.nav-section.nav-section-expanded .nav-section-toggle {
  transform: rotate(0deg);
}

.nav-section:not(.nav-section-expanded) .nav-section-toggle {
  transform: rotate(-90deg);
}

.nav-section:not(.nav-section-expanded) .nav-section-items {
  display: none;
}

.nav-section-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  margin-bottom: var(--space-1);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
}

.nav-link:hover {
  background: var(--background-color);
  color: var(--primary-color);
  text-decoration: none;
}

.nav-link-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.epic-badge {
  background: var(--primary-color);
  color: white;
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.story-count {
  background: var(--gray-400);
  color: var(--text-muted);
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}

/* Epic Navigation */
.nav-epic-container {
  position: relative;
}

.nav-epic-header {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  gap: var(--space-2);
}

.nav-epic-header:hover {
  background: var(--background-color);
  border-radius: var(--radius-md);
}

.epic-link {
  flex: 0 1 auto;
  display: flex !important;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.epic-toggle {
  flex: 0 0 auto;
  padding: var(--space-1);
  font-size: var(--text-xs);
  color: var(--text-muted);
  transition: transform var(--transition-fast);
  width: 20px;
  text-align: center;
}

.epic-stories {
  list-style: none;
  margin: var(--space-2) 0 0 0;
  padding: 0;
  display: none;
  border-left: 2px solid var(--border-color);
  margin-left: var(--space-4);
  padding-left: var(--space-3);
}

.story-item {
  margin-bottom: var(--space-1);
}

.story-link {
  display: flex !important;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2);
  font-size: calc(var(--text-sm) * 0.9);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
}

.story-link:hover {
  background: rgba(var(--primary-color-rgb), 0.1);
  color: var(--primary-color);
}

.story-badge {
  background: var(--secondary-color);
  color: white;
  font-size: var(--text-xs);
  padding: 2px var(--space-1);
  border-radius: var(--radius-xs);
  font-weight: 500;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: var(--space-8) var(--space-6);
  max-width: calc(var(--content-max-width) - var(--sidebar-width));
}

/* Breadcrumbs */
.breadcrumbs {
  margin-bottom: var(--space-6);
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: var(--text-sm);
}

.breadcrumb-item {
  color: var(--text-muted);
}

.breadcrumb-link {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumb-link:hover {
  color: var(--primary-color);
}

.breadcrumb-item.active {
  color: var(--text-primary);
  font-weight: 500;
}

.breadcrumb-separator {
  margin: 0 var(--space-2);
  color: var(--text-muted);
}

/* Content Header */
.content-header {
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--border-color);
}

.content-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.content-category {
  background: var(--gray-400);
  color: var(--text-secondary);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
}

.epic-info {
  background: var(--primary-color);
  color: white;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
}

.content-title {
  margin-bottom: var(--space-3);
}

.content-description {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
}

.content-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.stat {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
}

.stat-label {
  color: var(--text-muted);
}

.stat-value {
  font-weight: 500;
  color: var(--text-primary);
}

/* ============================================
   Floating Action Button (FAB) for TOC
   ============================================ */

.toc-fab {
  position: fixed;
  bottom: calc(var(--space-6) + 70px); /* Above back-to-top button */
  right: var(--space-6);
  width: 3.5rem;
  height: 3.5rem;
  background: var(--secondary-color);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toc-fab:hover {
  background: var(--primary-dark);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.toc-fab:active {
  transform: translateY(0) scale(0.95);
}

.toc-fab .toc-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent-color);
  color: white;
  font-size: 0.625rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ============================================
   TOC Drawer Overlay
   ============================================ */

.toc-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: none;
  animation: fadeIn 0.2s ease-out;
}

.toc-overlay.visible {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ============================================
   TOC Drawer (Slide-in Panel)
   ============================================ */

.toc-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 90%;
  max-width: 400px;
  height: 100vh;
  background: var(--card);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.toc-overlay.visible .toc-drawer {
  transform: translateX(0);
}

.toc-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border);
  background: var(--background-color);
  flex-shrink: 0;
}

.toc-drawer-header h2 {
  margin: 0;
  font-size: var(--text-xl);
  color: var(--text-primary);
}

.toc-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s ease;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toc-close:hover {
  color: var(--text-primary);
}

.toc-drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6);
}

/* ============================================
   TOC List Styling (inside drawer)
   ============================================ */

.toc-drawer .toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc-drawer .toc-item {
  margin-bottom: var(--space-2);
}

.toc-drawer .toc-link {
  display: block;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--text-sm);
  line-height: 1.5;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.toc-drawer .toc-link:hover {
  color: var(--primary-color);
  background: var(--muted);
}

.toc-drawer .toc-level-1 {
  font-weight: 500;
}

.toc-drawer .toc-level-2 {
  padding-left: var(--space-6);
}

.toc-drawer .toc-level-3 {
  padding-left: calc(var(--space-6) * 2);
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 768px) {
  .toc-drawer {
    width: 100%;
    max-width: none;
  }

  .toc-fab {
    width: 3rem;
    height: 3rem;
    bottom: calc(var(--space-4) + 60px);
    right: var(--space-4);
  }
}

/* Document Content */
.document-content {
  margin-bottom: var(--space-12);
}

.document-content h1,
.document-content h2,
.document-content h3,
.document-content h4,
.document-content h5,
.document-content h6 {
  position: relative;
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
}

.document-content h1:first-child,
.document-content h2:first-child,
.document-content h3:first-child {
  margin-top: 0;
}

.heading-link {
  position: absolute;
  left: -1.5rem;
  opacity: 0;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: normal;
  transition: opacity var(--transition-fast);
}

.document-content h1:hover .heading-link,
.document-content h2:hover .heading-link,
.document-content h3:hover .heading-link,
.document-content h4:hover .heading-link,
.document-content h5:hover .heading-link,
.document-content h6:hover .heading-link {
  opacity: 1;
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  margin: var(--space-6) 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.doc-table th,
.doc-table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.doc-table th {
  background: var(--surface-color);
  font-weight: 600;
  color: var(--text-primary);
}

.doc-table tr:last-child td {
  border-bottom: none;
}

/* Code Blocks */
.code-block {
  margin: var(--space-6) 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--gray-900);
  position: relative;
}

.code-header {
  background: var(--gray-800);
  color: var(--gray-400);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.code-block pre {
  margin: 0;
  padding: var(--space-4);
  overflow-x: auto;
  background: var(--gray-900);
}

.code-block code {
  font-family: var(--font-family-mono);
  font-size: var(--text-sm);
  line-height: 1.6;
  color: #cdd9e5;
}

/* Prevent hljs theme from overriding the dark code-block background */
.code-block code.hljs {
  background: transparent !important;
}

.code-block:hover .copy-button {
  opacity: 1;
}

.copy-button {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  background: var(--gray-700);
  color: var(--gray-400);
  border: none;
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.copy-button:hover {
  background: var(--gray-600);
}

/* Inline Code */
:not(pre) > code {
  background: rgba(110, 118, 129, 0.35);
  color: #e2eaf4;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-family: var(--font-family-mono);
  font-size: 0.9em;
}

/* Blockquotes */
blockquote {
  margin: var(--space-6) 0;
  padding: var(--space-4) var(--space-6);
  background: var(--muted);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--foreground);
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* Lists */
.document-content ul,
.document-content ol {
  margin: var(--space-4) 0;
  padding-left: var(--space-6);
}

.document-content li {
  margin-bottom: var(--space-2);
}

/* Images */
.document-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  margin: var(--space-6) 0;
}

/* ============================================
   Homepage Styles - 4-Box Layout
   ============================================ */

.index-hero {
  text-align: center;
  padding: 2rem 2rem 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 3rem;
}

.hero-logo {
  height: 80px;
  width: 280px;
  object-fit: contain;
  margin-bottom: 1rem;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.index-hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 0.5rem;
}

.index-hero p {
  font-size: 1.25rem;
  color: var(--muted-foreground);
  margin: 0;
}

/* Main Sections Grid - 4 Clickable Boxes */
.main-sections-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto 3rem;
  padding: 0 1rem;
}

.section-box {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1rem;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  overflow: hidden;
}

.section-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.section-box:hover::before {
  transform: scaleX(1);
}

.section-box:hover {
  transform: translateY(-8px);
  box-shadow: 0px 8px 16px 0px hsl(0 0% 0% / 0.57);
  border-color: var(--primary);
  background: var(--muted);
}

.section-box:active {
  transform: translateY(-4px);
}

.section-icon {
  width: 64px;
  height: 64px;
  display: block;
  margin: 0 auto 0.75rem;
  color: var(--primary);
}

.section-icon svg {
  width: 100%;
  height: 100%;
}

.section-box h2 {
  color: var(--foreground);
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.section-box p {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  margin: 0;
  line-height: 1.4;
}

.section-badge {
  display: inline-block;
  background: var(--accent-color);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  margin-top: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Quick Links Section */
.quick-links {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
  text-align: center;
}

.quick-links h3 {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.quick-links-grid a {
  padding: 1rem;
  background: var(--gray-50);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  text-decoration: none;
  color: var(--primary-color);
  font-weight: 500;
  transition: all 0.2s ease;
}

.quick-links-grid a:hover {
  background: white;
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
  .main-sections-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .hero-logo {
    height: 50px;
    width: 180px;
    object-fit: contain;
  }

  .index-hero h1 {
    font-size: 2rem;
  }

  .section-box {
    padding: 2rem 1.5rem;
  }

  .section-icon {
    font-size: 3rem;
  }

  .section-box h2 {
    font-size: 1.5rem;
  }

  .quick-links-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .index-hero {
    padding: 2rem 1rem;
  }

  .hero-logo {
    height: 40px;
    width: 150px;
    object-fit: contain;
  }

  .index-hero h1 {
    font-size: 1.5rem;
  }

  .index-hero p {
    font-size: 1rem;
  }
}

/* Content Footer */
.content-footer {
  margin-top: var(--space-12);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border-color);
}

.content-actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
}

.action-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.action-link:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  text-decoration: none;
}

/* Back to Top */
.back-to-top {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 3rem;
  height: 3rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: var(--text-lg);
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-base);
  opacity: 0;
  visibility: hidden;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

/* Sidebar Footer */
.sidebar-footer {
  margin-top: var(--space-8);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-color);
}

.build-info {
  color: var(--text-muted);
  font-size: var(--text-xs);
}

/* Enhanced Containers */
.warning-container,
.note-container {
  margin: var(--space-6) 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.warning-container {
  border-left: 4px solid var(--warning-color);
  background: rgba(255, 152, 0, 0.05);
}

.note-container {
  border-left: 4px solid var(--info-color);
  background: rgba(21, 101, 192, 0.05);
}

.warning-title,
.note-title {
  background: var(--background-color);
  padding: var(--space-3) var(--space-4);
  font-weight: 600;
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--border-color);
}

.warning-title {
  color: var(--warning-color);
}

.note-title {
  color: var(--info-color);
}

.warning-content,
.note-content {
  padding: var(--space-4);
}

.warning-content p:last-child,
.note-content p:last-child {
  margin-bottom: 0;
}

/* Task Lists */
.task-list {
  list-style: none;
  padding-left: 0;
}

.task-list-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.task-list-item-checkbox {
  margin-top: 0.125rem;
  flex-shrink: 0;
}

.task-list-item-checkbox:checked + label {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Footnotes */
.footnotes {
  margin-top: var(--space-12);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-color);
  font-size: var(--text-sm);
}

.footnotes-title {
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.footnote-ref {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.footnote-ref:hover {
  text-decoration: underline;
}

.footnote-backref {
  color: var(--text-muted);
  text-decoration: none;
  margin-left: var(--space-2);
}

.footnote-backref:hover {
  color: var(--primary-color);
}

/* Mermaid Diagrams */
.mermaid-container {
  margin: var(--space-6) 0;
  padding: var(--space-4);
  background: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  text-align: center;
  overflow-x: auto;
}

.mermaid {
  max-width: 100%;
  height: auto;
}

/* Syntax Highlighting — GitHub Dark palette for dark background */
.hljs-comment,
.hljs-meta {
  color: #8b949e !important;  /* slate gray */
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-template-tag,
.hljs-type {
  color: #ff7b72 !important;  /* coral red */
}

.hljs-string,
.hljs-doctag {
  color: #a5d6ff !important;  /* sky blue */
}

.hljs-number,
.hljs-literal,
.hljs-variable,
.hljs-template-variable {
  color: #79c0ff !important;  /* blue */
}

.hljs-title,
.hljs-section,
.hljs-name {
  color: #d2a8ff !important;  /* lavender */
}

.hljs-attr,
.hljs-property {
  color: #ffa657 !important;  /* amber */
}

.hljs-built_in {
  color: #ffa657 !important;  /* amber */
}

/* ==================== Documentation Category Cards ==================== */

.categories-grid-docs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: var(--space-6);
  margin: var(--space-8) 0;
}

.category-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: var(--space-6);
  transition: all var(--transition-base);
}

.category-card:hover {
  box-shadow: 0px 8px 16px 0px hsl(0 0% 0% / 0.57);
  transform: translateY(-2px);
  border-color: var(--primary);
  background: var(--muted);
}

.category-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.category-icon {
  font-size: var(--text-3xl);
}

.category-title {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--foreground);
  margin: 0;
}

.category-description {
  color: var(--muted-foreground);
  font-size: var(--text-base);
  margin-bottom: var(--space-4);
  line-height: 1.5;
}

.category-meta {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
  color: var(--muted-foreground);
}

.category-documents {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.document-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  border-radius: 4px;
  text-decoration: none;
  color: var(--foreground);
  font-size: var(--text-sm);
  transition: all var(--transition-base);
}

.document-link:hover {
  background-color: var(--muted);
  color: var(--primary);
}

.document-title {
  flex: 1;
}

.expand-button {
  width: 100%;
  margin-top: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background-color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--primary);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
}

.expand-button:hover {
  background-color: var(--muted);
  border-color: var(--primary);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .main-content {
    margin-left: 0;
    max-width: none;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-base);
  }

  .sidebar.open {
    transform: translateX(0);
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: var(--space-4);
  }

  .hero-stats {
    gap: var(--space-4);
  }

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

  .content-actions {
    flex-direction: column;
  }

  .content-stats {
    flex-direction: column;
    gap: var(--space-2);
  }
}

@media (max-width: 480px) {
  .sidebar-content {
    padding: var(--space-4);
  }

  .main-content {
    padding: var(--space-3);
  }

  .hero-title {
    font-size: var(--text-3xl);
  }

  .hero-description {
    font-size: var(--text-lg);
  }
}

/* ==================== User Guide Custom Styles ==================== */

/* Workflow Phase Containers */
.workflow-phase {
  border-left: 4px solid var(--primary-color);
  padding: var(--space-4) var(--space-6);
  margin: var(--space-6) 0;
  background-color: var(--gray-50);
  border-radius: 4px;
}

.workflow-phase h3 {
  margin-top: 0;
}

/* Phase-Specific Colors */
.workflow-phase.phase-a { border-left-color: var(--primary-color); }      /* Setup */
.workflow-phase.phase-b { border-left-color: #4A90B8; }    /* Outreach */
.workflow-phase.phase-c { border-left-color: #27AE60; }      /* Quality */
.workflow-phase.phase-d { border-left-color: #F39C12; }      /* Assignment */
.workflow-phase.phase-e { border-left-color: #3498DB; }         /* Publishing */
.workflow-phase.phase-f { border-left-color: var(--accent-color); }       /* Communication */

/* Feature Status Badges */
.feature-status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 8px;
}

.feature-status.implemented {
  background-color: #27AE60;
  color: white;
}

.feature-status.implemented::before {
  content: '✓ ';
}

.feature-status.in-progress {
  background-color: #F39C12;
  color: white;
}

.feature-status.in-progress::before {
  content: '⏱ ';
}

.feature-status.planned {
  background-color: #3498DB;
  color: white;
}

.feature-status.planned::before {
  content: '📋 ';
}

/* Alerts & Callouts */
.alert {
  padding: var(--space-4);
  border-radius: 4px;
  margin: var(--space-6) 0;
  border-left: 4px solid;
}

.alert.info {
  background-color: rgba(52, 152, 219, 0.1);
  border-left-color: #3498DB;
  color: var(--text-primary);
}

.alert.warning {
  background-color: rgba(243, 156, 18, 0.1);
  border-left-color: #F39C12;
  color: var(--text-primary);
}

.alert.error {
  background-color: rgba(231, 76, 60, 0.1);
  border-left-color: #E74C3C;
  color: var(--text-primary);
}

.alert.success {
  background-color: rgba(39, 174, 96, 0.1);
  border-left-color: #27AE60;
  color: var(--text-primary);
}

/* Step-by-Step Instructions */
.step {
  position: relative;
  padding-left: 48px;
  margin-bottom: var(--space-6);
}

.step::before {
  content: attr(data-step);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  background-color: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* Wireframe Embeds */
.wireframe-embed {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: var(--space-6);
  margin: var(--space-6) 0;
  background-color: var(--gray-50);
}

.wireframe-embed img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: var(--shadow-md);
}

.wireframe-embed figcaption {
  margin-top: var(--space-2);
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-style: italic;
  text-align: center;
}

/* Pagination Navigation */
.content-navigation {
  margin-top: var(--space-8);
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-color);
}

.prev-page,
.next-page {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--gray-50);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.2s ease;
  max-width: 45%;
}

.prev-page:hover,
.next-page:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.prev-page .arrow,
.next-page .arrow {
  font-size: 1.25rem;
  font-weight: 700;
}

.prev-page .page-title,
.next-page .page-title {
  font-size: 0.875rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prev-page-placeholder,
.next-page-placeholder {
  flex: 1;
}

@media (max-width: 768px) {
  .pagination {
    flex-direction: column;
    gap: var(--space-3);
  }

  .prev-page,
  .next-page {
    max-width: 100%;
    width: 100%;
  }
}

/* Print Styles */
@media print {
  .sidebar,
  .toc-container,
  .content-footer,
  .back-to-top {
    display: none !important;
  }

  .main-content {
    margin-left: 0;
    padding: 0;
    max-width: none;
  }

  .document-content {
    margin-bottom: 0;
  }

  .code-block {
    background: var(--gray-400) !important;
    border: 1px solid var(--border-color);
  }

  .code-block pre,
  .code-block code {
    background: transparent !important;
    color: var(--text-primary) !important;
  }
}
