
/* Base Layout */
.sidebar {
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  background-color: #f8f9fa;
  border-right: 1px solid #dee2e6;
}

/* Main Content Area */
main.py-4 {
  padding: 2rem !important;
  max-width: 900px;
  margin: 0 auto;
}

/* Typography Improvements */
main h1 {
  font-size: 2.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: #212529;
  /* border-bottom: 2px solid #e9ecef; */
  padding-bottom: 0.5rem;
}

main h2 {
  font-size: 2rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: #212529;
}

main h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: #212529;
}

main h4 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  color: #212529;
}

main p {
  font-size: 1rem;
  line-height: 1.7;
  color: #495057;
  margin-bottom: 1rem;
}

main a {
  color: #0066cc;
  text-decoration: none;
}

main a:hover {
  color: #0052a3;
  text-decoration: underline;
}

/* ========= Inline Code (`code`) ========= */
code.highlighter-rouge.language-plaintext {
  background-color: #f6f8fa;
  color: #495057;
  font-size: 0.9em;
  font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
  white-space: nowrap;
  border: 1px solid #e1e4e8;
}

/* ========= Fenced Code Block (```code```) ========= */
.highlighter-rouge {
  position: relative;
}

.highlighter-rouge .highlight {
  background-color: #2c3035;
  color: #dcdcdc;
  border-radius: 6px;
  overflow: auto;
  margin-top: 1em;
  margin-bottom: 1em;
  font-size: 0.9em;
  font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
  line-height: 1.5;
}

.highlighter-rouge .highlight pre {
  padding: 1em 2.5rem 1em 1em;
  margin: 0;
}

.highlighter-rouge .highlight code {
  background-color: transparent;
  padding: 0;
  color: inherit;
}

/* Tables */
table {
  width: 100%;
  margin-bottom: 1rem;
  border-collapse: collapse;
}

table th,
table td {
  padding: 0.75rem;
  border: 1px solid #dee2e6;
}

table thead th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #495057;
  border-bottom: 2px solid #dee2e6;
}

table tbody tr:nth-child(even) {
  background-color: #f8f9fa;
}


/* Table of Contents */
.toc {
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  padding: 1.5rem;
  overflow-y: auto;
  background-color: #fff;
  border-left: 1px solid #e9ecef;
}

.toc h6 {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #6c757d !important;
  margin-bottom: 1rem;
}

.toc a {
  display: block;
  padding: 0.25rem 0;
  color: #6c757d;
  font-size: 0.875rem;
  line-height: 1.5;
  transition: color 0.2s ease;
}

.toc a:hover {
  color: #0066cc;
  text-decoration: none;
}

.toc .ms-2 {
  padding-left: 1rem;
  font-size: 0.825rem;
}

.toc .ms-3 {
  padding-left: 2rem;
  font-size: 0.8rem;
}

/* Lists */
main ul,
main ol {
  margin-bottom: 1rem;
  padding-left: 2rem;
}

main li {
  margin-bottom: 0.25rem;
  line-height: 1.7;
  color: #495057;
}

/* Blockquotes */
blockquote {
  margin: 1rem 0;
  padding: 0.5rem 1rem;
  border-left: 4px solid #0066cc;
  background-color: #f8f9fa;
  color: #495057;
}

.collapse-arrow {
  transition: transform 0.3s ease;
}
button[aria-expanded="true"] .collapse-arrow {
  transform: rotate(180deg);
}

.accordion-body {
  background-color: transparent !important;
  border: none !important;
  padding-top: 10px !important;
}

.accordion-body a {
  margin-bottom: 5px;
  padding-left: 10px !important;
  border: none !important;
  background-color: transparent !important;
}
 
.accordion-body a.active {
  color: #36a1ff !important;
  font-weight: 500;
}

.accordion-button:not(.collapsed) {

	box-shadow: none !important; 
}

.accordion-item {
  margin-bottom: 20px;
}
.accordion-item button {
  border: none !important;
  font-weight: 600;
  border-radius: 0 !important;
}
.accordion-item button:hover {
color: #36a1ff !important;
}
.accordion-item button:focus {
  border: none !important;
}

.accordion-button:focus {
	z-index: 3;
	outline: 0;
	box-shadow: none !important
}

.accordion-button , .accordion  , .accordion-body {
  background-color: #f8f9fa !important;
}

