/* Styles for favorite queries component */

.favorite-queries__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin-left: 4px;
  padding: 0;
  border: none;
  background: transparent;
  color: black;
  cursor: pointer;
}

.favorite-queries {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1000;
  margin-top: 1px;
  background-color: white;
  border: 1px solid var(--se-divider, #e6e6e6);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  max-height: 320px;
  overflow-y: auto;
}

.favorite-queries[hidden] {
  display: none;
}

.favorite-queries__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.favorite-queries__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--se-divider, #e6e6e6);
}

.favorite-queries__item:last-child {
  border-bottom: none;
}

.favorite-queries__query {
  flex: 1;
  min-width: 0;
  text-align: left;
  padding: 8px 12px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: medium;
  color: inherit;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.favorite-queries__query:hover,
.favorite-queries__query:focus,
.favorite-queries__query--active {
  background-color: var(--se-alternative-hover, #e6e6e6);
  outline: none;
}

.favorite-queries__delete {
  flex: 0 0 auto;
  margin-right: 6px;
}

/* Search query header shown above the chat on the topics search page. */
.search-query {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.search-query__text {
  font-size: medium;
  /* Cap the visible query to roughly the same number of characters the saved
     query list items show before truncating, so a very long query is shortened
     with an ellipsis instead of rendering in full. */
  max-width: 60ch;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-query__save {
  flex: 0 0 auto;
  cursor: pointer;
}

.search-query__save:focus {
  outline: 1px solid var(--se-primary, #3dcd58);
  outline-offset: 2px;
}

.search-query__save--saved {
  cursor: default;
  opacity: 0.3;
}
