/* ================================================================
   VodiSoft Documentation CSS
   Dark-first design — matches main site theme
   ================================================================ */

/* 1. DESIGN TOKENS
   ================================================================ */
:root {
  --primary:         #5B6EF8;
  --primary-dark:    #4455E8;
  --primary-light:   #7B8EFA;
  --secondary:       #8B5CF6;
  --accent:          #06D6A0;
  --cyan:            #22D3EE;

  --bg-base:         #07101F;
  --bg-surface:      #0C1628;
  --bg-elevated:     #101E34;
  --bg-card:         rgba(255, 255, 255, 0.04);
  --bg-card-hover:   rgba(255, 255, 255, 0.07);

  --text-primary:    #E2E8F0;
  --text-secondary:  #94A3B8;
  --text-muted:      #64748B;

  --border:          rgba(255, 255, 255, 0.08);
  --border-accent:   rgba(91, 110, 248, 0.5);

  --grad-primary:    linear-gradient(135deg, #5B6EF8 0%, #8B5CF6 100%);
  --grad-accent:     linear-gradient(135deg, #5B6EF8 0%, #06D6A0 100%);

  --shadow-sm:       0 2px 8px  rgba(0, 0, 0, 0.35);
  --shadow-md:       0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg:       0 16px 48px rgba(0, 0, 0, 0.55);
  --shadow-glow:     0 0 40px   rgba(91, 110, 248, 0.18);

  --radius:          12px;
  --radius-lg:       18px;
  --radius-full:     9999px;

  --ease:            cubic-bezier(0.4, 0, 0.2, 1);
  --transition:      all 0.3s var(--ease);

  --font-sans:       'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:       'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;

  --sidebar-width:   272px;
  --navbar-height:   64px;
  --content-max:     800px;
}

/* 2. BASE
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--navbar-height) + 28px);
}

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* Bootstrap dark overrides */
.dropdown-menu {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  min-width: 130px;
}
.dropdown-item {
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.dropdown-item:hover, .dropdown-item:focus {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}
.dropdown-toggle::after { border-color: var(--text-muted) transparent transparent; }

/* 3. DOCS NAVBAR
   ================================================================ */
.docs-navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--navbar-height);
  background: rgba(7, 16, 31, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 0.75rem;
}

.docs-navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  flex-shrink: 0;
}
.docs-navbar-brand img {
  width: 30px; height: 30px;
  object-fit: contain;
  border-radius: 7px;
}
.docs-navbar-brand .brand-name {
  font-size: 1.1rem;
  font-weight: 800;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.03em;
}

.docs-badge {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  background: rgba(91, 110, 248, 0.18);
  color: var(--primary-light);
  border: 1px solid rgba(91, 110, 248, 0.28);
  flex-shrink: 0;
}

.docs-navbar-divider {
  width: 1px; height: 22px;
  background: var(--border);
  flex-shrink: 0;
}

.docs-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.docs-breadcrumb a { color: var(--text-secondary); }
.docs-breadcrumb a:hover { color: var(--primary-light); }
.docs-breadcrumb .bc-sep { color: var(--text-muted); font-size: 0.7rem; }
.docs-breadcrumb .bc-current {
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.docs-navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: var(--transition);
}
.lang-btn:hover {
  border-color: var(--border-accent);
  color: var(--text-primary);
  background: var(--bg-card);
}

.btn-site {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.9rem;
  border-radius: var(--radius-full);
  background: var(--grad-primary);
  color: #fff !important;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-sans);
  transition: var(--transition);
  white-space: nowrap;
  border: none;
  text-decoration: none;
}
.btn-site:hover { opacity: 0.86; transform: translateY(-1px); }

.docs-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}
.docs-menu-toggle:hover { background: var(--bg-card); color: var(--text-primary); }

/* 4. INDEX — HERO
   ================================================================ */
.docs-hero {
  padding: calc(var(--navbar-height) + 70px) 0 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.docs-hero::before {
  content: '';
  position: absolute;
  width: 800px; height: 800px;
  background: radial-gradient(ellipse, rgba(91, 110, 248, 0.1) 0%, transparent 68%);
  top: -250px; left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}
.docs-hero::after {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(ellipse, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
  bottom: -150px; right: -100px;
  pointer-events: none;
}

.docs-hero-logo {
  width: 88px; height: 88px;
  object-fit: contain;
  border-radius: 22px;
  margin-bottom: 1.5rem;
  box-shadow: 0 0 0 1px var(--border), var(--shadow-glow);
  position: relative; z-index: 1;
}
.docs-hero-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  margin-bottom: 1rem;
  position: relative; z-index: 1;
}
.docs-hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto 2.25rem;
  line-height: 1.78;
  position: relative; z-index: 1;
}

