/*
 * Cryptrix Documentation — Brand Override Styles
 * Applies Cryptrix colors, modernizes code blocks, tables, sidebar, and nav.
 * Loaded after the base template CSS to override without modifying vendor files.
 */

/* ─── Root variables ─── */
:root {
  --cx-primary: #00D4AA;
  --cx-primary-dark: #00A88A;
  --cx-secondary: #7B61FF;
  --cx-accent: #FF6B35;
  --cx-bg-dark: #0A0B0F;
  --cx-surface: #12141A;
  --cx-surface2: #1A1D26;
  --cx-text: #F0F2F8;
  --cx-text2: #8B91A8;
  --cx-text3: #5A6080;
  --cx-border: #1E2130;
  --cx-gradient: linear-gradient(135deg, #00D4AA 0%, #7B61FF 100%);
}

/* ─── Body & Typography ─── */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #2D3348;
  background: #f5f7fb;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #0A0B14;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 { font-size: 36px; line-height: 1.25; }
h2 { font-size: 26px; line-height: 1.3; }
h3 { font-size: 20px; line-height: 1.4; }

/* ─── Links ─── */
a { color: var(--cx-primary-dark); }
a:hover, a:focus { color: var(--cx-secondary); }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f0f2f8; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--cx-primary), var(--cx-secondary));
  border-radius: 30px;
}

/* ─── Navbar ─── */
.navbar.menu_one {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding: 0 10px;
}

.navbar .menu .nav-item .nav-link {
  font-size: 14px;
  font-weight: 600;
  color: #2D3348;
  padding: 8px 14px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.navbar .menu .nav-item .nav-link:hover {
  color: var(--cx-primary-dark);
  background: rgba(0,212,170,0.08);
}

.navbar .menu .nav-item .action_btn {
  background: var(--cx-gradient);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 20px;
  box-shadow: 0 4px 15px rgba(0,212,170,0.3);
  transition: all 0.2s ease;
}

.navbar .menu .nav-item .action_btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,212,170,0.4);
}

.navbar .menu .nav-item .action_btn i { color: #fff; }

/* ─── Sidebar ─── */
.doc_left_sidebarlist {
  background: #fff;
  border-right: 1px solid rgba(0,0,0,0.06);
}

.doc_left_sidebarlist .nav_title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cx-text3);
  padding-top: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  margin-bottom: 8px;
}

.nav-sidebar .nav-item .nav-link {
  font-size: 14px;
  font-weight: 500;
  color: #4A5068;
  padding: 7px 16px;
  border-radius: 8px;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-sidebar .nav-item .nav-link img {
  width: 18px;
  height: 18px;
  opacity: 0.5;
}

.nav-sidebar .nav-item .nav-link:hover {
  background: rgba(0,212,170,0.08);
  color: var(--cx-primary-dark);
}

.nav-sidebar .nav-item .nav-link:target,
.nav-sidebar .nav-item.active .nav-link {
  background: rgba(0,212,170,0.1);
  color: var(--cx-primary-dark);
  font-weight: 600;
}

/* Dropdown sub-items */
.nav-sidebar .dropdown_nav .nav-item .nav-link {
  font-size: 13px;
  font-weight: 400;
  padding: 4px 16px 4px 42px;
  color: #6B7280;
  border-radius: 6px;
}

.nav-sidebar .dropdown_nav .nav-item .nav-link:hover {
  color: var(--cx-primary-dark);
  background: rgba(0,212,170,0.06);
}

/* ─── Main content area ─── */
.documentation_body {
  padding-top: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.documentation_body:last-child {
  border-bottom: none;
}

.shortcode_title h1,
.documentation_body > .shortcode_title > h1 {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid transparent;
  border-image: var(--cx-gradient);
  border-image-slice: 1;
  display: inline-block;
}

.shortcode_title h2 {
  margin-top: 40px;
  margin-bottom: 14px;
  position: relative;
}

.shortcode_title h3 {
  margin-top: 28px;
  margin-bottom: 12px;
  color: #1d2746;
}

.shortcode_title p {
  color: #4A5068;
  line-height: 1.7;
  font-size: 15px;
}

/* ─── Ordered / Unordered lists ─── */
.ordered-list {
  padding-left: 0;
  list-style: none;
  counter-reset: steps;
}

.ordered-list li {
  padding: 6px 0 6px 28px;
  position: relative;
  color: #4A5068;
  font-size: 15px;
  line-height: 1.6;
}

.ordered-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cx-gradient);
}

