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

/* #css_wrapper_metadata_start
 * #type=style-lit
 * #import=chrome://resources/cr_elements/cr_shared_style_lit.css.js
 * #import=chrome://resources/cr_elements/cr_shared_vars.css.js
 * #import=chrome://resources/cr_elements/md_select_lit.css.js
 * #include=cr-shared-style-lit md-select-lit
 * #css_wrapper_metadata_end */

:host {
  height: 100%;
}

.shortcut-card {
  background-color: var(--cr-card-background-color);
  border-radius: var(--cr-card-border-radius);
  box-shadow: var(--cr-card-shadow);
  color: var(--cr-primary-text-color);
  margin: 0 auto 16px auto;
  padding-bottom: 8px;
  width: var(--cr-toolbar-field-width);
}

.shortcut-card:last-of-type {
  margin-bottom: 64px;
}

#container {
  box-sizing: border-box;
  height: 100%;
  padding-top: 24px;
}

/* Each extension command row is a horizontal flex container containing:
 * 1. The command description (.command-name) on the start side.
 * 2. The shortcut input control group (.shortcut-input-container).
 * 3. The scope dropdown control group (.shortcut-scope-container). */
.command-entry {
  align-items: center;
  display: flex;
  min-height: var(--cr-section-min-height);
  padding-bottom: 8px;
  padding-top: 8px;
}

.command-name {
  flex: 1;
  margin-inline-end: var(--cr-section-padding);
  overflow-wrap: break-word;
}

/* Columnar containers that stack each visual text label directly above its
 * associated form control (<cr-shortcut-input> or <select.md-select>). */
.shortcut-input-container,
.shortcut-scope-container {
  display: flex;
  flex-direction: column;
}

/* Spacing between the shortcut input group and the scope select group. */
.shortcut-input-container {
  margin-inline-end: var(--cr-section-padding);
}

/* Visual text labels ("Type a shortcut" and "Scope") placed above controls.
 * Uses standard Chromium design token --cr-form-field-label-font-size (rem)
 * and secondary text color so that label text scales fluidly with user
 * accessibility font preferences, browser zoom, and high-DPI displays. */
.shortcut-input-label,
.shortcut-scope-label {
  color: var(--cr-secondary-text-color);
  font-size: var(--cr-form-field-label-font-size, 12px);
  font-weight: 500;
  line-height: var(--cr-form-field-label-line-height, 1.25);
  margin-bottom: 4px;
}

.command-entry .md-select {
  /* TODO(johntlee): line-height needs adjustment to fix large fonts. */
  line-height: 22px;
}

.card-title {
  align-items: center;
  border-bottom: var(--cr-separator-line);
  display: flex;
  margin-bottom: 9px;
  padding: 16px var(--cr-section-padding);
}

.icon {
  height: 20px;
  margin-inline-end: 20px;
  width: 20px;
}

.card-controls {
  /* We line up the controls with the name, which is after the
     20px left padding + 20px icon + 20px margin on the icon. */
  margin-inline-end: 20px;
  margin-inline-start: 60px;
}
