/* ============================================================
   Documentation Theme — ronilprasad8
   Neutral light/dark palette · Fixed sidebar · Clean typography
   ============================================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Light palette */
  --doc-bg: #f8f9fa;
  --doc-surface: #ffffff;
  --doc-sidebar-bg: #1e1e24;
  --doc-sidebar-text: #c8c8cc;
  --doc-sidebar-active: #ffffff;
  --doc-sidebar-active-bg: rgba(255, 255, 255, 0.08);
  --doc-sidebar-hover-bg: rgba(255, 255, 255, 0.05);
  --doc-sidebar-border: rgba(255, 255, 255, 0.06);
  --doc-text: #1a1a2e;
  --doc-text-muted: #5a5a72;
  --doc-heading: #111122;
  --doc-border: #e2e4e8;
  --doc-code-bg: #f0f1f4;
  --doc-code-text: #d63384;
  --doc-pre-bg: #1e1e24;
  --doc-pre-text: #d4d4d8;
  --doc-link: #3a6cf4;
  --doc-link-hover: #1d4ed8;
  --doc-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --doc-card-hover-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --doc-table-stripe: #f4f5f7;
  --doc-table-header-bg: #edeef1;
  --doc-table-header-text: #333348;
  --doc-sidebar-width: 260px;
  --doc-content-max: 860px;
  --doc-anchor-color: #b0b0c0;
}

/* ---------- Dark mode via prefers-color-scheme ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --doc-bg: #111117;
    --doc-surface: #1a1a22;
    --doc-text: #d4d4dc;
    --doc-text-muted: #8888a0;
    --doc-heading: #eeeef2;
    --doc-border: #2a2a36;
    --doc-code-bg: #22222e;
    --doc-code-text: #e8a0bf;
    --doc-link: #6b8cfa;
    --doc-link-hover: #93aafb;
    --doc-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --doc-card-hover-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    --doc-table-stripe: #1e1e28;
    --doc-table-header-bg: #222230;
    --doc-table-header-text: #ccccdd;
    --doc-anchor-color: #555566;
  }
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--doc-text);
  background: var(--doc-bg);
}

/* ---------- Google Fonts (loaded in HTML) ---------- */
/* We expect:  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet"> */

/* ---------- Sidebar ---------- */
.doc-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--doc-sidebar-width);
  height: 100vh;
  background: var(--doc-sidebar-bg);
  border-right: 1px solid var(--doc-sidebar-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.mobile-menu-btn {
  display: none;
}

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

.doc-sidebar-header h2 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--doc-sidebar-active);
  margin: 0;
}

.doc-sidebar-header .doc-sidebar-subtitle {
  font-size: 11px;
  color: var(--doc-sidebar-text);
  margin-top: 4px;
  opacity: 0.6;
}

.doc-sidebar-nav {
  list-style: none;
  padding: 12px 0;
  flex: 1;
}

.doc-sidebar-nav li {
  margin: 0;
}

.doc-sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 24px;
  color: var(--doc-sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 450;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
}

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

.doc-sidebar-nav a.active {
  color: var(--doc-sidebar-active);
  background: var(--doc-sidebar-active-bg);
  border-left-color: var(--doc-link);
  font-weight: 600;
}

.doc-sidebar-nav .nav-icon {
  font-size: 14px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.7;
}

.doc-sidebar-nav a.active .nav-icon {
  opacity: 1;
}

/* ---------- Main Content Area ---------- */
.doc-main {
  margin-left: var(--doc-sidebar-width);
  padding: 48px 56px 80px;
}

.doc-content {
  max-width: var(--doc-content-max);
  margin: 0 auto;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  color: var(--doc-heading);
  font-weight: 600;
  line-height: 1.3;
  margin-top: 2em;
  margin-bottom: 0.6em;
  position: relative;
}

h1 { font-size: 2rem; margin-top: 0; }
h2 { font-size: 1.5rem; padding-bottom: 0.35em; border-bottom: 1px solid var(--doc-border); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }

/* Anchor links on headings */
.heading-anchor {
  color: var(--doc-anchor-color);
  text-decoration: none;
  margin-left: 8px;
  font-size: 0.8em;
  opacity: 0;
  transition: opacity 0.15s ease;
}

