/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #667eea;
  --secondary-color: #764ba2;
  --text-color: #333;
  --text-light: #666;
  --border-color: #e0e0e0;
  --bg-light: #f8f9fa;
  --sidebar-width: 280px;
  --header-height: 60px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background: var(--bg-light);
}

.wrapper {
  display: flex;
  min-height: 100vh;
}

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

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
}

.sidebar-header h1 {
  font-size: 1.5rem;
  margin: 0;
}

.sidebar-header a {
  color: white;
  text-decoration: none;
  font-weight: 600;
}

.sidebar-nav {
  padding: 1rem 0;
}

.sidebar-nav ul {
  list-style: none;
}

.sidebar-nav > ul > li {
  margin: 0;
}

.sidebar-nav a {
  display: block;
  padding: 0.75rem 1.5rem;
  color: var(--text-color);
  text-decoration: none;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
  background: var(--bg-light);
  color: var(--primary-color);
}

.sidebar-nav a.active {
  background: rgba(102, 126, 234, 0.1);
  color: var(--primary-color);
  border-left-color: var(--primary-color);
  font-weight: 600;
}

.nav-section {
  margin-top: 1rem;
}

.nav-section-title {
  display: block;
  padding: 0.5rem 1.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
}

.nav-subsection {
  margin-top: 0.5rem;
}

.nav-subsection li a {
  padding-left: 2.5rem;
  font-size: 0.9rem;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.content-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
  background: white;
  min-height: 100vh;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-weight: 600;
  line-height: 1.2;
}

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

h2 {
  font-size: 2rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--text-color);
}

h3 {
  font-size: 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--text-color);
}

h4 {
  font-size: 1.25rem;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
}

ul,
ol {
  margin-bottom: 1rem;
  padding-left: 2rem;
}

li {
  margin-bottom: 0.5rem;
}

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

a:hover {
  text-decoration: underline;
}

/* Code Blocks */
pre {
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}

code {
  background: var(--bg-light);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9em;
  font-family: "Monaco", "Courier New", monospace;
}

pre code {
  background: none;
  padding: 0;
}

/* Blockquotes */
blockquote {
  border-left: 4px solid var(--primary-color);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--text-light);
  font-style: italic;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

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

th {
  background: var(--bg-light);
  font-weight: 600;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1001;
  background: white;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  padding: 0.5rem;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
}

.mobile-menu-toggle span {
  width: 24px;
  height: 3px;
  background: var(--text-color);
  border-radius: 2px;
  transition: all 0.3s;
}

.mobile-menu-toggle:hover {
  background: var(--bg-light);
}

/* Responsive */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
  }

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

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

  .content-wrapper {
    padding: 1rem;
    margin-top: 3rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .hero {
    padding: 2rem 1rem;
  }

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

/* Search Styles */
.search-container {
  position: relative;
  margin-bottom: 2rem;
}

.search-box {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  transition: border-color 0.2s;
}

.search-box:focus {
  outline: none;
  border-color: var(--primary-color);
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-top: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
  display: none;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.search-results.show {
  display: block;
}

.search-result-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.2s;
}

.search-result-item:hover {
  background: var(--bg-light);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-title {
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 0.25rem;
}

.search-result-snippet {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* Home Page Styles */
.hero {
  text-align: center;
  padding: 3rem 1rem;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  color: white;
  border-radius: 8px;
  margin-bottom: 2rem;
}

.hero h1 {
  margin: 0 0 1rem 0;
  font-size: 2.5rem;
  border: none;
  padding: 0;
  color: white;
}

.hero-description {
  font-size: 1.2rem;
  opacity: 0.9;
  margin: 0;
}

.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.docs-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s, box-shadow 0.2s;
}

.docs-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.docs-card h3 {
  margin-top: 0;
  color: var(--primary-color);
}

.docs-card ul {
  list-style: none;
  padding: 0;
}

.docs-card li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.docs-card li:last-child {
  border-bottom: none;
}

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

.docs-card a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

/* Markdown Content Styles */
.markdown-content {
  line-height: 1.8;
}

.markdown-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1rem 0;
}

.markdown-content hr {
  border: none;
  border-top: 2px solid var(--border-color);
  margin: 2rem 0;
}

.markdown-content mark {
  background: #fff3cd;
  padding: 0.1rem 0.2rem;
  border-radius: 2px;
}
