/*
 * Copyright (c) 2015 The Chromium Authors. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

:host {
  width: 270px;
  height: 350px;
  user-select: none;
  padding: 16px;
  overflow: hidden;
}

.bezier-preset-selected > svg {
  background-color: var(--legacy-selection-bg-color);
}

.bezier-container {
  --override-bezier-control-color: #9c27b0;

  display: flex;
  margin-top: 38px;
}

.-theme-with-dark-background .bezier-container,
:host-context(.-theme-with-dark-background) .bezier-container {
  --override-bezier-control-color: rgb(196 79 216);
}

.bezier-preset {
  width: 50px;
  height: 50px;
  padding: 5px;
  margin: auto;
  background-color: var(--color-background-elevation-1);
  border-radius: 3px;
}

.bezier-preset line.bezier-control-line {
  stroke: var(--color-text-secondary);
  stroke-width: 1;
  stroke-linecap: round;
  fill: none;
}

.bezier-preset circle.bezier-control-circle {
  fill: var(--color-text-secondary);
}

.bezier-preset path.bezier-path {
  stroke: var(--color-background-inverted);
  stroke-width: 2;
  stroke-linecap: round;
  fill: none;
}

.bezier-preset-selected path.bezier-path,
.bezier-preset-selected line.bezier-control-line {
  stroke: var(--color-background);
}

.bezier-preset-selected circle.bezier-control-circle {
  fill: var(--color-background);
}

.bezier-curve line.linear-line {
  stroke: var(--color-background-elevation-2);
  stroke-width: 2;
  stroke-linecap: round;
  fill: none;
}

.bezier-curve line.bezier-control-line {
  stroke: var(--override-bezier-control-color);
  stroke-width: 2;
  stroke-linecap: round;
  fill: none;
  opacity: 60%;
}

.bezier-curve circle.bezier-control-circle {
  fill: var(--override-bezier-control-color);
  cursor: pointer;
}

.bezier-curve path.bezier-path {
  stroke: var(--color-background-inverted);
  stroke-width: 3;
  stroke-linecap: round;
  fill: none;
}

.bezier-preview-container {
  position: relative;
  background-color: var(--color-background);
  overflow: hidden;
  border-radius: 20px;
  width: 200%;
  height: 20px;
  z-index: 2;
  flex-shrink: 0;
  opacity: 0%;
}

.bezier-preview-animation {
  background-color: #9c27b0; /* stylelint-disable-line plugin/use_theme_colors */
  /* See: crbug.com/1152736 for color variable migration. */
  width: 20px;
  height: 20px;
  border-radius: 20px;
  position: absolute;
}

.bezier-preview-onion {
  margin-top: -20px;
  position: relative;
  z-index: 1;
}

.bezier-preview-onion > .bezier-preview-animation {
  opacity: 10%;
}

svg.bezier-preset-modify {
  background-color: var(--color-background-elevation-1);
  border-radius: 35px;
  display: inline-block;
  visibility: hidden;
  transition: transform 100ms cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: absolute;
}

svg.bezier-preset-modify:hover,
.bezier-preset:hover {
  background-color: var(--color-background-elevation-2);
}

.bezier-preset-selected .bezier-preset:hover {
  background-color: var(--legacy-selection-bg-color);
}

.bezier-preset-modify path {
  stroke-width: 2;
  stroke: var(--color-background-inverted);
  fill: none;
}

.bezier-preset-selected .bezier-preset-modify {
  opacity: 100%;
}

.bezier-preset-category {
  width: 50px;
  margin: 20px 0;
  cursor: pointer;
  transition: transform 100ms cubic-bezier(0.4, 0, 0.2, 1);
}

span.bezier-display-value {
  width: 100%;
  user-select: text;
  display: block;
  text-align: center;
  line-height: 20px;
  height: 20px;
  cursor: text;
  white-space: nowrap !important; /* stylelint-disable-line declaration-no-important */
}

svg.bezier-curve {
  margin-left: 32px;
  margin-top: -8px;
}

svg.bezier-preset-modify.bezier-preset-plus {
  right: 0;
}

.bezier-header {
  margin-top: 16px;
}

svg.bezier-preset-modify:active {
  transform: scale(1.1);
  background-color: var(--legacy-selection-bg-color);
}

.bezier-preset-category:active {
  transform: scale(1.05);
}

.bezier-header-active > svg.bezier-preset-modify {
  visibility: visible;
}

.bezier-preset-modify:active path {
  stroke: var(--color-background);
}
