/*
 * Copyright 2013 The Chromium Authors
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

.filter-bar,
.filter-bar.hbox {
  background-color: var(--sys-color-cdt-base-container);
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  border-bottom: 1px solid var(--sys-color-divider);
  color: var(--sys-color-on-surface-subtle);
}

.text-filter {
  flex-grow: 1;
  min-width: var(--sys-size-25);
  max-width: var(--sys-size-36);
}

.filter-bitset-filter {
  padding: 2px;
  display: inline-flex;
  overflow: hidden;
  min-height: var(--sys-size-11);
  height: auto;
  flex-wrap: wrap;
  row-gap: var(--sys-size-2);
  position: relative;
  margin: 0;
}

.filter-bitset-filter span {
  color: var(--sys-color-on-surface);
  outline: 1px solid var(--sys-color-neutral-outline);
  outline-offset: -1px;
  box-sizing: border-box;
  display: inline-block;
  flex: none;
  margin: auto 2px;
  padding: 3px 6px;
  background: transparent;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  font-weight: 500;
  font-size: 11px;
}

.filter-bitset-filter span:focus-visible {
  outline: var(--sys-size-2) solid var(--sys-color-state-focus-ring);
}

.filter-bitset-filter span:hover {
  background: var(--sys-color-state-hover-on-subtle);
}

.filter-bitset-filter span:hover:not(:focus-visible) {
  outline: none;
}

.filter-bitset-filter span.selected,
.filter-bitset-filter span:active {
  color: var(--sys-color-on-tonal-container);
  background-color: var(--sys-color-tonal-container);
}

.filter-bitset-filter span.selected:not(:focus-visible),
.filter-bitset-filter span:active:not(:focus-visible) {
  outline: none;
}

.filter-bitset-filter-divider {
  background-color: var(--sys-color-divider);
  height: 16px;
  width: 1px;
  margin: auto 2px;
  display: inline-block;
}

.filter-checkbox-filter {
  padding-left: 1px;
  padding-right: 7px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  display: inline-flex;
  vertical-align: middle;
  height: 24px;
  position: relative;
}

.filter-checkbox-filter > devtools-checkbox {
  display: flex;
  margin: auto 0;
}

.toolbar-has-dropdown-shrinkable {
  flex-shrink: 1;
}

.filter-divider {
  background-color: var(--sys-color-divider);
  width: 1px;
  margin: 5px 4px;
  height: 16px;
}

.toolbar-button {
  white-space: nowrap;
  overflow: hidden;
  min-width: 28px;
  background: transparent;
  border-radius: 0;
}

.toolbar-button .active-filters-count {
  margin-right: 5px;

  --override-adorner-background-color: var(--sys-color-tonal-container);
  --override-adorner-border-color: var(--sys-color-tonal-container);
  --override-adorner-text-color: var(--sys-color-primary);
  --override-adorner-font-size: 10px;

  font-weight: 700;
}

.toolbar-text {
  margin: 0 4px 0 0;
  text-overflow: ellipsis;
  flex: auto;
  overflow: hidden;
  text-align: right;
}

.dropdown-filterbar {
  justify-content: space-between;
  align-items: center;
  height: var(--sys-size-9);
  margin: 0 var(--sys-size-3) 0 var(--sys-size-5);
  border: none;
  border-radius: var(--sys-shape-corner-extra-small);
  display: flex;
  background-color: transparent;
  color: var(--sys-color-on-surface-subtle);

  .toolbar-dropdown-arrow {
    top: var(--sys-size-1);
  }

  &:hover {
    background-color: var(--sys-color-state-hover-on-subtle);
  }

  &:active {
    background-color: var(--sys-color-state-ripple-neutral-on-subtle);
  }

  &:hover:active {
    background:
      linear-gradient(var(--sys-color-state-hover-on-subtle), var(--sys-color-state-hover-on-subtle)),
      linear-gradient(var(--sys-color-state-ripple-neutral-on-subtle), var(--sys-color-state-ripple-neutral-on-subtle));
  }

  &:focus-visible {
    outline: 2px solid var(--sys-color-state-focus-ring);
  }
}

@media (forced-colors: active) {
  .filter-bitset-filter span:hover,
  .filter-bitset-filter span.selected,
  .filter-bitset-filter span:active {
    forced-color-adjust: none;
    background: Highlight;
    color: HighlightText;
  }
}
