/* 
 * Axiom Documentation Styles
 * Modern, clean design with focus on readability and dark mode
 */

:root {
  /* Light theme variables */
  --bg-color: #ffffff;
  --bg-secondary: #f9f9fb;
  --text-color: #333333;
  --text-secondary: #666666;
  --heading-color: #1a1a1a;
  --link-color: #0066cc;
  --link-hover-color: #004499;
  --border-color: #e0e0e0;
  --border-color-rgb: 224, 224, 224;
  --header-bg: #ffffff;
  --header-border: #eeeeee;
  --header-shadow: rgba(0, 0, 0, 0.05);
  --toc-bg: #f9f9fb;
  --toc-active: #e6f0ff;
  --toc-border: #e0e0e0;
  --toc-heading: #444444;
  --code-bg: #f5f7f9;
  --code-border: #e6eaee;
  --code-color: #333333;
  --code-line-highlight: #fff8c5;
  --pre-bg: #f5f7f9;
  --pre-color: #333333;
  --button-bg: #f5f7f9;
  --button-hover: #e6eaee;
  --button-text: #333333;
  --button-border: #e0e0e0;
  --table-border: #e6eaee;
  --table-header-bg: #f5f7f9;
  --table-stripe: #f9f9fb;
  --scrollbar-track: #f1f1f1;
  --scrollbar-thumb: #c1c1c1;
  --scrollbar-thumb-hover: #a1a1a1;
  --selection-bg: #b3d4ff;
  --selection-text: #000000;
  --primary-color: #0066cc;
  --primary-color-rgb: 0, 102, 204;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.dark-mode {
  /* Dark theme variables */
  --bg-color: #121212;
  --bg-secondary: #1e1e1e;
  --text-color: #e0e0e0;
  --text-secondary: #a0a0a0;
  --heading-color: #ffffff;
  --link-color: #6ca9f2;
  --link-hover-color: #a1c6f7;
  --border-color: #2a2a2a;
  --border-color-rgb: 42, 42, 42;
  --header-bg: #1a1a1a;
  --header-border: #2a2a2a;
  --header-shadow: rgba(0, 0, 0, 0.3);
  --toc-bg: #1a1a1a;
  --toc-active: #2c3951;
  --toc-border: #2a2a2a;
  --toc-heading: #dddddd;
  --code-bg: #2a2a2a;
  --code-border: #3a3a3a;
  --code-color: #e0e0e0;
  --code-line-highlight: #3a3d2c;
  --pre-bg: #2a2a2a;
  --pre-color: #e0e0e0;
  --button-bg: #2a2a2a;
  --button-hover: #3a3a3a;
  --button-text: #e0e0e0;
  --button-border: #3a3a3a;
  --table-border: #3a3a3a;
  --table-header-bg: #2a2a2a;
  --table-stripe: #232323;
  --scrollbar-track: #1e1e1e;
  --scrollbar-thumb: #3a3a3a;
  --scrollbar-thumb-hover: #4a4a4a;
  --selection-bg: #355f8c;
  --selection-text: #ffffff;
  --primary-color: #6ca9f2;
  --primary-color-rgb: 108, 169, 242;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Base element styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  padding-top: 80px;
  transition: color 0.3s ease, background-color 0.3s ease;
}

::selection {
  background-color: var(--selection-bg);
  color: var(--selection-text);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

/* Layout structure */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  z-index: 100;
  background-color: var(--header-bg);
  box-shadow: 0 1px 2px var(--header-shadow);
  border-bottom: 1px solid var(--header-border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.header-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--heading-color);
  margin: 0;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-toggle {
  background-color: var(--button-bg);
  border: 1px solid var(--button-border);
  border-radius: 4px;
  padding: 0.5rem 0.6rem;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  transition: background-color 0.2s ease;
}

.theme-toggle:hover {
  background-color: var(--button-hover);
}

.main-container {
  display: flex;
  flex-direction: column;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
}

.content-wrapper {
  display: flex;
  gap: 2rem;
  position: relative;
}

.left-toc-container {
  width: 250px;
  position: sticky;
  top: 100px;
  height: calc(100vh - 120px);
  overflow-y: auto;
  background-color: var(--toc-bg);
  border-radius: 6px;
  border: 1px solid var(--toc-border);
  padding: 1.25rem 1rem;
  transition: background-color 0.3s ease;
}

main.content {
  flex: 1;
  min-width: 0;
  padding: 1rem 0;
}

/* TOC Styling */
.left-toc h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--toc-heading);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.left-toc .section-heading {
  font-weight: 600;
  color: var(--heading-color);
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.left-toc ul {
  list-style-type: none;
  margin-bottom: 1rem;
}

.left-toc ul li {
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
}

.left-toc ul li a {
  color: var(--text-color);
  text-decoration: none;
  display: block;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.left-toc ul li a:hover {
  background-color: var(--toc-active);
  color: var(--link-color);
}

.left-toc li.subcategory {
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.left-toc ul.subcategory-list {
  padding-left: 0.5rem;
  margin-bottom: 0.5rem;
  border-left: 2px solid var(--border-color);
}

/* Content styling */
.content-section {
  margin-bottom: 2.5rem;
}

.category-section,
.subcategory-section {
  margin-bottom: 3rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--heading-color);
  margin-top: 1.5em;
  margin-bottom: 0.75em;
  line-height: 1.3;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-top: 0;
}

h2 {
  font-size: 1.6rem;
  font-weight: 600;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

h3 {
  font-size: 1.3rem;
  font-weight: 600;
}

h4 {
  font-size: 1.15rem;
  font-weight: 600;
}

h5, h6 {
  font-size: 1rem;
  font-weight: 600;
}

p {
  margin-bottom: 1.25rem;
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* Anchor links */
:target {
  scroll-margin-top: 95px;
}

.section-anchor {
  opacity: 0;
  font-size: 0.8em;
  margin-left: 0.4em;
  transition: opacity 0.2s ease;
}

h2:hover .section-anchor,
h3:hover .section-anchor,
h4:hover .section-anchor {
  opacity: 0.7;
}

/* Code styling */
code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.9em;
  padding: 0.2em 0.4em;
  border-radius: 3px;
  background-color: var(--code-bg);
  color: var(--code-color);
}

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

pre code {
  padding: 0;
  background-color: transparent;
  color: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre;
}

/* Table styling */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  border: 1px solid var(--table-border);
  font-size: 0.9rem;
}

th, td {
  padding: 0.75rem;
  border: 1px solid var(--table-border);
}

th {
  font-weight: 600;
  background-color: var(--table-header-bg);
  text-align: left;
}

tbody tr:nth-child(odd) {
  background-color: var(--bg-color);
}

tbody tr:nth-child(even) {
  background-color: var(--table-stripe);
}

/* Lists */
ul, ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

li {
  margin-bottom: 0.3rem;
}

/* Blockquotes */
blockquote {
  border-left: 4px solid var(--primary-color);
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin: 1.5rem 0;
  background-color: var(--bg-secondary);
  border-radius: 0 6px 6px 0;
}

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

/* Images */
img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1.5rem 0;
}

/* Responsive design */
@media (max-width: 1100px) {
  .main-container {
    padding: 1rem;
  }
}

@media (max-width: 900px) {
  .content-wrapper {
    flex-direction: column;
  }
  
  .left-toc-container {
    width: 100%;
    position: relative;
    top: 0;
    height: auto;
    max-height: 300px;
    margin-bottom: 1.5rem;
  }
  
  main.content {
    width: 100%;
  }
}

@media (max-width: 600px) {
  html {
    font-size: 15px;
  }
  
  body {
    padding-top: 70px;
  }
  
  header {
    height: 70px;
    padding: 0 1rem;
  }
  
  .header-title {
    font-size: 1.1rem;
  }
  
  .main-container {
    padding: 0.75rem;
  }
  
  h1 {
    font-size: 1.8rem;
  }
  
  h2 {
    font-size: 1.4rem;
  }
  
  h3 {
    font-size: 1.2rem;
  }
}
