/* Accordion styling for TOC */
.p-accordion {
  width: 100%;
}

.p-accordion__list {
  list-style-type: none;
  margin: 0;
  padding: 0;
}

.p-accordion__group {
  border-bottom: 1px solid #e5e5e5;
}

.dark-mode .p-accordion__group {
  border-bottom-color: #3a3a3a;
}

.p-accordion__heading {
  margin: 0;
  padding: 0;
}

.p-accordion__tab {
  background: none;
  border: 0;
  color: #267CB9;
  cursor: pointer;
  font-size: 1em;
  font-weight: 500;
  margin: 0;
  padding: 1rem 0.5rem;
  text-align: left;
  width: 100%;
  position: relative;
}

.dark-mode .p-accordion__tab {
  color: #58a6ff;
}

.p-accordion__tab:hover {
  color: #0056b3;
  background-color: rgba(0, 0, 0, 0.03);
}

.dark-mode .p-accordion__tab:hover {
  color: #80bdff;
  background-color: rgba(255, 255, 255, 0.03);
}

.p-accordion__tab::after {
  content: '';
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid #267CB9;
  border-bottom: 2px solid #267CB9;
  transition: transform 0.2s;
}

.dark-mode .p-accordion__tab::after {
  border-right-color: #58a6ff;
  border-bottom-color: #58a6ff;
}

.p-accordion__tab[aria-expanded="true"]::after {
  transform: translateY(-50%) rotate(-135deg);
}

.p-accordion__panel {
  background-color: #f9f9f9;
  padding: 0 1rem;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.dark-mode .p-accordion__panel {
  background-color: #252526;
}

.p-accordion__panel[aria-hidden="false"] {
  max-height: 500px; /* Adjust as needed */
  padding: 1rem;
}

.p-accordion__panel ul {
  margin: 0;
  padding-left: 1rem;
}

.p-accordion__panel li {
  margin-bottom: 0.5rem;
}

.p-accordion__panel a {
  color: #267CB9;
  text-decoration: none;
}

.dark-mode .p-accordion__panel a {
  color: #58a6ff;
}

.p-accordion__panel a:hover {
  text-decoration: none;
  color: #0056b3;
}

.dark-mode .p-accordion__panel a:hover {
  color: #80bdff;
}
