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

/*
 * The version used for mobile is located at
 * toolkit/themes/mobile/global/aboutMemory.css.
 * Desktop-specific stuff is at the bottom of this file.
 */

html {
  font: message-box;
}

body {
  padding: 0 2em;
  min-width: 45em;
  margin: auto;
}

/* The comment at the top of aboutMemory.xhtml explains this font choice. */
pre {
  font-family:
    DejaVu Sans Mono,
    Liberation Mono,
    Fira Mono,
    monospace;
}

div.ancillary {
  margin: 0.5em 0;
  user-select: none;
}

div.section {
  padding: 2em;
  margin: 1em 0;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-small);
  background: var(--background-color-box);
}

div.outputContainer {
  display: flex;
}

div.sections {
  flex: 1;
  min-width: 0;
}

div.sidebar {
  flex: 0 0 max-content;
  margin-left: 1em;
}

div.sidebarContents {
  position: sticky;
  top: 0.5em;
}

div.sidebarItem {
  padding: 0.5em;
  margin: 1em 0;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-small);
  background: var(--background-color-box);
  user-select: none; /* no need to include this when cutting+pasting */
}

input.filterInput {
  width: calc(100% - 1em);
}

ul.index {
  list-style-position: inside;
  margin: 0;
  padding: 0;
}

ul.index > li {
  padding-left: 0.5em;
}

div.opsRow {
  padding: 0.5em;
  margin-right: 0.5em;
  margin-top: 0.5em;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-small);
  background: var(--background-color-box);
  display: inline-block;
}

div.opsRowLabel,
div.sidebarLabel {
  display: block;
  margin-bottom: 0.2em;
  font-weight: var(--font-weight-bold);
}

.opsRowLabel label {
  margin-left: 1em;
  font-weight: normal;
}

div.non-verbose pre.entries {
  overflow-x: hidden;
  text-overflow: ellipsis;
}

h1 {
  padding: 0;
  margin: 0;
  background: inherit; /* When sticky give it the solid background of the parent */
  display: inline; /* allow subsequent text to the right of the heading */
  position: sticky; /* Stay at the top of the page when scrolling */
  top: 0;
  z-index: 1; /* When sticky it should appear above the tree lines */
}

h2 {
  padding-left: 0.1em;
}

h3 {
  display: inline; /* allow subsequent text to the right of the heading */
}

a.upDownArrow {
  font-size: 130%;
  text-decoration: none;
  user-select: none; /* no need to include this when cutting+pasting */
}

div.treemap {
  user-select: none;
  position: relative;
  margin-top: 1em;
}

a.treemapEntry {
  display: block;
  position: absolute;
  color: FieldText;
  text-decoration: none;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-small);
  background: var(--background-color-canvas);
  z-index: 0;

  > .treemapEntryContent {
    padding: 1em;
    padding-bottom: 0;
    opacity: 0.7;
    overflow: hidden;
    text-wrap: nowrap;

    /*
     * Limit our height to our container size minus padding, to ensure we clip
     * overflow
     */
    max-height: calc(100% - 2em);

    > .treemapEntryText {
      overflow: hidden;
    }

    > .treemapEntryProcessName {
      font-weight: var(--font-weight-bold);
    }

    > .treemapEntryPid {
      opacity: 0.5;
    }
  }

  &:hover {
    background: var(--background-color-box);
    z-index: 1;

    > .treemapEntryContent {
      opacity: 1;
      overflow: visible;

      > .treemapEntryText {
        overflow: visible;
      }
    }
  }
}

.accuracyWarning,
.badInputWarning,
.invalid {
  color: var(--text-color-error);
}

.treeline {
  color: FieldText;
  opacity: 0.5;
}

.mrValue {
  font-weight: var(--font-weight-bold);
}

.hasKids {
  cursor: pointer;
}

.hasKids:hover {
  text-decoration: underline;
}

.noselect {
  user-select: none; /* no need to include this when cutting+pasting */
}

.option {
  font-size: 80%;
  user-select: none; /* no need to include this when cutting+pasting */
}

.legend {
  font-size: 80%;
  user-select: none; /* no need to include this when cutting+pasting */
}

.debug {
  font-size: 80%;
}

.hidden {
  display: none;
}

/* Desktop-specific parts go here. */

.hasKids:hover {
  text-decoration: underline;
}