.docs-search {
  max-width: 500px;
  margin: 0 auto 1.75rem;
  position: relative;
  z-index: 1;
}
.docs-search-input {
  width: 100%;
  padding: 0.85rem 1.1rem 0.85rem 2.9rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}
.docs-search-input::placeholder { color: var(--text-muted); }
.docs-search-input:focus { border-color: var(--border-accent); box-shadow: 0 0 0 3px rgba(91,110,248,0.14); }
.docs-search-icon {
  position: absolute;
  left: 1rem; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 0.85rem;
}

.docs-hero-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  position: relative; z-index: 1;
}

/* 5. LIBRARY CARDS
   ================================================================ */
.docs-cards-section { padding: 0 0 90px; }

.docs-section-label {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}
.docs-section-label::before,
.docs-section-label::after {
  content: '';
  width: 36px; height: 1px;
  background: var(--primary);
  opacity: 0.45;
}

.docs-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.25rem;
}

.doc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.doc-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: var(--grad-primary);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.doc-card:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  color: inherit;
}
.doc-card:hover::after { opacity: 0.04; }

.doc-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.doc-card-icon {
  width: 50px; height: 50px;
  border-radius: 13px;
  object-fit: contain;
  flex-shrink: 0;
  background: var(--bg-elevated);
  padding: 6px;
  border: 1px solid var(--border);
}
.doc-card-icon-placeholder {
  width: 50px; height: 50px;
  border-radius: 13px;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.3rem;
  color: #fff;
}
.doc-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}
.doc-card-summary {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.65;
  flex: 1;
  margin: 0;
}
.doc-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}
.doc-card-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary-light);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}
.doc-card:hover .doc-card-link { gap: 0.65rem; }

.nuget-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(34, 211, 238, 0.1);
  color: var(--cyan);
  font-size: 0.7rem;
  font-weight: 600;
  border: 1px solid rgba(34, 211, 238, 0.18);
  text-decoration: none;
  transition: var(--transition);
}
.nuget-badge:hover { background: rgba(34, 211, 238, 0.18); color: var(--cyan); }

/* 6. DETAILS PAGE LAYOUT
   ================================================================ */
.docs-page {
  padding-top: var(--navbar-height);
  min-height: 100vh;
  display: flex;
}

/* Sidebar */
.docs-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: fixed;
  top: var(--navbar-height);
  left: 0; bottom: 0;
  overflow-y: auto;
  padding: 2rem 1rem 3rem;
  border-right: 1px solid var(--border);
  background: var(--bg-surface);
  z-index: 100;
  transition: transform 0.3s var(--ease);
}
.docs-sidebar::-webkit-scrollbar { width: 3px; }
.docs-sidebar::-webkit-scrollbar-track { background: transparent; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.sidebar-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  padding: 0 0.5rem;
}
.sidebar-nav { list-style: none; padding: 0; margin: 0; }
.sidebar-nav li { margin-bottom: 1px; }
.sidebar-nav a {
  display: block;
  padding: 0.42rem 0.75rem;
  border-radius: 8px;
  font-size: 0.855rem;
  color: var(--text-secondary);
  transition: var(--transition);
  border-left: 2px solid transparent;
  line-height: 1.4;
}
.sidebar-nav a:hover { background: var(--bg-card); color: var(--text-primary); }
.sidebar-nav a.active {
  background: rgba(91, 110, 248, 0.12);
  color: var(--primary-light);
  border-left-color: var(--primary);
  font-weight: 600;
}

/* Main content */
.docs-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
  padding: 3rem 3.5rem 6rem;
}
.docs-content { max-width: var(--content-max); margin: 0 auto; }

.docs-doc-header {
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}
.docs-doc-title {
  font-size: clamp(1.75rem, 2.8vw, 2.4rem);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.04em;
  margin-bottom: 0.875rem;
  line-height: 1.15;
}
.docs-doc-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.docs-doc-meta i { color: var(--primary-light); margin-right: 0.25rem; }

/* 7. MARKDOWN RENDERER
   ================================================================ */
.markdown-docs {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.85;
}

.markdown-docs .doc-section {
  margin-bottom: 4.5rem;
  scroll-margin-top: calc(var(--navbar-height) + 28px);
}
.markdown-docs .section-title {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
  line-height: 1.25;
}
.markdown-docs .section-block h3 {
  font-size: 1.2rem; font-weight: 700;
  color: var(--text-primary);
  margin: 2rem 0 0.75rem;
  letter-spacing: -0.02em;
}
.markdown-docs .section-block h4 {
  font-size: 1.05rem; font-weight: 600;
  color: var(--text-primary);
  margin: 1.5rem 0 0.5rem;
}
.markdown-docs .section-block h5,
.markdown-docs .section-block h6 {
  font-size: 0.95rem; font-weight: 600;
  color: var(--text-primary);
  margin: 1.25rem 0 0.4rem;
}

.markdown-docs p { margin-bottom: 1.25rem; }

