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

:host {
  padding: 0;
  margin: 0;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center !important; /* stylelint-disable-line declaration-no-important */
  overflow: hidden;
  white-space: nowrap;
}

input {
  height: 12px;
  width: 12px;
  flex-shrink: 0;
  accent-color: var(--sys-color-primary-bright);
  color: var(--sys-color-on-primary);
}

:host(:not(.small)) input:not(.small) {
  margin: 6px;
}

:host(.inside-datagrid) input {
  height: 10px;
  width: 10px;
}

.devtools-checkbox-text {
  overflow: hidden;
  text-overflow: ellipsis;

  input:disabled ~ & {
    opacity: 38%;
  }
}

.devtools-checkbox-subtitle {
  color: var(--sys-color-token-subtle);
  white-space: break-spaces;
}

@media (forced-colors: active) {
  input.devtools-checkbox-theme-preserve {
    forced-color-adjust: none;
  }

  input.devtools-checkbox-theme-preserve:active {
    background: HighlightText;
  }

  input.devtools-checkbox-theme-preserve:checked,
  input.devtools-checkbox-theme-preserve:active:checked {
    background: Highlight;
    border-color: Highlight;
  }

  input.devtools-checkbox-theme-preserve:hover:enabled {
    border-color: Highlight;
  }

  input.devtools-checkbox-theme-preserve:active::before,
  input.devtools-checkbox-theme-preserve:active::after {
    background-color: Highlight;
  }

  input.devtools-checkbox-theme-preserve:checked::before,
  input.devtools-checkbox-theme-preserve:checked::after,
  input.devtools-checkbox-theme-preserve:active:checked::before,
  input.devtools-checkbox-theme-preserve:active:checked::after {
    background-color: HighlightText;
  }

  input.devtools-checkbox-theme-preserve:hover:checked::before,
  input.devtools-checkbox-theme-preserve:hover:checked::after {
    background-color: Highlight !important; /* stylelint-disable-line declaration-no-important */
  }

  input.devtools-checkbox-theme-preserve:hover:checked {
    background: HighlightText;
  }
}
