/* ============================================================
   iGaming Tech — Documentation Page Styles
   Mintlify-inspired layout with our design system
   ============================================================ */

/* ---------- docs layout ---------- */

.docs-layout {
  display: flex;
  height: 100vh;
  background: var(--bg);
  overflow: hidden;
}

/* ---------- docs sidebar ---------- */

.docs-sidebar {
  width: 260px;
  flex: none;
  border-right: 1px solid var(--line);
  padding: 24px 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--bg-deep);
}

.docs-sidebar::-webkit-scrollbar { width: 4px; }
.docs-sidebar::-webkit-scrollbar-track { background: transparent; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 2px; }

.docs-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.docs-brand img { height: 40px; }

.docs-nav-section {
  padding: 0 12px;
  margin-bottom: 20px;
}

.docs-nav-title {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--faint);
  padding: 8px 10px;
  margin-bottom: 4px;
}

.docs-nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.docs-nav-item:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.docs-nav-item.active { color: var(--ac-bright); background: var(--ac-dim); font-weight: 600; }
.docs-nav-item svg.icon { width: 14px; height: 14px; flex: none; }

.docs-nav-item .arrow {
  margin-left: auto;
  transition: transform .2s;
  width: 10px; height: 10px;
}
.docs-nav-item.expanded .arrow { transform: rotate(90deg); }

.docs-nav-sub {
  display: none;
  padding-left: 12px;
}
.docs-nav-sub.open { display: block; }
.docs-nav-sub .docs-nav-item { font-size: 13px; padding: 6px 10px; }

/* ---------- docs main ---------- */

.docs-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* ---------- docs topbar ---------- */

.docs-topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 32px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-deep);
  flex: none;
  z-index: 50;
}

.docs-topbar-tabs {
  display: flex; gap: 4px;
  background: var(--card);
  border-radius: 8px;
  padding: 3px;
  border: 1px solid var(--line);
}

.docs-tab {
  padding: 7px 16px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px; font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s;
}
.docs-tab:hover { color: var(--text); }
.docs-tab.active { background: var(--card-2); color: var(--text); font-weight: 600; }

.docs-search {
  flex: 1;
  max-width: 400px;
  margin-left: auto;
  position: relative;
}
.docs-search input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 9px 14px 9px 36px;
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
.docs-search input:focus { border-color: var(--ac); }
.docs-search input::placeholder { color: var(--faint); }
.docs-search svg.icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--faint);
}
.docs-search kbd {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: 11px; color: var(--faint);
  background: var(--panel-2);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--line-2);
  font-family: var(--mono);
}

.docs-lang {
  position: relative;
}

/* ---------- docs content ---------- */

.docs-body {
  display: flex;
  flex: 1;
  justify-content: center;
  overflow-y: auto;
  min-height: 0;
}

.docs-content {
  flex: 1;
  min-width: 0;
  padding: 40px 48px 80px;
  max-width: 780px;
  margin: 0 auto;
}

.docs-content h1 {
  font-size: 36px; font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  line-height: 1.15;
}

.docs-content .docs-subtitle {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 36px;
}

.docs-content h2 {
  font-size: 24px; font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 48px; margin-bottom: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.docs-content h2:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }

.docs-content h3 {
  font-size: 18px; font-weight: 600;
  margin-top: 32px; margin-bottom: 12px;
}

.docs-content p {
  font-size: 14.5px;
  line-height: 1.7;
  color: #c8c8cc;
  margin-bottom: 16px;
}

.docs-content ul, .docs-content ol {
  padding-left: 22px;
  margin-bottom: 16px;
}
.docs-content li {
  font-size: 14.5px;
  line-height: 1.7;
  color: #c8c8cc;
  margin-bottom: 6px;
}
.docs-content li::marker { color: var(--ac); }

.docs-content strong { color: var(--text); font-weight: 600; }

.docs-content a { color: var(--ac-bright); text-decoration: none; }
.docs-content a:hover { text-decoration: underline; }

/* ---------- docs breadcrumb ---------- */

.docs-breadcrumb {
  font-size: 13px;
  color: var(--ac-bright);
  font-weight: 600;
  margin-bottom: 8px;
}

/* ---------- docs table ---------- */

.docs-table-wrap {
  overflow-x: auto;
  margin-bottom: 24px;
  border-radius: var(--r);
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.docs-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--faint);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.docs-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: #c8c8cc;
}
.docs-table tr:last-child td { border-bottom: none; }
.docs-table tbody tr:hover { background: rgba(255,255,255,0.02); }

.docs-table .price-cell {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--ac-bright);
}

/* ---------- docs callout ---------- */

.docs-callout {
  display: flex; gap: 12px;
  padding: 16px 20px;
  border-radius: var(--r);
  margin-bottom: 24px;
  background: var(--card);
}
.docs-callout.tip { background: var(--ac-dim); }
.docs-callout.warning { background: var(--yellow-dim); }
.docs-callout.info { background: var(--blue-dim); }

.docs-callout-icon { flex: none; margin-top: 2px; }
.docs-callout-icon svg.icon { width: 18px; height: 18px; }
.docs-callout.tip .docs-callout-icon svg.icon { color: var(--ac-bright); }
.docs-callout.warning .docs-callout-icon svg.icon { color: var(--yellow); }
.docs-callout.info .docs-callout-icon svg.icon { color: var(--blue); }

