/* SPDX-License-Identifier: MPL-2.0 OR MIT */
/* AffineScript Documentation Styles */

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f5;
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --accent: #0066cc;
  --accent-hover: #0052a3;
  --border: #e0e0e0;
  --code-bg: #f0f0f0;
  --sidebar-width: 280px;
}

.theme-dark {
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --text-primary: #e0e0e0;
  --text-secondary: #a0a0a0;
  --accent: #4da6ff;
  --accent-hover: #80bfff;
  --border: #404040;
  --code-bg: #2d2d2d;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
}

/* Sidebar */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 1rem;
}

.search input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

/* Main content */
main {
  margin-left: var(--sidebar-width);
  padding: 2rem;
  max-width: 900px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

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

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Code */
code {
  font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, monospace;
  font-size: 0.9em;
  background-color: var(--code-bg);
  padding: 0.2em 0.4em;
  border-radius: 3px;
}

pre {
  background-color: var(--code-bg);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1rem 0;
}

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

.signature {
  background-color: var(--code-bg);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  border-left: 3px solid var(--accent);
  margin: 0.5rem 0 1rem 0;
}

/* Items */
.item {
  margin: 2rem 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.item-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.kind {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  background-color: var(--bg-secondary);
  padding: 0.2em 0.5em;
  border-radius: 3px;
}

.name {
  font-size: 1.25rem;
  font-weight: 600;
}

.item-doc {
  margin-top: 1rem;
}

/* Quantities */
.quantity-erased { color: #888; }
.quantity-linear { color: #d32f2f; font-weight: bold; }
.quantity-unrestricted { color: #388e3c; }

/* Effects */
.effects {
  color: #7b1fa2;
}

.effect {
  color: #7b1fa2;
}

/* Badges */
.badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.2em 0.5em;
  border-radius: 3px;
  margin-left: 0.5rem;
}

.stability-stable { background-color: #c8e6c9; color: #2e7d32; }
.stability-unstable { background-color: #fff9c4; color: #f9a825; }
.stability-experimental { background-color: #ffccbc; color: #e64a19; }
.stability-deprecated { background-color: #ffcdd2; color: #c62828; }

/* Deprecated */
.deprecated {
  background-color: #fff3e0;
  border: 1px solid #ff9800;
  border-radius: 4px;
  padding: 0.75rem;
  margin: 0.5rem 0;
}

/* Module list */
.module-list {
  list-style: none;
}

.module-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

/* Examples */
.example {
  margin: 1rem 0;
  padding: 1rem;
  background-color: var(--bg-secondary);
  border-radius: 6px;
}

.example h4 {
  margin-top: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  main {
    margin-left: 0;
  }
}
