/* Nostro 3DS Documentation Theme
 * Brand colors aligned with the Nostro Manager UI
 */

:root {
  /* Brand palette */
  --nostro-dark: #1a2e27;
  --nostro-dark-lighter: #243d34;
  --nostro-lime: #a3e635;
  --nostro-lime-light: #c4f06d;
  --nostro-lime-subtle: #f7fee7;
  --nostro-foreground: #1a1a1a;
  --nostro-background: #ffffff;
  --nostro-muted: #6b7280;
  --nostro-border: #e5e7eb;
  --nostro-card: #ffffff;

  /* Docsify themeable overrides */
  --base-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --base-font-size: 15px;
  --base-line-height: 1.7;
  --base-color: var(--nostro-foreground);
  --base-background-color: var(--nostro-background);

  /* Content */
  --content-max-width: 80%;

  /* Headings */
  --heading-color: var(--nostro-foreground);
  --heading-h1-font-size: 1.75rem;
  --heading-h1-font-weight: 700;
  --heading-h2-font-size: 1.35rem;
  --heading-h2-font-weight: 600;
  --heading-h2-border-color: transparent;
  --heading-h2-border-width: 0;
  --heading-h2-margin: 2.5rem 0 1rem;
  --heading-h2-padding: 0 0 0.5rem 0;
  --heading-h3-font-size: 1.1rem;
  --heading-h3-font-weight: 600;

  /* Sidebar */
  --sidebar-background: var(--nostro-dark);
  --sidebar-color: rgba(255, 255, 255, 0.9);
  --sidebar-width: 300px;
  --sidebar-padding: 20px 16px 20px 20px;
  --sidebar-nav-link-color: rgba(255, 255, 255, 0.7);
  --sidebar-nav-link-color--hover: #ffffff;
  --sidebar-nav-link-color--active: var(--nostro-lime);
  --sidebar-nav-link-font-weight: 400;
  --sidebar-nav-link-font-weight--active: 500;
  --sidebar-nav-link-border-color: transparent;
  --sidebar-nav-link-border-color--active: transparent;
  --sidebar-nav-link-border-width: 0;
  --sidebar-nav-link-border-width--active: 0;
  --sidebar-nav-link-margin: 0;
  --sidebar-nav-link-padding: 0.3em 0.5em;
  --sidebar-nav-link-text-decoration: none;
  --sidebar-nav-link-text-decoration--hover: none;
  --sidebar-nav-link-background: transparent;
  --sidebar-nav-link-background--hover: rgba(255, 255, 255, 0.06);
  --sidebar-nav-link-background--active: rgba(163, 230, 53, 0.1);
  --sidebar-name-color: #ffffff;
  --sidebar-name-font-size: 1.1rem;
  --sidebar-name-font-weight: 600;
  --sidebar-name-margin: 0 0 1.2rem 0;
  --sidebar-name-text-align: left;
  --sidebar-toggle-background: var(--nostro-dark);
  --sidebar-border-color: transparent;

  /* Links */
  --link-color: #15803d;
  --link-text-decoration: none;
  --link-text-decoration--hover: underline;

  /* Code */
  --code-font-family: 'JetBrains Mono', 'Fira Code', monospace;
  --code-font-size: 0.84em;
  --code-inline-background: #f3f4f6;
  --code-inline-border-radius: 4px;
  --code-inline-color: #be185d;
  --code-inline-padding: 0.15em 0.4em;
  --code-block-border-radius: 8px;
  --code-block-padding: 1.2em 1.4em;
  --code-block-line-height: 1.55;

  /* Blockquote */
  --blockquote-border-color: var(--nostro-lime);
  --blockquote-border-width: 3px;
  --blockquote-background: var(--nostro-lime-subtle);
  --blockquote-color: var(--nostro-foreground);
  --blockquote-padding: 1em 1.2em;

  /* Tables */
  --table-head-background: #f9fafb;
  --table-head-font-weight: 600;
  --table-body-border-color: var(--nostro-border);
  --table-cell-padding: 0.55em 0.9em;

  /* Notice / alerts */
  --notice-tip-border-color: var(--nostro-lime);
  --notice-important-border-color: #f59e0b;

  /* Search */
  --search-background: rgba(255, 255, 255, 0.06);
  --search-color: rgba(255, 255, 255, 0.9);
  --search-input-background-color: rgba(255, 255, 255, 0.08);
  --search-input-color: rgba(255, 255, 255, 0.9);
  --search-input-placeholder-color: rgba(255, 255, 255, 0.4);
  --search-result-keyword-color: var(--nostro-lime);
}

/* =========================================
   SIDEBAR
   ========================================= */

/* Prevent text truncation */
.sidebar-nav a {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
  display: block;
  font-size: 0.9em;
  line-height: 1.4;
  border-radius: 4px;
  transition: background 0.15s ease, color 0.15s ease;
}