.markdown-docs a { color: var(--primary-light); text-decoration: underline; text-underline-offset: 3px; }
.markdown-docs a:hover { color: var(--primary); }

.markdown-docs strong { color: var(--text-primary); font-weight: 700; }
.markdown-docs em { font-style: italic; }

/* Inline code */
.markdown-docs :not(pre) > code {
  background: rgba(91, 110, 248, 0.15);
  color: var(--primary-light);
  padding: 0.15em 0.45em;
  border-radius: 5px;
  font-size: 0.875em;
  font-family: var(--font-mono);
}

/* Code blocks — force dark theme regardless of hljs stylesheet load status */
.markdown-docs pre {
  background: #1a1f2e !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: var(--radius) !important;
  padding: 3rem 1.5rem 1.25rem !important; /* top room for copy button */
  overflow-x: auto !important;
  position: relative !important;
  margin: 1.5rem 0 !important;
}
.markdown-docs pre code,
.markdown-docs pre .hljs {
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
  font-size: 0.875rem !important;
  font-family: var(--font-mono) !important;
  line-height: 1.7 !important;
}
/* When hljs dark theme DOES load, let its text colors shine through */
.markdown-docs pre code:not(.hljs) {
  color: #e2e8f0;
}

/* Copy button — anchored to top-right of pre, never overlaps code */
.code-copy-btn {
  position: absolute;
  top: 0.65rem; right: 0.75rem;
  padding: 0.25rem 0.65rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  z-index: 2;
  white-space: nowrap;
  user-select: none;
}
.code-copy-btn:hover { background: rgba(255,255,255,0.14); color: var(--text-primary); }
.code-copy-btn.copied { color: var(--accent); border-color: rgba(6, 214, 160, 0.35); }

/* Blockquote */
.markdown-docs blockquote {
  border-left: 3px solid var(--primary);
  background: rgba(91, 110, 248, 0.07);
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.markdown-docs blockquote p:last-child { margin-bottom: 0; }

/* Lists */
.markdown-docs ul, .markdown-docs ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}
.markdown-docs li { margin-bottom: 0.4rem; }

/* Table */
.markdown-docs table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  display: block;
  overflow-x: auto;
}
.markdown-docs th {
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-weight: 600;
  padding: 0.7rem 1rem;
  text-align: left;
  border: 1px solid var(--border);
}
.markdown-docs td {
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.markdown-docs tr:hover td { background: var(--bg-card); }

/* HR */
.markdown-docs hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* Images */
.markdown-docs img {
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 1rem 0;
}

/* 8. BUTTONS
   ================================================================ */
.btn-docs-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  background: var(--grad-primary);
  color: #fff !important;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.9rem;
  font-family: var(--font-sans);
  transition: var(--transition);
  border: none;
  text-decoration: none;
}
.btn-docs-primary:hover { opacity: 0.88; transform: translateY(-2px); }

.btn-docs-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  background: transparent;
  color: var(--text-secondary) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.9rem;
  font-family: var(--font-sans);
  transition: var(--transition);
  text-decoration: none;
}
.btn-docs-outline:hover {
  border-color: var(--border-accent);
  color: var(--text-primary) !important;
  background: var(--bg-card);
  transform: translateY(-2px);
}

/* 9. FOOTER
   ================================================================ */
.docs-footer {
  text-align: center;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}
.docs-footer a { color: var(--text-muted); transition: var(--transition); }
.docs-footer a:hover { color: var(--primary-light); }

/* Standalone footer (index page) */
footer.docs-footer-standalone {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
}

/* 10. SIDEBAR OVERLAY (mobile)
   ================================================================ */
.docs-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 99;
  backdrop-filter: blur(2px);
}
.docs-sidebar-overlay.active { display: block; }

/* 11. RESPONSIVE
   ================================================================ */
@media (max-width: 992px) {
  :root { --sidebar-width: 250px; }
  .docs-main { padding: 2.5rem 2rem 5rem; }
}

@media (max-width: 768px) {
  .docs-sidebar {
    transform: translateX(-100%);
    z-index: 200;
  }
  .docs-sidebar.mobile-open { transform: translateX(0); }
  .docs-sidebar-overlay.active { display: block; }

  .docs-main {
    margin-left: 0;
    padding: 2rem 1.25rem 5rem;
  }
  .docs-menu-toggle { display: inline-flex; }
  .docs-breadcrumb .bc-current { max-width: 160px; }
}

@media (max-width: 576px) {
  .docs-hero { padding: calc(var(--navbar-height) + 48px) 0 48px; }
  .docs-hero-logo { width: 70px; height: 70px; }
  .docs-cards-grid { grid-template-columns: 1fr; }
  .docs-main { padding: 1.5rem 1rem 4rem; }
  .docs-navbar-actions .btn-site span { display: none; }
  .docs-doc-title { font-size: 1.7rem; }
}
