/* ============================================
   NEXUS MINING — DOCS STYLESHEET
   Background: #0b0f17   Accent: #f59e0b
   ============================================ */

* { 
  box-sizing: border-box; 
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #0b0f17;
  color: #f59e0b;
  line-height: 1.7;
  overflow-x: hidden;
}

a { 
  color: #f59e0b; 
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid #1f2530;
  background: #0b0f17;
  position: sticky;
  top: 0;
  z-index: 100;
  height: 70px;
}

.topbar .logo {
  font-weight: 900;
  font-size: 1.2rem;
  text-decoration: none;
  color: #ffffff;
  letter-spacing: -0.5px;
  z-index: 102;
}

.topbar .logo span {
  color: #f59e0b;
}

#docs-nav-toggle,
.hamburger-btn {
  display: none;
}

.top-nav {
  display: flex;
  align-items: center;
}

.top-nav a {
  margin-left: 1.5rem;
  text-decoration: none;
  color: #f59e0b;
  font-size: 0.95rem;
  opacity: 0.75;
  transition: opacity 0.15s;
}

.top-nav a:hover,
.top-nav a.active {
  opacity: 1;
  font-weight: 600;
}

/* ---------- Layout ---------- */
.docs-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.mobile-sidebar-toggle {
  display: none;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky;
  top: 90px;
  align-self: start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  border-right: 1px solid #1f2530;
  padding-right: 1.5rem;
}

.sidebar-list { 
  list-style: none; 
  padding: 0; 
  margin: 0; 
}

.sidebar-section { 
  margin-bottom: 0.75rem; 
}

.sidebar-toggle {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 0;
  cursor: pointer;
  color: #f59e0b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  letter-spacing: 0.3px;
}

.sidebar-toggle:hover { 
  color: #ffb733; 
}

.sidebar-toggle::after {
  content: '▸';
  font-size: 0.75rem;
  transition: transform 0.2s;
  color: #f59e0b;
  opacity: 0.6;
}

.sidebar-toggle[aria-expanded="true"]::after {
  transform: rotate(90deg);
}

.sidebar-sublist {
  list-style: none;
  padding-left: 0.75rem;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.sidebar-sublist.open { 
  max-height: 500px; 
}

.sidebar-sublist a {
  display: block;
  padding: 0.35rem 0.6rem;
  color: #f59e0b;
  opacity: 0.7;
  text-decoration: none;
  font-size: 0.9rem;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  transition: all 0.15s;
}

.sidebar-sublist a:hover {
  opacity: 1;
  background: #141a24;
  border-left-color: #f59e0b;
}

.sidebar-sublist a.active {
  opacity: 1;
  font-weight: 600;
  background: #141a24;
  border-left-color: #f59e0b;
}

/* ---------- Content ---------- */
.doc-content {
  min-width: 0;
  padding-bottom: 4rem;
}

.doc-content section {
  margin-bottom: 3.5rem;
  scroll-margin-top: 100px;
}

.doc-content h1 {
  font-size: 2rem;
  margin-top: 0;
  color: #f59e0b;
  letter-spacing: 0.5px;
}

.doc-content h2 {
  font-size: 1.4rem;
  margin-top: 2rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #1f2530;
  color: #f59e0b;
}

.doc-content h3 {
  color: #f59e0b;
  font-size: 1.15rem;
}

.doc-content p {
  color: #d6dee8;
  opacity: 0.9;
}

.doc-content pre {
  background: #141a24;
  border: 1px solid #1f2530;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.875rem;
}

.doc-content pre code { 
  color: #f59e0b; 
  background: none; 
  padding: 0; 
}

.doc-content code {
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  background: #141a24;
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
  font-size: 0.9em;
  color: #f59e0b;
}

.doc-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid #1f2530;
}

/* Selection highlight */
::selection { 
  background: #f59e0b; 
  color: #0b0f17; 
}

/* Scrollbar (WebKit) */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #0b0f17; }
::-webkit-scrollbar-thumb { background: #1f2530; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #f59e0b; }

/* ---------- Mobile Styles (Max Width: 768px) ---------- */
@media (max-width: 768px) {
  .topbar {
    padding: 0 1.25rem;
  }

  /* Mobile Top Bar Hamburger */
  .hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 18px;
    cursor: pointer;
    z-index: 102;
  }

  .hamburger-btn span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: #ffffff;
    border-radius: 2px;
    transition: all 0.3s ease;
  }

  .top-nav {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    width: 100%;
    background-color: #141a24;
    border-bottom: 1px solid #1f2530;
    flex-direction: column;
    padding: 1rem 0;
    z-index: 101;
  }

  .top-nav a {
    margin: 0.75rem 0;
    text-align: center;
    width: 100%;
    font-size: 1.05rem;
  }

  #docs-nav-toggle:checked ~ .top-nav {
    display: flex;
  }

  #docs-nav-toggle:checked ~ .hamburger-btn span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  #docs-nav-toggle:checked ~ .hamburger-btn span:nth-child(2) {
    opacity: 0;
  }
  #docs-nav-toggle:checked ~ .hamburger-btn span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  /* Layout Adjustments */
  .docs-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1rem;
  }

  /* Mobile Sidebar Collapsible Banner Button */
  .mobile-sidebar-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: #141a24;
    border: 1px solid #1f2530;
    color: #f59e0b;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 4px;
    cursor: pointer;
  }

  .mobile-sidebar-toggle .arrow {
    transition: transform 0.25s ease;
  }

  .mobile-sidebar-toggle.active .arrow {
    transform: rotate(90deg);
  }

  /* Hide sidebar on mobile by default, slide down when toggled */
  .sidebar {
    display: none;
    position: static;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid #1f2530;
    padding-right: 0;
    padding-bottom: 1rem;
    background: #0b0f17;
  }

  .sidebar.open {
    display: block;
  }
}