/* Miggy Draw Documentation Styles */

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

.docs-sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--bg-card);
  border-right: 1px solid var(--border-subtle);
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 1.5rem 0;
}

.docs-content {
  flex: 1;
  min-width: 0;
  padding: 2rem 3rem;
  max-width: 900px;
}

.docs-toc {
  width: 200px;
  min-width: 200px;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 1.5rem 1rem;
  border-left: 1px solid var(--border-subtle);
}

/* Sidebar Navigation */
.docs-nav {
  display: flex;
  flex-direction: column;
  padding: 0 1rem;
}

.docs-nav-section {
  margin-bottom: 1.5rem;
  width: 100%;
}

.docs-nav-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  color: var(--amiga-white);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
}

.docs-nav-title:hover {
  background: var(--bg-elevated);
}

.docs-nav-title svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
  opacity: 0.5;
}

.docs-nav-section.expanded .docs-nav-title svg {
  transform: rotate(90deg);
}

.docs-nav-items {
  display: none;
  padding-left: 0.75rem;
  margin-top: 0.25rem;
}

.docs-nav-section.expanded .docs-nav-items {
  display: block;
}

.docs-nav-link {
  display: block;
  padding: 0.4rem 0.75rem;
  color: var(--amiga-gray);
  text-decoration: none;
  font-size: 0.9rem;
  border-left: 2px solid transparent;
  transition: all 0.15s;
  border-radius: 0 4px 4px 0;
}

.docs-nav-link:hover {
  color: var(--amiga-white);
  background: var(--bg-elevated);
}

.docs-nav-link.active {
  color: var(--amiga-orange);
  border-left-color: var(--amiga-orange);
  background: var(--glow-orange);
}

/* Table of Contents (Right) */
.docs-toc-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--amiga-gray);
  margin-bottom: 1rem;
}

.docs-toc-list {
  list-style: none;
}

.docs-toc-item {
  margin-bottom: 0.5rem;
}

.docs-toc-link {
  display: block;
  padding: 0.25rem 0;
  color: var(--amiga-gray);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.15s;
  border-left: 2px solid transparent;
  padding-left: 0.75rem;
  margin-left: -0.75rem;
}

.docs-toc-link:hover {
  color: var(--amiga-white);
}

.docs-toc-link.active {
  color: var(--amiga-orange);
  border-left-color: var(--amiga-orange);
}

.docs-toc-link.depth-3 {
  padding-left: 1.5rem;
  font-size: 0.8rem;
}

/* Content Styles */
.docs-content h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--amiga-white), var(--amiga-gray));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.docs-content .subtitle {
  font-size: 1.1rem;
  color: var(--amiga-gray);
  margin-bottom: 2rem;
}

.docs-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  scroll-margin-top: 80px;
}

.docs-content h2:first-of-type {
  margin-top: 0;
}

.docs-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--amiga-white);
  scroll-margin-top: 80px;
}

.docs-content h2 .anchor,
.docs-content h3 .anchor {
  color: var(--amiga-gray);
  text-decoration: none;
  margin-left: 0.5rem;
  opacity: 0;
  transition: opacity 0.15s;
}

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

.docs-content p {
  margin-bottom: 1rem;
  color: var(--amiga-light-gray);
  line-height: 1.8;
}

.docs-content ul,
.docs-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
  color: var(--amiga-light-gray);
}

.docs-content li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

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

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

/* Code Blocks */
.docs-content code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9em;
  background: var(--bg-elevated);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  color: var(--amiga-orange);
}

.docs-content pre {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.docs-content pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--amiga-light-gray);
}

/* Syntax Highlighting */
.docs-content pre .comment { color: var(--amiga-gray); }
.docs-content pre .keyword { color: #ff79c6; }
.docs-content pre .string { color: #f1fa8c; }
.docs-content pre .number { color: #bd93f9; }
.docs-content pre .type { color: #8be9fd; }
.docs-content pre .function { color: #50fa7b; }

/* Callout Boxes */
.callout {
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  border-left: 4px solid;
}

.callout-tip {
  background: rgba(80, 250, 123, 0.1);
  border-color: #50fa7b;
}

.callout-warning {
  background: rgba(255, 184, 108, 0.1);
  border-color: #ffb86c;
}

.callout-note {
  background: rgba(139, 233, 253, 0.1);
  border-color: #8be9fd;
}

.callout-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.callout-tip .callout-title { color: #50fa7b; }
.callout-warning .callout-title { color: #ffb86c; }
.callout-note .callout-title { color: #8be9fd; }

.callout p:last-child {
  margin-bottom: 0;
}

/* Tables */
.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.docs-content th,
.docs-content td {
  padding: 0.75rem 1rem;
  text-align: left;
  border: 1px solid var(--border-subtle);
}

.docs-content th {
  background: var(--bg-elevated);
  font-weight: 600;
  color: var(--amiga-white);
}

.docs-content td {
  color: var(--amiga-light-gray);
}

.docs-content tr:hover td {
  background: var(--bg-card);
}

/* Keyboard Shortcuts */
kbd {
  display: inline-block;
  padding: 0.2em 0.5em;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  box-shadow: 0 2px 0 var(--border-subtle);
}

/* Feature Grid */
.feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.feature-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1rem;
}

.feature-item h4 {
  color: var(--amiga-orange);
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.feature-item p {
  margin-bottom: 0;
  font-size: 0.9rem;
}

/* Mobile Hamburger */
.docs-mobile-toggle {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  width: 48px;
  height: 48px;
  background: var(--amiga-orange);
  border: none;
  border-radius: 50%;
  color: var(--amiga-white);
  cursor: pointer;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.docs-mobile-toggle svg {
  width: 24px;
  height: 24px;
}

/* Responsive */
@media (max-width: 1100px) {
  .docs-toc {
    display: none;
  }
}

@media (max-width: 900px) {
  .docs-sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    height: 100vh;
    z-index: 150;
    transition: left 0.3s ease;
    padding-top: 80px;
  }

  .docs-sidebar.open {
    left: 0;
  }

  .docs-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 140;
  }

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

  .docs-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .docs-content {
    padding: 1.5rem;
  }

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