@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap");

/* Core Elements */
body {
  font-family: "Inter", sans-serif;
  background-color: #121212;
  color: #e0e0e0;
  line-height: 1.6;
  position: relative;
}

/* Layout */
.sidebar {
  height: 100vh;
  width: 320px;
  position: fixed;
  z-index: 1030;
  padding: 24px;
}

.main-content {
  margin-left: 320px;
  padding: 16px 32px;
  height: 100vh;
  overflow-y: auto;
  position: relative;
}

/* Navigation */
.nav-wrapper {
  height: calc(100vh - 120px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.nav-link {
  border-radius: var(--bs-border-radius);
  padding: 8px 12px;
  white-space: normal;
  word-wrap: break-word;
  width: 100%;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.nav-link.small {
  font-size: 14px;
  padding: 6px 12px;
  opacity: 0.75;
}

.nav-link.small:hover {
  opacity: 1;
}

.ms-3 {
  position: relative;
  padding-left: 12px;
  border-left: 2px solid rgba(255, 255, 255, 0.1);
  margin-left: 8px !important;
}

/* Code Styling */
main pre[class*="language-"] {
  border-radius: var(--bs-border-radius-lg);
  box-shadow: var(--bs-box-shadow);
  font-family: "JetBrains Mono", monospace !important;
  position: relative;
  margin-top: 40px;
}

main :not(pre) > code {
  background-color: #2a2a2a;
  padding: 4px 8px;
  border-radius: var(--bs-border-radius-sm);
  color: #e0e0e0;
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
}

.code-block-wrapper {
  position: relative;
  margin-bottom: 16px;
}

/* Copy Button */
.copy-button {
  position: absolute;
  top: 0;
  right: 0;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: "Inter", sans-serif;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 1;
}

.copy-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.copy-button i {
  font-size: 13px;
}

.copy-button.copied {
  background: rgba(40, 167, 69, 0.2);
  border-color: rgba(40, 167, 69, 0.4);
}

/* Links */
main a {
  color: #64b5f6;
  text-decoration: none;
  transition: color 0.2s ease;
}

main a:hover {
  color: #90caf9;
  text-decoration: underline;
}

/* Alerts */
main .alert {
  color: #e0e0e0;
  border: none;
}

main .alert strong {
  color: var(--bs-white);
}

main .alert-info {
  background-color: rgba(13, 202, 240, 0.15);
  box-shadow: inset 4px 0 0 var(--bs-info);
}

main .alert-warning {
  background-color: rgba(255, 193, 7, 0.15);
  box-shadow: inset 4px 0 0 var(--bs-warning);
}

/* Article Spacing */
main article {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

main article:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Scrollbar Styling */
.nav-wrapper::-webkit-scrollbar,
.main-content::-webkit-scrollbar {
  width: 8px;
}

.nav-wrapper::-webkit-scrollbar-track,
.main-content::-webkit-scrollbar-track {
  background: transparent;
  margin: 4px;
}

.nav-wrapper::-webkit-scrollbar-thumb,
.main-content::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.nav-wrapper::-webkit-scrollbar-thumb:hover,
.main-content::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

/* Mobile Styles */
@media (max-width: 991px) {
  .main-content {
    margin-left: 0;
    padding-top: 80px;
    height: calc(100vh - 56px);
  }

  section[id] {
    scroll-margin-top: 60px; /* Adjust this value based on your header height plus desired padding */
  }

  header.fixed-top {
    background-color: var(--bs-dark);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  .offcanvas {
    width: 320px !important;
  }

  .offcanvas .nav-wrapper {
    height: calc(100vh - 80px);
    overflow-y: auto;
    padding-right: 4px;
  }

  main pre[class*="language-"] {
    margin-top: 0;
  }

  .copy-button {
    position: static;
    width: 100%;
    justify-content: center;
    margin-bottom: 8px;
    padding: 8px;
  }
}