h1:hover .heading-anchor,
h2:hover .heading-anchor,
h3:hover .heading-anchor,
h4:hover .heading-anchor {
  opacity: 1;
}

.heading-anchor:hover {
  color: var(--doc-link);
}

p {
  margin-bottom: 1em;
}

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

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

/* ---------- Inline code ---------- */
code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.88em;
  background: var(--doc-code-bg);
  color: var(--doc-code-text);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ---------- Code blocks ---------- */
pre {
  background: var(--doc-pre-bg);
  color: var(--doc-pre-text);
  padding: 20px 24px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.2em 0;
  font-size: 13.5px;
  line-height: 1.65;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
  border-radius: 0;
}

/* ---------- Tables ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.4em 0;
  font-size: 14px;
}

th, td {
  padding: 10px 14px;
  text-align: left;
  border: 1px solid var(--doc-border);
}

th {
  background: var(--doc-table-header-bg);
  color: var(--doc-table-header-text);
  font-weight: 600;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

/* ---------- Blockquotes ---------- */
blockquote {
  border-left: 3px solid var(--doc-border);
  padding: 12px 20px;
  margin: 1.2em 0;
  color: var(--doc-text-muted);
  background: var(--doc-table-stripe);
  border-radius: 0 6px 6px 0;
}

/* ---------- Lists ---------- */
ul, ol {
  padding-left: 1.6em;
  margin-bottom: 1em;
}

li {
  margin-bottom: 0.3em;
}

/* ---------- Horizontal rules ---------- */
hr {
  border: none;
  border-top: 1px solid var(--doc-border);
  margin: 2.5em 0;
}

/* ---------- Cards (for index page) ---------- */
.doc-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.doc-card {
  background: var(--doc-surface);
  border: 1px solid var(--doc-border);
  border-radius: 10px;
  padding: 22px 24px;
  text-decoration: none;
  color: var(--doc-text);
  box-shadow: var(--doc-card-shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.doc-card:hover {
  box-shadow: var(--doc-card-hover-shadow);
  transform: translateY(-2px);
  border-color: var(--doc-link);
  text-decoration: none;
}

.doc-card-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--doc-heading);
}

.doc-card-desc {
  font-size: 13px;
  color: var(--doc-text-muted);
  line-height: 1.55;
}

.doc-card-icon {
  font-size: 22px;
  margin-bottom: 4px;
}

/* ---------- Tech stack badges ---------- */
.tech-stack-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.tech-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--doc-text-muted);
  background: var(--doc-code-bg);
  border: 1px solid var(--doc-border);
  border-radius: 6px;
}

/* ---------- Meta info (subtitle, timestamp, etc.) ---------- */
.doc-meta {
  font-size: 13px;
  color: var(--doc-text-muted);
  margin-bottom: 1.6em;
}

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

  .doc-sidebar-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
  }

  .mobile-menu-btn {
    display: block;
    background: none;
    border: none;
    color: var(--doc-heading);
    font-size: 22px;
    cursor: pointer;
    margin-right: 12px;
    padding: 0 4px;
    line-height: 1;
  }

  .doc-sidebar-header h2 {
    display: inline-block;
  }

  .doc-sidebar-header .doc-sidebar-subtitle {
    display: inline-block;
    margin-left: 8px;
  }

  .doc-sidebar-nav {
    display: none;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    padding: 10px 16px;
    width: 100%;
  }

  .doc-sidebar.menu-open .doc-sidebar-nav {
    display: flex;
  }

  .doc-sidebar-nav li {
    margin: 0;
  }

  .doc-sidebar-nav a {
    padding: 6px 12px;
    font-size: 12px;
    border-left: none;
    border-bottom: 2px solid transparent;
  }

  .doc-sidebar-nav a.active {
    border-left: none;
    border-bottom-color: var(--doc-link);
  }

  .doc-sidebar-nav .nav-icon {
    display: none;
  }

  .doc-main {
    margin-left: 0;
    padding: 24px 16px 60px;
  }

  .doc-card-grid {
    grid-template-columns: 1fr;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
