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

.keybinds-list {
  display: flex;
  flex-direction: column;
  /* overwrite default`margin` and `padding` for the <ul> element */
  margin: 0;
  padding: 0;
}

.keybinds-list-item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  /* Default to 315px min-width on desktop, but on narrow viewports shrink to fit
   * within --dialog-max-width minus var(--sys-size-13) (16px left + 16px right dialog padding). */
  min-width: min(315px, calc(var(--dialog-max-width, 1000px) - var(--sys-size-13)));
  gap: var(--sys-size-4);
  border-bottom: var(--sys-size-1) solid var(--sys-color-divider);
  padding: var(--sys-size-4) 0;

  &:last-of-type {
    border-bottom: unset;
  }

  .keybinds-list-title {
    display: flex;
    align-items: center;
    min-height: var(--sys-size-11); /* IMPORTANT: this has to be at least the same height as .keybinds-key to maintain text alignment */
    white-space: normal;
    overflow-wrap: break-word;
    flex: 1 1 120px;
  }
}

.row-container {
  display: flex;
  gap: var(--sys-size-5);
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;

  .keybinds-join-text, .footnote {
    color: var(--sys-color-on-surface-subtle);
  }

  .footnote {
    display: block;
    height: 15px;
  }
}

.shortcuts-for-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--sys-size-3);
  max-width: 100%;
}

.nav-radio-buttons {
  display: flex;
  flex-direction: column;
  border-bottom: var(--sys-size-1) solid var(--sys-color-divider);
  padding-bottom: var(--sys-size-5);

  & label {
    display: flex;
    font: var(--sys-typescale-body3-regular);
    gap: var(--sys-size-2);
  }

  input[type="radio"] {
    margin-left: 0;
  }
}

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