.docs-callout-content { font-size: 14px; line-height: 1.6; color: #c8c8cc; }
.docs-callout-content strong { color: var(--text); }

/* ---------- docs code block ---------- */

.docs-code {
  background: var(--panel);
  border-radius: var(--r-sm);
  padding: 18px 20px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
  color: #d6d6dc;
  margin-bottom: 24px;
  position: relative;
}

.docs-code-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.docs-code-header span {
  font-size: 11px; font-weight: 600;
  color: var(--faint);
  text-transform: uppercase; letter-spacing: 1px;
}
.docs-code-copy {
  background: none; border: 1px solid var(--line-2);
  border-radius: 4px; padding: 3px 10px;
  font-size: 11px; color: var(--muted);
  cursor: pointer; font-family: inherit;
  transition: all .15s;
}
.docs-code-copy:hover { color: var(--text); border-color: var(--dim); }

/* ---------- docs cards ---------- */

.docs-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.docs-card {
  padding: 20px;
  border-radius: var(--r);
  background: var(--card);
  transition: background .2s;
  cursor: pointer;
  text-decoration: none;
}
.docs-card:hover { background: var(--card-2); }
.docs-card h4 {
  font-size: 15px; font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.docs-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 0;
}
.docs-card .docs-card-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--ac-dim);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.docs-card .docs-card-icon svg.icon { width: 18px; height: 18px; color: var(--ac-bright); }

/* ---------- docs right sidebar (On this page) ---------- */

.docs-toc {
  width: 220px;
  flex: none;
  padding: 40px 24px 40px 0;
  position: absolute;
  right: 0;
  top: 57px;
  height: calc(100vh - 57px);
  overflow-y: auto;
  background: var(--bg);
}

.docs-toc-title {
  font-size: 12px; font-weight: 600;
  color: var(--muted);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 6px;
}
.docs-toc-title svg.icon { width: 14px; height: 14px; }

.docs-toc-item {
  display: block;
  padding: 5px 0 5px 14px;
  font-size: 13px;
  color: var(--faint);
  text-decoration: none;
  border-left: 2px solid var(--line);
  transition: all .15s;
}
.docs-toc-item:hover { color: var(--text); }
.docs-toc-item.active {
  color: var(--green-bright, #4ade80);
  border-left-color: var(--green, #22c55e);
}

/* ---------- docs page nav (prev/next) ---------- */

.docs-pagination {
  display: flex; gap: 14px;
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.docs-page-link {
  flex: 1;
  padding: 16px 20px;
  border-radius: var(--r);
  background: var(--card);
  text-decoration: none;
  transition: background .2s;
}
.docs-page-link:hover { background: var(--card-2); }
.docs-page-link .docs-page-dir {
  font-size: 12px; color: var(--faint);
  margin-bottom: 4px;
}
.docs-page-link .docs-page-name {
  font-size: 14px; font-weight: 600;
  color: var(--text);
}
.docs-page-link.next { text-align: right; }

/* ---------- docs mobile ---------- */

.docs-mobile-toggle {
  display: none;
  background: none; border: none;
  color: var(--text);
  cursor: pointer;
  padding: 4px;
}

@media (max-width: 1020px) {
  .docs-sidebar {
    position: fixed;
    left: -260px;
    z-index: 200;
    transition: left .3s;
    box-shadow: 4px 0 20px rgba(0,0,0,0.5);
  }
  .docs-sidebar.open { left: 0; }
  .docs-mobile-toggle { display: block; }
  .docs-toc { display: none; }
  .docs-content { padding: 24px 20px 60px; }
  .docs-topbar { padding: 12px 16px; flex-wrap: wrap; }
  .docs-search { max-width: 100%; order: 3; width: 100%; }
}

/* ---------- language selector ---------- */

.lang-select {
  position: relative;
}
.lang-btn {
  display: flex; align-items: center; gap: 6px;
  background: none; border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  color: var(--muted); font-size: 13px; font-weight: 500;
  padding: 7px 12px;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}
.lang-btn:hover { border-color: var(--dim); color: var(--text); }
.lang-btn svg.icon { width: 14px; height: 14px; }

.lang-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--panel); border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 4px;
  min-width: 160px;
  opacity: 0; pointer-events: none;
  transform: translateY(-4px);
  transition: opacity .2s, transform .2s;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 60;
}
.lang-select.open .lang-dropdown {
  opacity: 1; pointer-events: auto;
  transform: translateY(0);
}

.lang-opt {
  display: block; width: 100%;
  background: none; border: none;
  color: var(--muted); font-size: 13px;
  padding: 8px 12px; border-radius: 6px;
  cursor: pointer; text-align: left;
  font-family: inherit;
  transition: background .15s, color .15s;
}
.lang-opt:hover { background: var(--card); color: var(--text); }
.lang-opt.on { color: var(--ac-bright); }

/* ---------- docs overlay for mobile sidebar ---------- */

.docs-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 199;
}
.docs-overlay.open { display: block; }
