:host {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.biel-search-body-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  max-height: var(--biel-search-body-max-height);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 6px 2px 2px;
}

@media screen and (max-width: 768px) {
  .biel-search-body-container {
    /* 100 - padding - header size - powered by extra */
    max-height: calc(100dvh - 40px - 61.5px - var(--powered-by-extra, 0px));
  }
}

.biel-search-body-container::-webkit-scrollbar {
  width: 6px;
}

.biel-search-body-container::-webkit-scrollbar-thumb {
  background-color: var(--biel-chat-scrollbar-color);
  border-radius: 10px;
  border: 3px solid transparent;
}

.biel-search-body-container::-webkit-scrollbar-thumb:hover {
  background-color: var(--biel-chat-scrollbar-hover-color);
}

.biel-search-body__result-list {
  list-style-type: none;
  padding: 0;
  margin: 0;
  line-height: var(--biel-search-line-height);
}

.biel-search-body__result-item {
  margin: 0;
  padding: 0;
  display: flex;
}

.biel-search-body__result {
  width: 100%;
}

/* Todo: move to standalone component, reused between search and chat */
.loading-animation {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  margin-top: 10px;
}

.loading-animation .dot {
  width: 8px;
  height: 8px;
  margin: 0 5px;
  background-color: var(--biel-text-color);
  border-radius: 50%;
  animation: bounce 1.2s infinite ease-in-out;
}

.loading-animation .dot:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-animation .dot:nth-child(2) {
  animation-delay: -0.16s;
}

.loading-animation .dot:nth-child(3) {
  animation-delay: 0s;
}

@keyframes bounce {
  0%,
  80%,
  100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* Toctree styles */
.biel-search-body__result-group {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}

.biel-search-toctree-page-title {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background-color: var(--biel-search-toctree-page-bg-color);
  border: 1px solid var(--biel-search-toctree-page-border-color);
  border-radius: var(--biel-search-result-border-radius);
  margin-bottom: 4px;
  font-weight: var(--biel-search-toctree-page-title-font-weight);
  color: var(--biel-search-toctree-page-text-color);
  font-size: var(--biel-search-toctree-page-title-font-size);
  cursor: pointer;
  transition: background-color 0.2s ease;
  height: var(--biel-search-toctree-title-height);
}

.biel-search-toctree-page-title:hover, .biel-search-toctree-page-title.selected {
  background-color: var(--biel-search-result-bg-hover-color);
}

.biel-search-toctree-page-title:first-of-type {
  margin-top: 6px;
}

.biel-search-toctree-title {
  flex: 1;
}

.biel-search-toctree-count {
  font-size: var(--biel-search-toctree-count-font-size);
  font-weight: normal;
  color: var(--biel-search-toctree-count-color);
  margin-left: 8px;
}

.biel-search-result__mark {
  color: var(--biel-search-result-mark-color);
  background-color: transparent;
  text-decoration: underline;
}

.biel-search-toctree-items {
  list-style-type: none;
  padding: 0;
  margin: 0;
  margin-left: 20px;
  position: relative;
}

.biel-search-toctree-item {
  margin: 0;
  padding: 0;
  display: flex;
  position: relative;
}

.biel-search-toctree-item::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 0;
  width: 2px;
  height: 50%;
  background-color: var(--biel-search-toctree-border-color);
}


.biel-search-toctree-item:not(:last-child)::before {
  height: 100%;
}

.biel-search-toctree-result {
  width: 100%;
  margin-left: 12px;
}
