/* GitBook-style CSS */
:root {
  --primary-color: #1976d2;
  --secondary-color: #42a5f5;
  --text-color: #333;
  --text-muted: #666;
  --border-color: #e0e0e0;
  --sidebar-bg: #fafafa;
  --sidebar-width: 300px;
  --content-max-width: 800px;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  --code-font: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier,
    monospace;
  --line-height: 1.6;
}

/* Reset and base styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  font-size: 16px;
  line-height: var(--line-height);
  color: var(--text-color);
  background-color: #fff;
}

/* Layout */
.gitbook-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  position: fixed;
  height: 100vh;
  z-index: 100;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--text-color);
}

.sidebar-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin: 5px 0 0 0;
}

/* Navigation */
.nav-menu {
  padding: 0;
  margin: 0;
  list-style: none;
}

.nav-item {
  border-bottom: 1px solid var(--border-color);
}

.nav-link {
  display: block;
  padding: 12px 20px;
  color: var(--text-color);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background-color: #f0f0f0;
  color: var(--primary-color);
}

.nav-link.active {
  background-color: var(--primary-color);
  color: white;
  font-weight: 500;
}

/* Nested navigation */
.nav-section {
  margin: 0;
}

.nav-section-title {
  padding: 16px 20px 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin: 0;
}

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

.nav-subsection .nav-link {
  padding-left: 40px;
  font-size: 13px;
}

/* Main content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  background-color: #fff;
}

.content-wrapper {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 40px;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 16px 0;
  font-weight: 600;
  line-height: 1.4;
}

h1 {
  font-size: 32px;
  color: var(--text-color);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 12px;
  margin-bottom: 32px;
}

h2 {
  font-size: 24px;
  margin-top: 32px;
  margin-bottom: 16px;
}

h3 {
  font-size: 20px;
  margin-top: 24px;
  margin-bottom: 12px;
}

h4 {
  font-size: 18px;
  margin-top: 20px;
  margin-bottom: 10px;
}

p {
  margin: 0 0 16px 0;
  color: var(--text-color);
}

/* Links */
a {
  color: var(--primary-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Lists */
ul,
ol {
  margin: 0 0 16px 0;
  padding-left: 24px;
}

li {
  margin: 4px 0;
}

/* Code blocks */
code {
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  padding: 2px 6px;
  font-family: var(--code-font);
  font-size: 14px;
  color: #e83e8c;
}

pre {
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 16px;
  margin: 16px 0;
  overflow-x: auto;
  font-family: var(--code-font);
  font-size: 14px;
  line-height: 1.5;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
}

/* Syntax highlighting */
.hljs {
  background: #f8f9fa !important;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-built_in {
  color: #d73a49;
}

.hljs-string,
.hljs-attr {
  color: #032f62;
}

.hljs-comment {
  color: #6a737d;
  font-style: italic;
}

.hljs-number {
  color: #005cc5;
}

.hljs-function {
  color: #6f42c1;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  border: 1px solid var(--border-color);
}

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

th {
  background-color: #f8f9fa;
  font-weight: 600;
  border-bottom: 2px solid var(--border-color);
}

tr:nth-child(even) {
  background-color: #f8f9fa;
}

/* Blockquotes */
blockquote {
  margin: 16px 0;
  padding: 16px 20px;
  background-color: #f8f9fa;
  border-left: 4px solid var(--primary-color);
  color: var(--text-muted);
  font-style: italic;
}

/* Badges and callouts */
.badge {
  display: inline-block;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
  background-color: var(--primary-color);
  color: white;
}

.callout {
  margin: 16px 0;
  padding: 16px;
  border-radius: 6px;
  border-left: 4px solid;
}

.callout-info {
  background-color: #e3f2fd;
  border-left-color: #2196f3;
}

.callout-warning {
  background-color: #fff3e0;
  border-left-color: #ff9800;
}

.callout-error {
  background-color: #ffebee;
  border-left-color: #f44336;
}

.callout-success {
  background-color: #e8f5e8;
  border-left-color: #4caf50;
}

/* Search */
.search-container {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.search-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 14px;
  background-color: white;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

/* Navigation arrows */
.page-navigation {
  display: flex;
  justify-content: space-between;
  margin: 48px 0 24px;
  padding: 24px 0;
  border-top: 1px solid var(--border-color);
}

.nav-prev,
.nav-next {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background-color: #f8f9fa;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-color);
  transition: all 0.2s ease;
  min-width: 120px;
}

.nav-prev:hover,
.nav-next:hover {
  background-color: var(--primary-color);
  color: white;
  text-decoration: none;
}

.nav-prev::before {
  content: "←";
  margin-right: 8px;
}

.nav-next::after {
  content: "→";
  margin-left: 8px;
}

/* Responsive design */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 280px;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

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

  .main-content {
    margin-left: 0;
  }

  .content-wrapper {
    padding: 20px;
  }

  .mobile-toggle {
    display: block;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 200;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
  }
}

@media (min-width: 769px) {
  .mobile-toggle {
    display: none;
  }
}

/* Scrollbar styling */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Print styles */
@media print {
  .sidebar {
    display: none;
  }

  .main-content {
    margin-left: 0;
  }

  .page-navigation {
    display: none;
  }
}

/* Utility classes */
.text-center {
  text-align: center;
}

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

.mb-0 {
  margin-bottom: 0;
}

.mt-4 {
  margin-top: 24px;
}

.hidden {
  display: none;
}

/* Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.content-wrapper {
  animation: fadeIn 0.3s ease;
}
