/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

:root {
  --gutter-width: 3em;
  --gutter-padding-start: 22px;
  --checkerboard-pattern: linear-gradient(45deg, rgba(128,128,128,0.2) 25%, transparent 25%, transparent 75%, rgba(128,128,128,0.2) 75%, rgba(128,128,128,0.2)),
                          linear-gradient(45deg, rgba(128,128,128,0.2) 25%, transparent 25%, transparent 75%, rgba(128,128,128,0.2) 75%, rgba(128,128,128,0.2));
}

:root.theme-dark {
  --draw-call-background: rgba(112,191,83,0.15);
  --interesting-call-background: rgba(223,128,255,0.15);
}

:root.theme-light {
  --draw-call-background: rgba(44,187,15,0.1);
  --interesting-call-background: rgba(184,46,229,0.1);
}

/* Reload and waiting notices */

.notice-container {
  margin-top: -50vh;
  color: var(--theme-body-color-alt);
}

#empty-notice > button {
  min-width: 30px;
  min-height: 28px;
  margin: 0;
  list-style-image: url(images/profiler-stopwatch.svg);
}

#empty-notice > button .button-text {
  display: none;
}

#waiting-notice {
  font-size: 110%;
}

/* Snapshots pane */

#snapshots-pane {
  border-inline-end: 1px solid var(--theme-splitter-color);
}

#record-snapshot {
  list-style-image: url("chrome://devtools/skin/images/profiler-stopwatch.svg");
}

#import-snapshot {
  list-style-image: url("images/import.svg");
}

/* Snapshots items */

.snapshot-item-thumbnail {
  image-rendering: -moz-crisp-edges;
  background-image: var(--checkerboard-pattern);
  background-size: 12px 12px, 12px 12px;
  background-position: 0px 0px, 6px 6px;
  background-repeat: repeat, repeat;
}

.snapshot-item-thumbnail[flipped=true] {
  transform: scaleY(-1);
}

.snapshot-item-thumbnail {
  background-color: var(--theme-body-background);
}

.snapshot-item-details {
  padding-inline-start: 6px;
}

.snapshot-item-calls {
  padding-top: 4px;
  font-size: 80%;
}

.snapshot-item-save {
  padding-bottom: 2px;
  font-size: 90%;
}

.snapshot-item-calls,
.snapshot-item-save {
  color: var(--theme-body-color-alt);
}

.snapshot-item-save {
  text-decoration: underline;
  cursor: pointer;
}

.snapshot-item-save[disabled=true] {
  text-decoration: none;
  pointer-events: none;
}

.snapshot-item-footer.devtools-throbber::before {
  margin-top: -2px;
}

#snapshots-list .selected label {
  /* Text inside a selected item should not be custom colored. */
  color: inherit !important;
}

/* Debugging pane controls */
#resume {
  list-style-image: url(images/play.svg);
}

#step-over {
  list-style-image: url(images/debugger-step-over.svg);
}

#step-in {
  list-style-image: url(images/debugger-step-in.svg);
}

#step-out {
  list-style-image: url(images/debugger-step-out.svg);
}

#calls-slider {
  padding-inline-end: 24px;
}

#calls-slider .scale-slider {
  margin: 0;
}

#debugging-toolbar-sizer-button {
  /* This button's only purpose in life is to make the
     container .devtools-toolbar have the right height. */
  visibility: hidden;
  min-width: 1px;
}

/* Calls list pane */

#calls-list .side-menu-widget-container {
  background: transparent;
}

/* Calls list items */

#calls-list .side-menu-widget-item {
  padding: 0;
  border-color: var(--theme-splitter-color);
  border-bottom-color: transparent;
}

.call-item-view:hover {
  background-color: rgba(128,128,128,0.05);
}

.call-item-view[draw-call] {
  background-color: var(--draw-call-background);
}

.call-item-view[interesting-call] {
  background-color: var(--interesting-call-background);
}

.call-item-gutter {
  width: calc(var(--gutter-width) + var(--gutter-padding-start));
  padding-inline-start: var(--gutter-padding-start);
  padding-inline-end: 4px;
  padding-top: 2px;
  padding-bottom: 2px;
  border-inline-end: 1px solid var(--theme-splitter-color);
  margin-inline-end: 6px;
  background-color: var(--theme-sidebar-background);
  color: var(--theme-content-color3);
}

