/*
 * Copyright 2015 The Chromium Authors
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */
@media (prefers-reduced-motion: no-preference) {
  :host {
    transition: all var(--sys-motion-duration-long2);
    transition-timing-function: var(--sys-motion-curve-spatial);
  }
}

@starting-style {
  :host {
    height: 0;
    opacity: 0%;
  }
}

.infobar {
  --summary-header-height: var(--sys-size-11);

  color: var(--sys-color-on-surface);
  background-color: var(--sys-color-cdt-base-container);
  display: flex;
  flex: auto;
  flex-direction: row;
  position: relative;
  padding: var(--sys-size-5) var(--sys-size-8);
  min-width: fit-content;
  min-height: calc(var(--summary-header-height) + var(--sys-size-5) * 2);

  .icon-container {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    height: var(--summary-header-height);
  }

  dt-close-button {
    margin-left: var(--sys-size-3);
  }
}

.infobar:focus {
  outline: 2px solid var(--sys-color-state-focus-ring);
  outline-offset: -2px;
}

.infobar-warning {
  background-color: var(--sys-color-surface-yellow);
  color: var(--sys-color-on-surface-yellow);
}

.infobar-error {
  --override-infobar-error-background: var(--sys-color-surface-error);
  --override-infobar-error-text: var(--sys-color-on-surface-error);

  background-color: var(--override-infobar-error-background);
  color: var(--override-infobar-error-text);
}

.infobar-main-row {
  display: inline-flex;
  flex-direction: row;
  margin-right: auto;
}

.infobar-info-container {
  display: flex;
  row-gap: var(--sys-size-4);
  align-items: center;
  flex-grow: 1;
  flex-wrap: wrap;
}

.infobar-info-text {
  font: var(--sys-typescale-body3-regular);
  margin-right: var(--sys-size-8);
}

.infobar-details-row {
  display: flex;
  flex-direction: column;
  line-height: 18px;

  + .infobar-details-row {
    padding-top: var(--sys-size-3);
  }
}

.infobar-selectable {
  user-select: text;
}

.infobar-button {
  color: var(--sys-color-token-subtle);
}

.info-icon {
  color: var(--sys-color-primary);
}

.warning-icon {
  color: var(--icon-warning);
}

.error-icon {
  color: var(--icon-error);
}

.issue-icon {
  color: var(--sys-color-primary);
}

.info-icon,
.warning-icon,
.error-icon,
.issue-icon {
  margin-right: var(--sys-size-8);
  width: var(--sys-size-8);
  height: var(--sys-size-8);
  flex-shrink: 0;
}

.infobar-info-actions {
  display: flex;
  gap: var(--sys-size-5);
}

.devtools-link.text-button:hover,
.devtools-link.text-button:focus,
.devtools-link.text-button:active {
  background-color: transparent;
  box-shadow: none;
}

details {
  margin-right: auto;

  summary {
    display: flex;
    min-height: var(--summary-header-height);

    &:focus-visible {
      outline: var(--sys-color-state-focus-ring) auto var(--sys-size-1);
      outline-offset: var(--sys-size-3);
    }

    &::marker {
      content: '';
    }
  }

  devtools-icon[name="arrow-drop-down"] {
    align-self: center;
    transform: rotate(270deg);
  }

  &[open] {
    devtools-icon[name="arrow-drop-down"] {
      transform: rotate(0deg);
    }

    &::details-content {
      padding: var(--sys-size-4) 0 0 var(--sys-size-9);
    }

  }
}