/* Remove any outline/box around active items */
.sidebar-nav li.active > a,
.sidebar-nav a.active {
  background: rgba(163, 230, 53, 0.1) !important;
  color: var(--nostro-lime) !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  font-weight: 500;
  border-radius: 4px;
}

/* Hover state */
.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #ffffff !important;
}

/* Sub-items indentation */
.sidebar-nav ul ul {
  padding-left: 0.9em;
}

.sidebar-nav li {
  margin: 1px 0;
}

/* Sidebar logo */
.sidebar .app-name-link img {
  max-width: 130px;
  margin-bottom: 0.3rem;
  filter: brightness(0) invert(1);
}

/* Sidebar toggle (hamburger) */
.sidebar-toggle {
  background: var(--nostro-dark) !important;
  border: none !important;
  padding: 8px !important;
}

.sidebar-toggle span {
  background-color: rgba(255, 255, 255, 0.7) !important;
}

/* Search input in sidebar */
.sidebar .search input {
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: #fff !important;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.85em;
  width: 100%;
  box-sizing: border-box;
}

.sidebar .search input:focus {
  border-color: rgba(255, 255, 255, 0.4) !important;
  background: rgba(255, 255, 255, 0.14) !important;
  outline: none !important;
  box-shadow: none !important;
}

.sidebar .search input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

/* Search clear button */
.sidebar .search .clear-button {
  color: rgba(255, 255, 255, 0.6);
}

/* Search results */
.sidebar .search .results-panel {
  background: var(--nostro-dark) !important;
  border: none !important;
}

.sidebar .search .results-panel h2 {
  color: #ffffff !important;
  font-size: 0.85em;
  font-weight: 600;
  margin: 0.8em 0 0.3em;
}

.sidebar .search .results-panel p {
  color: rgba(255, 255, 255, 0.6) !important;
  font-size: 0.8em;
  line-height: 1.4;
}

/* Search keyword highlight — subtle white bold instead of yellow box */
.sidebar .search .results-panel .search-keyword,
.sidebar .search .matching-post .search-keyword {
  background: rgba(163, 230, 53, 0.2) !important;
  color: var(--nostro-lime) !important;
  border-radius: 2px;
  padding: 0 2px;
  font-weight: 600;
  box-shadow: none !important;
  border: none !important;
}

/* Scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
  width: 5px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

/* =========================================
   CONTENT AREA
   ========================================= */

.markdown-section {
  padding: 2rem 2.5rem;
  max-width: 1200px;
}

/* Tables */
.markdown-section table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9em;
  border: 1px solid var(--nostro-border);
  border-radius: 6px;
}

.markdown-section table thead {
  background: #f9fafb;
}

.markdown-section table th {
  text-align: left;
  font-weight: 600;
  font-size: 0.95em;
  color: var(--nostro-muted);
  border-bottom: 2px solid var(--nostro-border);
}

.markdown-section table td,
.markdown-section table th {
  border: 1px solid var(--nostro-border);
  padding: 0.55em 0.9em;
}

.markdown-section table tbody tr:nth-child(even) {
  background: transparent;
}

/* Code blocks */
.markdown-section pre {
  background: #f8fafc !important;
  color: #334155;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

/* Inline code */
.markdown-section code:not([class*="lang-"]):not(.token) {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 3px;
  padding: 0.12em 0.35em;
  font-size: 0.84em;
  color: #be185d;
}

/* Tabs styling */
.docsify-tabs__tab--active {
  border-bottom-color: var(--nostro-lime) !important;
  color: var(--nostro-foreground) !important;
}

/* Pagination (prev/next) */
.docsify-pagination-container {
  border-top: 1px solid var(--nostro-border);
  margin-top: 3rem;
  padding-top: 1.5rem;
}

/* Copy code button */
.docsify-copy-code-button {
  font-size: 0.75em !important;
}

/* =========================================
   RIGHT-SIDE TABLE OF CONTENTS
   ========================================= */

#page-toc {
  position: fixed;
  top: 80px;
  right: 24px;
  width: 200px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  font-size: 0.78em;
  line-height: 1.5;
  z-index: 10;
}

#page-toc .page-toc-title {
  font-weight: 600;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--nostro-muted);
  margin: 0 0 0.6em 0;
  padding: 0;
}

#page-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 2px solid var(--nostro-border);
}

#page-toc li {
  margin: 0;
}

#page-toc li.toc-h2 {
  padding-left: 12px;
}

#page-toc li.toc-h3 {
  padding-left: 24px;
}

#page-toc a {
  color: var(--nostro-muted);
  text-decoration: none;
  display: block;
  padding: 3px 0;
  transition: color 0.15s ease;
}

#page-toc a:hover {
  color: var(--nostro-foreground);
}

/* Hide TOC on small screens */
@media (max-width: 1900px) {
  #page-toc {
    display: none;
  }
}

/* =========================================
   RESPONSIVE
   ========================================= */

@media (max-width: 768px) {
  .markdown-section {
    padding: 1.2rem 1rem;
  }
}