.selected .call-item-gutter {
  background-color: #2cbb0f;
  color: white;
}

.call-item-index {
  text-align: end;
}

.call-item-context {
  color: var(--theme-highlight-orange);
}

.call-item-name {
  color: var(--theme-highlight-blue);
}

.call-item-location {
  padding-inline-start: 2px;
  padding-inline-end: 6px;
  text-align: end;
  cursor: pointer;
  color: var(--theme-highlight-bluegrey);
  border-color: var(--theme-splitter-color);
}

.call-item-location:hover {
  color: var(--theme-highlight-blue);
}

.call-item-view:hover .call-item-location,
.call-item-view[expanded] .call-item-location {
  text-decoration: underline;
}

.call-item-stack {
  padding-inline-start: calc(var(--gutter-width) + var(--gutter-padding-start));
  padding-bottom: 10px;
}

.theme-dark .call-item-stack {
  background: rgba(0,0,0,0.9);
}

.theme-light .call-item-stack {
  background: rgba(255,255,255,0.9);
}

.call-item-stack-fn {
  padding-top: 2px;
  padding-bottom: 2px;
}

.call-item-stack-fn-location {
  padding-inline-start: 2px;
  padding-inline-end: 6px;
  text-align: end;
  cursor: pointer;
  text-decoration: underline;
}

.call-item-stack-fn-name {
  color: var(--theme-content-color3);
}

.call-item-stack-fn-location {
  color: var(--theme-highlight-bluegrey);
}

.call-item-stack-fn-location:hover {
  color: var(--theme-highlight-blue);
}

#calls-list .selected .call-item-contents > label:not(.call-item-gutter) {
  /* Text inside a selected item should not be custom colored. */
  color: inherit !important;
}

/* Rendering preview */

#screenshot-container {
  background-color: var(--theme-body-background);
  background-image: var(--checkerboard-pattern);
  background-size: 30px 30px, 30px 30px;
  background-position: 0px 0px, 15px 15px;
  background-repeat: repeat, repeat;
}

@media (min-width: 701px) {
  #screenshot-container {
    width: 30vw;
    max-width: 50vw;
    min-width: 100px;
  }
}

@media (max-width: 700px) {
  #screenshot-container {
    height: 40vh;
    max-height: 70vh;
    min-height: 100px;
  }
}

#screenshot-image {
  background-image: -moz-element(#screenshot-rendering);
  background-size: contain;
  background-position: center, center;
  background-repeat: no-repeat;
}

#screenshot-image[flipped=true] {
  transform: scaleY(-1);
}

#screenshot-dimensions {
  padding-top: 4px;
  padding-bottom: 4px;
  text-align: center;
}

.theme-dark #screenshot-dimensions {
  background-color: rgba(0,0,0,0.4);
}

.theme-light #screenshot-dimensions {
  background-color: rgba(255,255,255,0.8);
}

/* Snapshot filmstrip */

#snapshot-filmstrip {
  border-top: 1px solid var(--theme-splitter-color);
  overflow: hidden;
}

.theme-dark #snapshot-filmstrip {
  color: var(--theme-selection-color);
}

.theme-light #snapshot-filmstrip {
  color: var(--theme-body-color-alt);
}

.filmstrip-thumbnail {
  image-rendering: -moz-crisp-edges;
  background-color: var(--theme-body-background);
  background-image: var(--checkerboard-pattern);
  background-size: 12px 12px, 12px 12px;
  background-position: 0px -1px, 6px 5px;
  background-repeat: repeat, repeat;
  background-origin: content-box;
  cursor: pointer;
  padding-top: 1px;
  padding-bottom: 1px;
  border-inline-end: 1px solid var(--theme-splitter-color);
  transition: opacity 0.1s ease-in-out;
}

.filmstrip-thumbnail[flipped=true] {
  transform: scaleY(-1);
}

#snapshot-filmstrip > .filmstrip-thumbnail:hover,
#snapshot-filmstrip:not(:hover) > .filmstrip-thumbnail[highlighted] {
  border: 1px solid var(--theme-highlight-blue);
  margin: 0 0 0 -1px;
  padding: 0;
  opacity: 0.66;
}