/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

:host {
  border-inline-end: 1px solid var(--border-color);
  background-color: var(--background-color-box);
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.meta {
  display: flex;
  align-items: center;
  padding: 0 16px 16px;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--background-color-box);
}

.meta > label > span {
  margin-inline-end: 2px;
}

#login-sort {
  --logical-padding: 0px;
  margin: 0;
  background-color: transparent;
  color: var(--button-text-color-ghost);
}

#login-sort:hover:not([disabled]) {
  color: var(--button-text-color-ghost-hover);
  background-color: var(--button-background-color-ghost-hover);
}

#login-sort > option {
  font-weight: var(--font-weight);
}

.count {
  flex-grow: 1;
  text-align: end;
  margin-inline-start: 18px;
}

.container {
  display: contents;
}

.listHeader {
  display: flex;
  justify-content: center;
  align-content: center;
  gap: 16px;
  padding: 16px;
}

:host(.no-logins) .empty-search-message,
:host(:not(.empty-search)) .empty-search-message,
:host(.empty-search:not(.create-login-selected)) ol,
:host(.no-logins:not(.create-login-selected)) ol,
:host(:not(.no-logins)) .intro,
:host(.create-login-selected) .intro,
:host(.create-login-selected) .empty-search-message {
  display: none;
}

:host(:not(.initialized)) .count,
:host(:not(.initialized)) .empty-search-message {
  visibility: hidden;
}

.empty-search-message,
.intro {
  text-align: center;
  padding: 1em;
  max-width: 50ch; /* This should be kept in sync with login-list-item username and title max-width */
  flex-grow: 1;
  border-bottom: 1px solid var(--border-color);
}

.empty-search-message span,
.intro span {
  font-size: 0.85em;
}

ol {
  outline-offset: var(--focus-outline-inset);
  margin-block: 0;
  padding-inline-start: 0;
  overflow: hidden auto;
  flex-grow: 1;
  scroll-padding-top: 24px; /* there is the section header that is sticky to the top */
}

.login-list-item {
  display: flex;
  align-items: center;
  padding-block: 10px;
  padding-inline: 12px 18px;
  border-inline-start: 4px solid transparent;
  user-select: none;
}

.login-list-header {
  display: block;
  position: sticky;
  top: 0;
  font-size: 0.85em;
  font-weight: var(--heading-font-weight);
  padding: 4px 16px;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--background-color-box);
  margin-block-start: 2px;
  margin-inline: 2px;
}

.login-list-item:not(.selected):hover {
  background-color: var(--button-background-color-hover);
  color: var(--button-text-color-hover);
}

.login-list-item:not(.selected):hover:active {
  background-color: var(--button-background-color-active);
  color: var(--button-text-color-active);
}

.login-list-item.keyboard-selected {
  border-inline-start-color: var(--border-color);
  background-color: var(--button-background-color-hover);
}

.login-list-item.selected {
  border-inline-start-color: var(--border-color-selected);
  background-color: var(--background-color-canvas);
}

.login-list-item.selected .title {
  font-weight: var(--heading-font-weight);
}

.labels {
  flex-grow: 1;
  overflow: hidden;
  min-height: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.favicon {
  height: 16px;
  width: 16px;
  margin-inline-end: 12px;
  -moz-context-properties: fill, fill-opacity;
  fill: currentColor;
  fill-opacity: 0.8;
}

.username {
  font-size: 0.85em;
  color: var(--text-color-deemphasized);
}
