/*
 * 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.
 */

.editing {
  box-shadow: var(--drop-shadow);
  background-color: var(--sys-color-cdt-base-container);
  text-overflow: clip !important; /* stylelint-disable-line declaration-no-important */
  padding-left: 2px;
  margin-left: -2px;
  padding-right: 2px;
  margin-right: -2px;
  margin-bottom: -1px;
  padding-bottom: 1px;
  opacity: 100% !important; /* stylelint-disable-line declaration-no-important */
}

.editing,
.editing * {
  color: var(--sys-color-on-surface) !important; /* stylelint-disable-line declaration-no-important */
  text-decoration: none !important; /* stylelint-disable-line declaration-no-important */
}

.editing br {
  display: none;
}

.adorner-reveal {
  vertical-align: middle;
  margin: 0 3px;
}

.adorner-with-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  height: 100%;

  devtools-icon {
    width: var(--sys-size-6);
    height: var(--sys-size-6);
    color: var(--icon-primary);
  }
}

.adorner-with-icon *:not(:last-child) {
  margin-right: 2px;
}

.elements-disclosure {
  width: 100%;
  display: inline-block;
  line-height: normal;
}

.elements-disclosure li {
  /** Keep margin-left & padding-left in sync with ElementsTreeElements.updateDecorations **/
  padding: 1px 0 0 14px;
  margin-left: -2px;
  word-break: normal;
  position: relative;
  min-height: 15px;
  line-height: 1.36;
  min-width: 200px;
}

.elements-disclosure li::after {
  content: "";
  position: absolute;
  inset: 0;
  left: calc(var(--indent) * -1);
  width: var(--indent);
}

.elements-disclosure li.parent {
  display: flex;
}

.elements-disclosure li.parent:not(.always-parent) {
  /** Keep it in sync with ElementsTreeElements.updateDecorations **/
  margin-left: -12px;
}

.elements-disclosure li .ai-button-container {
  display: none;
  margin-left: 1ch;
  overflow: visible;
  max-height: var(--sys-size-6);
  vertical-align: top;
  margin-top: -1px;
  position: absolute;
  right: var(--sys-size-3);
  bottom: 5px;
  z-index: 999;
}

.elements-disclosure .elements-tree-outline:not(.hide-selection-when-blurred) li.hovered .ai-button-container {
  display: inline-flex;
}

.elements-disclosure li .selected-hint::before {
  font-style: italic;
  content: " == $0";
  opacity: 0%;
  position: absolute;
  white-space: pre;
}

.elements-disclosure .elements-tree-outline:not(.hide-selection-when-blurred) li.selected .selected-hint::before {
  position: static;
  opacity: 60%;
}

.elements-disclosure li.parent:not(.always-parent)::before {
  box-sizing: border-box;
  user-select: none;
  mask-image: var(--image-file-arrow-collapse);
  height: 14px;
  width: 14px;
  content: "\A0\A0";
  color: transparent;
  text-shadow: none;
  margin: -3px var(--sys-size-2) 0 -3px;
  background-color: var(--icon-default);
}

.elements-disclosure li.parent.expanded::before {
  mask-image: var(--image-file-arrow-drop-down);
}

.elements-disclosure li .selection {
  display: none;
  z-index: -1;
}

.elements-disclosure li.selected .selection {
  display: block;
}

.elements-disclosure li.elements-drag-over .selection {
  display: block;
  margin-top: -2px;
  border-top: 2px solid var(--sys-color-primary);
}

.elements-disclosure .elements-tree-outline:not(.hide-selection-when-blurred) .selection {
  background-color: var(--sys-color-neutral-container);
}

.elements-disclosure li.hovered:not(.selected) .selection {
  display: block;
  left: 3px;
  right: 3px;
  background-color: var(--sys-color-state-hover-on-subtle);
  border-radius: 5px;
}

.elements-disclosure li .webkit-html-tag.close {
  margin-left: -12px;
}

.elements-disclosure .elements-tree-outline.hide-selection-when-blurred .selected:focus-visible .highlight > * {
  background: var(--sys-color-state-focus-highlight);
  border-radius: 2px;
  outline: 2px solid var(--sys-color-state-focus-ring);
}

.elements-disclosure .elements-tree-outline:not(.hide-selection-when-blurred) li.selected:focus .selection {
  background-color: var(--sys-color-tonal-container);
}

.elements-disclosure ol {
  list-style-type: none;
  /** Keep it in sync with ElementsTreeElements.updateDecorations **/
  padding-inline-start: 12px;
  margin: 0;
}

.elements-disclosure ol.children {
  display: none;
  min-width: 100%;
}

.elements-disclosure ol.children.expanded {
  display: inline-block;
}

.elements-disclosure > ol {
  position: relative;
  margin: 0;
  min-width: 100%;
  min-height: 100%;
  padding-left: 2px;
}