.steps-panel {
  background: #f8f9fc;
  border-radius: 12px;
  padding: 16px 20px;
  border: 1px solid rgba(0,0,0,0.04);
}

/* ─── Code blocks ─── */
.code_item {
  border-radius: 12px;
  overflow: hidden;
  margin: 16px 0;
  border: 1px solid rgba(0,0,0,0.06);
  background: #0d1117;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.code_item pre {
  margin: 0;
  padding: 0;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
}

.code_item code {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
  font-size: 13px !important;
  line-height: 1.6;
  color: #e6edf3 !important;
  background: transparent !important;
  text-shadow: none !important;
  padding: 20px 24px !important;
  display: block;
  overflow-x: auto;
}

/* Inline code */
p code, li code {
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 13px;
  background: rgba(0,212,170,0.1);
  color: var(--cx-primary-dark);
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid rgba(0,212,170,0.15);
  font-weight: 500;
}

/* Syntax highlighting tweaks for dark code blocks */
pre[class*="language-"] {
  background: #0d1117 !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  text-shadow: none !important;
}

code[class*="language-"] {
  text-shadow: none !important;
  background: transparent !important;
}

.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #6B7280; }
.token.punctuation { color: #8B91A8; }
.token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol { color: #79C0FF; }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin { color: #A5D6FF; }
.token.operator, .token.entity, .token.url { color: #d2a8ff; }
.token.atrule, .token.attr-value, .token.keyword { color: #ff7b72; }
.token.function, .token.class-name { color: #d2a8ff; }
.token.regex, .token.important, .token.variable { color: #ffa657; }

/* ─── Tables ─── */
.table {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.06);
  font-size: 14px;
}

.table thead th {
  background: var(--cx-bg-dark);
  color: var(--cx-text);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: none;
  padding: 12px 16px;
}

.table tbody td {
  padding: 11px 16px;
  border-color: rgba(0,0,0,0.05);
  color: #4A5068;
  vertical-align: middle;
}

.table tbody tr:hover {
  background: rgba(0,212,170,0.04);
}

.table tbody tr:nth-child(even) {
  background: #fafbfe;
}

/* ─── Changelog ─── */
.changelog_content p {
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.6;
}

.changelog_content span.new {
  background: var(--cx-gradient);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 8px;
  display: inline-block;
  min-width: 38px;
  text-align: center;
}

.changelog_content span.update {
  background: linear-gradient(135deg, #FFB800, #FF8C00);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 8px;
}

.changelog_content span.fix {
  background: linear-gradient(135deg, #FF4757, #CC2233);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 8px;
}

.c_version {
  background: var(--cx-gradient);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  border-radius: 10px;
  padding: 6px 14px;
  display: inline-block;
}

.c_date h6 {
  font-size: 14px;
  font-weight: 700;
  color: #0A0B14;
}

.c_date p {
  font-size: 12px;
  color: #6B7280;
  font-weight: 500;
}

/* ─── Right sidebar ─── */
.doc_rightsidebar {
  background: #fff;
  border-left: 1px solid rgba(0,0,0,0.06);
  border-radius: 12px;
  padding: 16px;
}

.hire-us p {
  background: #f8f9fc;
  border-radius: 10px;
  padding: 16px;
  border: 1px solid rgba(0,0,0,0.04);
  font-size: 13px;
  color: #4A5068;
  line-height: 1.7;
}

.hire-us p a {
  color: var(--cx-primary-dark);
  font-weight: 600;
}

/* Dark/light toggle */
.doc_switch {
  background: #f0f2f8;
  border-radius: 20px;
  padding: 3px;
}

/* ─── Footer ─── */
.simple_footer {
  background: var(--cx-bg-dark);
  color: var(--cx-text2);
  border-top: none;
  padding: 24px 0;
}

.simple_footer p {
  color: var(--cx-text2);
  font-size: 13px;
  margin: 0;
}

.simple_footer .text-right p {
  color: var(--cx-text3);
  font-size: 12px;
}

/* ─── Feedback link ─── */
.feedback_link {
  background: #f8f9fc;
  border-radius: 12px;
  padding: 16px 24px;
  border: 1px solid rgba(0,0,0,0.04);
  margin-top: 24px;
}

.feedback_link h6 {
  font-size: 14px;
  font-weight: 500;
  color: #4A5068;
}

.feedback_link h6 a {
  color: var(--cx-primary-dark);
  font-weight: 700;
}

/* ─── Overlay background ─── */
.overlay_bg {
  background: linear-gradient(180deg, #f5f7fb 0%, #eef1ff 100%);
}

/* ─── Feature pills (used in Introduction) ─── */
.documentation_body .steps-panel ul.ordered-list li strong {
  color: #0A0B14;
}

/* ─── Feature sections headings (Auth, Market, etc) ─── */
.documentation_body h2:not([class]) {
  margin-top: 36px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--cx-primary);
  display: inline-block;
}

/* ─── Reading progress bar ─── */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--cx-gradient);
  z-index: 9999;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ─── Smooth scroll ─── */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

/* ─── Code block copy button ─── */
.code_item {
  position: relative;
}

.code_item .copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: #8B91A8;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', -apple-system, sans-serif;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 5px;
}

.code_item .copy-btn:hover {
  background: rgba(255,255,255,0.15);
  color: #e6edf3;
}

.code_item .copy-btn.copied {
  color: #00D4AA;
  border-color: rgba(0,212,170,0.3);
  background: rgba(0,212,170,0.1);
}

/* ─── Back to top button ─── */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--cx-gradient);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 15px rgba(0,212,170,0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 1000;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,212,170,0.4);
}

/* ─── Sidebar search ─── */
.sidebar-search {
  padding: 0 16px 12px;
  margin-top: -4px;
}

.sidebar-search input {
  width: 100%;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 10px;
  padding: 9px 14px 9px 36px;
  font-size: 13px;
  font-family: 'Inter', -apple-system, sans-serif;
  color: #2D3348;
  background: #f5f7fb;
  outline: none;
  transition: all 0.2s ease;
}

.sidebar-search input::placeholder {
  color: #8B91A8;
}

.sidebar-search input:focus {
  border-color: var(--cx-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0,212,170,0.12);
}

.sidebar-search .search-icon {
  position: absolute;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  color: #8B91A8;
  font-size: 13px;
  pointer-events: none;
}

.sidebar-search .no-results {
  font-size: 12px;
  color: var(--cx-text3);
  padding: 8px 16px;
  display: none;
}

/* Hide filtered items */
.nav-sidebar .nav-item.search-hidden {
  display: none;
}

/* ─── Feedback section (improved) ─── */
.feedback_link {
  background: linear-gradient(135deg, rgba(0,212,170,0.06) 0%, rgba(123,97,255,0.06) 100%);
  border: 1px solid rgba(0,212,170,0.15);
  border-radius: 16px;
  padding: 24px 28px;
  margin-top: 32px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.feedback_link .feedback-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--cx-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  flex-shrink: 0;
}

.feedback_link .feedback-text h6 {
  font-size: 15px;
  font-weight: 700;
  color: #0A0B14;
  margin-bottom: 4px;
}

.feedback_link .feedback-text p {
  font-size: 13px;
  color: #6B7280;
  margin: 0;
}

.feedback_link .feedback-text a {
  color: var(--cx-primary-dark);
  font-weight: 700;
}

.feedback_link .feedback-btn {
  margin-left: auto;
  background: var(--cx-gradient);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 22px;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Inter', -apple-system, sans-serif;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(0,212,170,0.3);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.feedback_link .feedback-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,212,170,0.4);
  color: #fff;
  text-decoration: none;
}

/* ─── Section highlight on scroll ─── */
.documentation_body.doc-section {
  scroll-margin-top: 80px;
}

/* Active sidebar item enhanced */
.nav-sidebar .nav-item.active > .nav-link,
.nav-sidebar .nav-item .nav-link.active-link {
  position: relative;
}

.nav-sidebar .nav-item.active > .nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  border-radius: 3px;
  background: var(--cx-gradient);
}

/* ─── Print styles ─── */
@media print {
  .navbar, .doc_left_sidebarlist, .doc_rightsidebar,
  .back-to-top, .reading-progress, .feedback_link { display: none !important; }
  .col-lg-8 { max-width: 100% !important; flex: 0 0 100% !important; }
  body { background: #fff; color: #000; }
}

/* ─── Responsive tweaks ─── */
@media (max-width: 991px) {
  .navbar-collapse {
    background: #fff;
    border-radius: 12px;
    margin-top: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    padding: 12px;
  }

  .menu > .nav-item {
    border-bottom-color: rgba(0,0,0,0.05);
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
  }

  .feedback_link {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .feedback_link .feedback-btn {
    margin-left: 0;
  }
}

@media (max-width: 767px) {
  h1 { font-size: 28px; }
  h2 { font-size: 22px; }
  h3 { font-size: 18px; }

  .code_item code {
    font-size: 12px !important;
    padding: 14px 16px !important;
  }

  .reading-progress {
    height: 2px;
  }
}