.accordion-button::after {
	/* flex-shrink: 0; */
	width: var(--bs-accordion-btn-icon-width);
	height: var(--bs-accordion-btn-icon-width);
	margin-left: auto;
	content: "";
	background-image: var(--bs-accordion-btn-icon);
	background-repeat: no-repeat;
	background-size: var(--bs-accordion-btn-icon-width);
	transition: var(--bs-accordion-btn-icon-transition);
}

body.cDarkMode main {
  background-color: #0d1117;
}

body.cDarkMode {
  background-color: #0d1117;
}

body.cDarkMode .toc , body.cDarkMode .sidebar  {
background-color: #0d1117 !important;
}

body.cDarkMode .border-start {
  border-left: 1px solid #0d1117 !important;
}

body.cDarkMode p , body.cDarkMode li , body.cDarkMode tbody, body.cDarkMode td, body.cDarkMode tfoot, body.cDarkMode th, body.cDarkMode thead, body.cDarkMode tr {
	color: #B7B7B7 !important;
}

body.cDarkMode .accordion-button ,body.cDarkMode .accordion  , body.cDarkMode .accordion-body {
  background-color: #0d1117 !important;
}

body.cDarkMode .accordion-item button {
color: #B7B7B7 !important;
}

body.cDarkMode .accordion-button::after {
  --bs-accordion-btn-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 16 16'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

body.cDarkMode .accordion-button:not(.collapsed)::after {
  --bs-accordion-btn-active-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 16 16'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

/* Dark Mode: Fenced Code Blocks */
body.cDarkMode .highlighter-rouge .highlight {
  background-color: #2c3035;
  color: #dcdcdc;
}

/* Dark Mode: Inline Code */
body.cDarkMode code.highlighter-rouge.language-plaintext {
  background-color: #ffffff1a;
  color: #c9d1d9;
  border: 1px solid #ffffff1a;
}

body.cDarkMode  .toc a {
  color: #B7B7B7 !important;

}

body.cDarkMode  p a  {
  color: #B7B7B7 !important;

}

body.cDarkMode .accordion-body a.active {
  color: #36a1ff !important;
  font-weight: 500;
}


body.cDarkMode .sidebar {
	position: sticky;
	top: 56px;
	height: calc(100vh - 56px);
	overflow-y: auto;
	background-color: #f8f9fa;
	border-right: 1px solid #22282d;
}

/* Copy Button Styles with Icon */
.copy-btn {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  width: 1.75rem;
  height: 1.75rem;
  background: rgba(45, 48, 53, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 10;
  backdrop-filter: blur(4px);
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

.copy-btn:active {
  transform: translateY(1px);
}

.copy-btn.copied {
  background: #28a745;
  border-color: #28a745;
}

.copy-btn svg {
  width: 1rem;
  height: 1rem;
  fill: #dcdcdc;
  transition: fill 0.2s ease;
}

.copy-btn:hover svg {
  fill: #ffffff;
}

.copy-btn.copied svg {
  fill: white;
}

/* Dark mode copy button adjustments */
body.cDarkMode .copy-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

body.cDarkMode .copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

body.cDarkMode .copy-btn svg {
  fill: #dcdcdc;
}

body.cDarkMode .copy-btn:hover svg {
  fill: #ffffff;
}

body.cDarkMode .copy-btn.copied {
  background: #28a745;
  border-color: #28a745;
}

body.cDarkMode .copy-btn.copied svg {
  fill: white;
}

.cDocsMenu  {
  border: 1px solid #d9d9d9;
  padding: 5px 15px;
  width: auto;
  border-radius: 10px;
  margin-top: 10px;
  margin-left: 5px;
  text-decoration: none !important;
  color: #000;
  line-height: 30px;
  display: none;

}

body.cDarkMode .cDocsMenu  {
  border: 1px solid #d9d9d9;
  color: #fff;

}

.cDocsMenu img {
height: 30px;
width: 30px;
margin-left: 10px;

}

body.cDarkMode .cDocsMenu img {
filter: invert(1);

}


/* #mainAccordion a {
color: #B7B7B7;
} */

/* Responsive */
@media (max-width: 998px) {
  .sidebar {
    position: relative;
    height: auto;
    top: auto;
    display: none !important;
  }
  .cDocsMenu {
    display: block;
    margin-bottom: 10px;
  }

  .sidebar.cShow {
    display:block !important;
    position: static !important;
  }

  .toc {
    display: none;
  }

  main.py-4 {
    padding: 1.5rem !important;
  }
}