.elements-disclosure li.in-clipboard .highlight {
  outline: 1px dotted var(--sys-color-divider);
}

.elements-tree-outline ol.shadow-root-deep {
  background-color: transparent;
}

.elements-tree-editor {
  box-shadow: var(--drop-shadow);
  margin-right: 4px;
}

button,
input,
select {
  font-family: inherit;
  font-size: inherit;
}

.elements-gutter-decoration {
  position: absolute;
  top: 3px;
  left: 2px;
  height: 9px;
  width: 9px;
  border-radius: 5px;
  border: 1px solid var(--sys-color-orange-bright);
  background-color: var(--sys-color-orange-bright);
}

.elements-gutter-decoration.elements-has-decorated-children {
  opacity: 50%;
}

.add-attribute {
  margin-left: 1px;
  margin-right: 1px;
  white-space: nowrap;
}

.elements-tree-nowrap,
.elements-tree-nowrap .li {
  white-space: pre !important; /* stylelint-disable-line declaration-no-important */
}

.elements-disclosure .elements-tree-nowrap li {
  overflow-wrap: normal;
}
/* DOM update highlight */
@keyframes dom-update-highlight-animation {
  0% {
    background-color: var(--sys-color-token-tag);
    color: var(--sys-color-cdt-base-container);
  }

  80% {
    background-color: var(--sys-color-token-meta);
  }

  100% {
    background-color: inherit;
  }
}

@keyframes dom-update-highlight-animation-dark {
  0% {
    background-color: var(--sys-color-token-tag);
    color: var(--sys-color-cdt-base-container);
  }

  80% {
    background-color: var(--sys-color-cdt-base-container);
    color: inherit;
  }

  100% {
    background-color: inherit;
  }
}

.dom-update-highlight {
  animation: dom-update-highlight-animation 1.4s 1 cubic-bezier(0, 0, 0.2, 1);
  border-radius: 2px;
}

:host-context(.theme-with-dark-background) .dom-update-highlight {
  animation: dom-update-highlight-animation-dark 1.4s 1 cubic-bezier(0, 0, 0.2, 1);
}

.elements-disclosure.single-node li {
  padding-left: 2px;
}

.elements-tree-shortcut-title,
.elements-tree-shortcut-link {
  color: var(--sys-color-token-subtle);
}

.elements-disclosure .gutter-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 15px;
  height: 15px;
  z-index: 1;
}

.elements-hide-gutter .gutter-container {
  display: none;
}

.gutter-container > devtools-icon {
  display: block;
  visibility: hidden;
  position: relative;
  left: -1px;
  width: 16px;
  height: 16px;
}

.elements-disclosure li.selected .gutter-container:not(.has-decorations) > devtools-icon {
  visibility: visible;
}
/** Guide line */

li.hovered:not(.always-parent) + ol.children,
.elements-tree-outline ol.shadow-root,
li.selected:not(.always-parent) + ol.children {
  background: linear-gradient(to right, var(--override-indentation-level-border-color), var(--override-indentation-level-border-color) 0.5px, transparent 0);
  background-position-x: 5px;
  background-size: 0.5px 100%;
  background-repeat: no-repeat;
}

li.selected:not(.always-parent) + ol.children {
  --override-indentation-level-border-color: var(--sys-color-divider) !important; /* stylelint-disable-line declaration-no-important */
}

li.hovered:not(.always-parent) + ol.children:not(.shadow-root) {
  --override-indentation-level-border-color: color-mix(in srgb, var(--ref-palette-neutral0) 10%, transparent);
}

.elements-tree-outline ol.shadow-root {
  --override-indentation-level-border-color: var(--ref-palette-orange95);
}

@media (forced-colors: active) {
  .elements-disclosure li.parent::before {
    forced-color-adjust: none;
    background-color: ButtonText !important; /* stylelint-disable-line declaration-no-important */
  }

  .elements-disclosure .elements-tree-outline:not(.hide-selection-when-blurred) li.selected .selected-hint::before {
    opacity: unset;
  }

  .elements-disclosure .elements-tree-outline:not(.hide-selection-when-blurred) .selection,
  .elements-disclosure li.hovered:not(.selected) .selection,
  .elements-disclosure .elements-tree-outline:not(.hide-selection-when-blurred) li.selected:focus .selection {
    forced-color-adjust: none;
    background: canvas !important; /* stylelint-disable-line declaration-no-important */
    border: 1px solid Highlight !important; /* stylelint-disable-line declaration-no-important */
  }

  .gutter-container > devtools-icon {
    forced-color-adjust: none;
  }
}

.violating-element {
  /* stylelint-disable-next-line custom-property-pattern */
  background-image: var(--image-file-errorWave);
  background-repeat: repeat-x;
  background-position: bottom;
  padding-bottom: 1px;
}
