/*
 * Copyright 2025 The Chromium Authors
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */
@scope to (devtools-widget > *) {
  .timeline-details {
    vertical-align: top;
  }

  .timeline-details-view {
    color: var(--sys-color-on-surface);
    overflow: hidden;
  }

  .timeline-details-view-body {
    flex: auto;
    overflow: auto;
    position: relative;
    background-color: var(--sys-color-cdt-base-container);
    user-select: text;
  }

  .timeline-details-view-block {
    flex: none;
    display: flex;
    background-color: var(--sys-color-cdt-base-container);
    flex-direction: column;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--sys-color-divider);
  }

  .timeline-details-view-row {
    padding-left: 10px;
    min-height: 20px;
    line-height: 16px; /* Vertically center text within row, important for background-color rows like .timeline-details-warning */
  }

  .timeline-details-view-block .timeline-details-stack-values {
    flex-direction: column !important; /* stylelint-disable-line declaration-no-important */
  }

  .timeline-details-chip-title {
    font-size: 12px;
    padding: 8px;
    display: flex;
    align-items: center;
  }

  .timeline-details-chip-title-reveal-entry:hover {
    background: var(--sys-color-state-hover-on-subtle);
    cursor: pointer;
  }

  .timeline-details-view-block:first-child > .timeline-details-chip-title {
    font-size: 13px;
  }

  .timeline-details-range-summary {
    padding: var(--sys-size-4) 0 0;
    height: 100%;

    & > devtools-performance-timeline-summary {
      /* The category summary can't be more narrow than this, so we'll force a horizontal scrollbar
        Also this style can't be applied on the element's :host without !important, thus its here. */
      min-width: 192px;
    }
  }

  /* This is the coloured box that shows next to the event name */
  .timeline-details-chip-title > div {
    width: 14px;
    height: 14px;
    border: 1px solid var(--sys-color-divider);
    display: inline-block;
    margin-right: 4px;
    content: " ";
  }

  .timeline-details-view-row-title:not(:empty) {
    color: var(--sys-color-token-subtle);
    overflow: hidden;
    padding-right: 10px;
    display: inline-block;
    vertical-align: top;
  }

  .timeline-details-warning {
    --override-details-warning-background-color: rgb(250 209 209 / 48%);

    background-color: var(--override-details-warning-background-color);
  }

  .theme-with-dark-background .timeline-details-warning,
  :host-context(.theme-with-dark-background) .timeline-details-warning {
    --override-details-warning-background-color: rgb(87 10 10 / 48%);
  }

  .timeline-details-warning .timeline-details-view-row-title {
    color: var(--sys-color-error);
  }

  .timeline-details-view-row-value {
    display: inline-block;
    user-select: text;
    text-overflow: ellipsis;
    overflow: visible;
  }

  .timeline-details-warning .timeline-details-view-row-value {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .timeline-details-view-pie-chart-wrapper {
    margin: 4px 0;
  }

  .timeline-details-view-pie-chart {
    margin-top: 5px;
  }
}
