/* ===================================================
   Sidebar Quick Search
   Palette: bg #2a3042 | text #a6b0cf | sub #79829c
   =================================================== */

/* ---- Container ---- */
.sidebar-search-box {
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  margin-bottom: 2px;
}

/* ---- Input wrapper ---- */
.sidebar-search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background-color: #212636;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.sidebar-search-input-wrapper:focus-within {
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

/* ---- Search icon ---- */
.sidebar-search-icon {
  position: absolute;
  left: 11px;
  color: #6a7187;
  font-size: 16px;
  pointer-events: none;
  transition: color 0.2s ease;
  line-height: 1;
}

.sidebar-search-input-wrapper:focus-within .sidebar-search-icon {
  color: #a6b0cf;
}

/* ---- Text input ---- */
.sidebar-search-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  padding: 8px 32px 8px 36px;
  color: #a6b0cf;
  font-size: 13px;
  line-height: 1.4;
  font-family: inherit;
  caret-color: #a6b0cf;
}

.sidebar-search-input::placeholder {
  color: #6a7187;
}

.sidebar-search-input::-webkit-search-cancel-button {
  display: none;
}

/* ---- Clear button ---- */
.sidebar-search-clear {
  position: absolute;
  right: 7px;
  background: rgba(255, 255, 255, 0.07);
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  padding: 0;
  cursor: pointer;
  color: #79829c;
  font-size: 13px;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
  flex-shrink: 0;
}

.sidebar-search-clear:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.sidebar-search-clear.visible {
  display: flex;
}

/* ---- No-results message ---- */
.sidebar-search-no-results {
  margin: 8px 2px 0;
  font-size: 12px;
  color: #6a7187;
  text-align: center;
  padding: 6px 0 2px;
  display: none;
  letter-spacing: 0.01em;
}

.sidebar-search-no-results i {
  display: block;
  font-size: 22px;
  margin-bottom: 4px;
  color: #4a5168;
}

/* ===================================================
   Menu items behaviour during search
   =================================================== */

/* Hide non-matching items */
#side-menu li.search-hidden {
  display: none !important;
}

/* Highlight matched parent group labels */
#side-menu li.search-parent-visible > a {
  color: #c8cee0 !important;
}

/* Matched leaf items */
#side-menu li.search-match > a {
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 5px;
  color: #fff !important;
}

/* Mark highlight */
#side-menu li.search-match > a mark,
#side-menu li.search-parent-visible > a mark {
  background-color: rgba(255, 210, 60, 0.28);
  color: #fff;
  border-radius: 3px;
  padding: 0 2px;
  font-style: normal;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255, 210, 60, 0.3);
}

/* Expand sub-menus automatically while searching */
#side-menu.searching .sub-menu {
  display: block !important;
}

/* Collapse arrow animation for open sub-menus during search */
#side-menu.searching li.search-parent-visible > a.has-arrow::after {
  transform: rotate(-180deg);
}

/* Keyboard navigation highlight (Tab/ArrowDown cycling) */
#side-menu a.search-keyboard-focus {
  background-color: rgba(255, 255, 255, 0.12) !important;
  outline: 2px solid rgba(255, 255, 255, 0.3);
  outline-offset: -2px;
  border-radius: 5px;
  color: #fff !important;
}
