/* Keep Pagefind UI consistent with doxygen-awesome look */

#pagefind-search {
  width: 300px;
  min-width: 300px;
  padding-left: 0;
  position: relative;
  margin-top: 8px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Make it sit nicely in the title bar */
#pagefind-search .pagefind-ui__form {
  margin: 0;
  position: relative;
  width: 100%;
}

#pagefind-search .pagefind-ui__search-input {
  width: 100%;
  height: 40px;
  border-radius: 20px;
  font-size: 14px;
  line-height: 33px;
  padding: 0 12px 0 0;
  box-sizing: border-box;
  padding-left: 25px !important;
}

/* Search icon positioning - 4px from left inside the input */
#pagefind-search .pagefind-ui__search-input::before,
#pagefind-search .pagefind-ui__form::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 16px;
  z-index: 10;
}

/* Alternative: if pagefind has a specific icon element */
#pagefind-search svg[aria-label*="search"],
#pagefind-search svg[class*="search"] {
  position: absolute !important;
  left: 20px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  margin: 0 !important;
}

#pagefind-search .pagefind-ui__drawer {
  z-index: 20000; /* above doxygen header + content */
}

/*
 * In the sidebar-only layout, doxygen-awesome sets `#top { overflow: hidden; }`.
 * Pagefind UI renders the result list right under the input, so it gets clipped
 * and you only see the "Found N results" message.
 * Allow overflow + present results as a dropdown.
 */
#top,
#titlearea,
#titlearea table,
#titlearea table tbody,
#titlearea table tbody tr {
  overflow: visible !important;
}

#pagefind-search .pagefind-ui__drawer {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  /* width: min(720px, 92vw); */
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--page-background-color, #fff);
  box-shadow: var(--box-shadow, 0 2px 8px rgba(0, 0, 0, 0.12));
  border: 1px solid var(--separator-color, #dedede);
  width: 265px;
  border-radius: 8px !important;
  border: 1px solid rgb(204, 204, 204) !important;
}

#pagefind-search .pagefind-ui__results-area {
  margin-top: 0;
  min-width: 0;
}

#pagefind-search .pagefind-ui__message {
  padding: 8px 0;
}

/* Slightly narrower results for docs layout */
#pagefind-search .pagefind-ui__results {
  max-height: 60vh;
  overflow: auto;
}
.pagefind-ui__search-clear {
  height: 33px !important;
  line-height: 33px !important;
  background-color: transparent !important;
}
.pagefind-ui__results.svelte-e9gkc3 {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.3) rgba(0, 0, 0, 0.05);
}

.pagefind-ui__results.svelte-e9gkc3::-webkit-scrollbar {
  width: 6px;
}

.pagefind-ui__results.svelte-e9gkc3::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
}

.pagefind-ui__results.svelte-e9gkc3::-webkit-scrollbar-track {
  background-color: rgba(0, 0, 0, 0.05);
}
