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

.shortcut-list {
  padding-left: 0;
  padding-right: 0;
}

.keybinds-key {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--sys-size-11);
  min-width: var(--sys-size-11);
  font: var(--sys-typescale-body5-medium);
  white-space: nowrap;
  border-radius: var(--sys-shape-corner-small);
  background: var(--sys-color-tonal-container);
  padding: 0 var(--sys-size-4);
}

.keybinds-list-item {
  margin: 0 var(--sys-size-6);
  padding: var(--sys-size-4) 0;
  display: grid;
  grid-template-rows: 1fr;
  grid-template-columns: 1fr 30px 2fr 30px 30px;
  border-top: var(--sys-size-1) solid var(--app-color-card-divider);
}

.keybinds-list-item:focus-visible {
  background-color: var(--sys-color-tonal-container);
}

.keybinds-list-item.keybinds-editing {
  background-color: var(--sys-color-neutral-container);
}

.keybinds-list-text.keybinds-action-name {
  grid-row: 1 / 1;
}

.keybinds-shortcut,
.keybinds-info {
  grid-row: auto;
  grid-column: 3 / span 1;
}

.keybinds-error {
  color: var(--sys-color-error);
}

.keybinds-shortcut {
  gap: var(--sys-size-4);
}

.keybinds-list-item.keybinds-editing .keybinds-shortcut {
  display: flex;
}

.keybinds-modified {
  grid-column: 2 / span 1;
  margin-top: var(--sys-size-3);
}

.keybinds-list-item button[disabled] {
  opacity: 40%;
}

.keybinds-cancel-button {
  grid-column: -1 / span 1;
}

.keybinds-edit-button {
  display: none;
  grid-row: 1 / span 1;
  grid-column: 5 / span 1;
}

.keybinds-list-item:not(.keybinds-editing):hover .keybinds-edit-button,
.keybinds-list-item:not(.keybinds-editing):focus-within .keybinds-edit-button {
  display: inline-block;
}

.keybinds-list-text {
  min-height: var(--sys-size-12);
  display: flex;
  align-items: center;
  user-select: none;
  color: var(--sys-color-on-surface);
  text-align: start;
  position: relative;
  margin-right: 0;
}

.keybinds-category-header {
  display: flex;
  align-items: center;
  font: var(--sys-typescale-body4-bold);
  height: var(--sys-size-13);
  padding: var(--sys-size-4) var(--sys-size-7);
  white-space: nowrap;

  + .keybinds-list-item-wrapper > .keybinds-list-item {
    border-top: unset;
  }
}

.keybinds-list-item-wrapper:has(.keybinds-list-item:hover),
.keybinds-list-item-wrapper:has(
  .keybinds-list-item:not(.keybinds-editing)):focus-within {
  background: var(--sys-color-state-hover-on-subtle);
}

.keybinds-set-select label p {
  display: inline;
  color: var(--sys-color-on-surface);
}

button.text-button {
  width: fit-content;
  align-self: flex-end;
}

.keybinds-list-text input {
  margin: 0 2px;
}

.keybinds-set-select {
  margin: 0;
  padding: var(--sys-size-5) var(--sys-size-7);

  & .settings-select {
    display: flex;
    justify-content: space-between;

    & label {
      padding: 0;
    }
  }
}

.keybinds-list-text:has(.keybinds-delete-button) {
  grid-column: 3 / -1;
}

.docs-link.devtools-link {
  align-self: flex-start;
  min-height: 2em;
  line-height: 2em;
  margin-bottom: 4px;
}

.keybinds-footer {
  padding: var(--sys-size-5) var(--sys-size-7);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  min-height: fit-content;
  margin-top: 10px;
}
