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

/* Network details panel */

.network-monitor .network-details-panel {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.network-monitor .panel-container {
  height: 100%;
}

.network-monitor .panel-container,
.network-monitor .properties-view {
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
}

.network-monitor .panel-container .tree-container .objectBox {
  white-space: normal;
  word-wrap: break-word;
}

.network-monitor .properties-view {
  flex-grow: 1;
}

.network-monitor .properties-view .searchbox-section {
  flex: 0 1 auto;
}

.network-monitor .properties-view .devtools-searchbox {
  padding: 0;
}

.network-monitor .properties-view .devtools-searchbox input {
  margin: 1px 3px;
}

/* Empty notices in tab panels */

.network-monitor .empty-notice {
  color: var(--theme-body-color-inactive);
  padding: 3px 8px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 24px;
}

/* Text inputs in tab panels */

.network-monitor .textbox-input {
  text-overflow: ellipsis;
  border: none;
  background: none;
  color: inherit;
  width: 100%;
}

.network-monitor .textbox-input:focus {
  outline: 0;
  box-shadow: var(--theme-focus-box-shadow-textbox);
}

/* Tree table in tab panels */

.network-monitor .tree-container, .tree-container .treeTable {
  position: relative;
  height: 100%;
  width: 100%;
  overflow: auto;
  flex: 1;
}

.network-monitor .tree-container .treeTable,
.network-monitor .tree-container .treeTable tbody {
  display: flex;
  flex-direction: column;
}

.network-monitor .tree-container .treeTable tbody {
  /* Apply flex to table will create an anonymous table element outside of tbody
   * See also http://stackoverflow.com/a/30851678
   * Therefore, we set height with this magic number in order to remove the
   * redundant scrollbar when source editor appears.
   */
  height: calc(100% - 4px);
}

.network-monitor .tree-container .treeTable tr {
  display: block;
  position: relative;
}

/* Make right td fill available horizontal space */
.network-monitor .tree-container .treeTable td:last-child {
  width: 100%;
}

.network-monitor .properties-view .devtools-searchbox,
.network-monitor .tree-container .treeTable .tree-section {
  width: 100%;
  background-color: var(--theme-toolbar-background);
}

.network-monitor .tree-container .treeTable tr.tree-section:not(:first-child) td:not([class=""]) {
  border-top: 1px solid var(--theme-splitter-color);
}

.network-monitor .properties-view .devtools-searchbox,
.network-monitor .tree-container .treeTable tr.tree-section:not(:last-child) td:not([class=""]) {
  border-bottom: 1px solid var(--theme-splitter-color);
}

.network-monitor .tree-container .treeTable .tree-section > * {
  vertical-align: middle;
}

.network-monitor .tree-container .treeTable .treeRow.tree-section > .treeLabelCell > .treeLabel,
.network-monitor .tree-container .treeTable .treeRow.tree-section > .treeLabelCell > .treeLabel:hover,
.network-monitor .tree-container .treeTable .treeRow.tree-section > .treeValueCell:not(:hover) * {
  color: var(--theme-toolbar-color);
}

.network-monitor .tree-container .treeTable .treeValueCell {
  /* FIXME: Make value cell can be reduced to shorter width */
  max-width: 0;
  padding-inline-end: 5px;
}

.network-monitor .tree-container .treeTable .treeValueCell input{
  color: var(--string-color);
}

.network-monitor .tree-container .treeTable .treeValueCell input:focus {
  color: var(--theme-selection-color) !important;
}

.network-monitor .tree-container .treeTable .treeRow.hasChildren > .treeLabelCell > .treeLabel:hover {
  text-decoration: none;
}

/* Source editor in tab panels */

/* If there is a source editor shows up in the last row of TreeView,
 * it should occupy the available vertical space.
 */
.network-monitor .tree-container .treeTable .editor-row-container,
.network-monitor .tree-container .treeTable tr:last-child td[colspan="2"] {
  display: block;
  height: 100%;
  flex: 1;
  overflow-x: auto;
}

.network-monitor .source-editor-mount {
  width: 100%;
  height: 100%;
}

.network-monitor .headers-summary-label,
.network-monitor .tree-container .objectBox {
  white-space: nowrap;
}

/* Summary tabpanel */

.network-monitor .tabpanel-summary-container {
  padding: 1px;
}

.network-monitor .tabpanel-summary-label {
  display: inline-block;
  padding-inline-start: 4px;
  padding-inline-end: 3px;
  font-weight: 600;
}

.network-monitor .tabpanel-summary-value {
  color: inherit;
  padding-inline-start: 3px;
}

.theme-dark .network-monitor .tabpanel-summary-value {
  color: var(--theme-selection-color);
}

/* Headers tabpanel */

.network-monitor .headers-overview {
  background: var(--theme-toolbar-background);
}

.network-monitor .headers-summary,
.network-monitor .response-summary {
  display: flex;
  align-items: center;
}

.network-monitor .headers-summary .devtools-button {
  margin-inline-end: 6px;
}

.network-monitor .headers-summary .raw-headers-container {
  display: flex;
  width: 100%;
}

.network-monitor .headers-summary .raw-headers {
  width: 50%;
  padding: 0 4px;
}

.network-monitor .headers-summary .raw-headers textarea {
  width: 100%;
  height: 50vh;
  font: message-box;
  resize: none;
}

.network-monitor .headers-summary .raw-headers .tabpanel-summary-label {
  padding: 0 0 4px 0;
}

.headers-summary .textbox-input {
  margin-inline-end: 2px;
}

.network-monitor .headers-summary .status-text {
    width: auto!important;
}

/* Response tabpanel */

.network-monitor .response-error-header {
  margin: 0;
  padding: 3px 8px;
  background-color: var(--theme-highlight-red);
  color: var(--theme-selection-color);
}

.network-monitor .response-image-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  padding: 10px;
}

.network-monitor .response-image {
  background: #fff;
  border: 1px dashed GrayText;
  margin-bottom: 10px;
  max-width: 300px;
  max-height: 100px;
}

.network-monitor .tree-container .treeTable tr.response-preview-container {
  flex: 1;
  min-height: 0;
}

.network-monitor .tree-container .treeTable tr.response-preview-container td {
  display: block;
  height: 100%;
}

.network-monitor .html-preview {
  height: 100%;
}

.network-monitor .html-preview iframe {
  background-color: #fff;
  border: none;
  height: 100%;
  width: 100%;
}

/* The editor container should only become a flex item when inside a container
 * with other flex items. In this case, the HTML preview is a flex item and we
 * can grow the editor. Otherwise, there may be overflow and
 * .editor-row-container will become 0px tall. */
.network-monitor .contains-html-preview .editor-row-container {
  flex: 1;
  min-height: 0;
}

/* Timings tabpanel */

.network-monitor .timings-container {
  display: flex;
}

.network-monitor .timings-label {
  width: 10em;
}

.network-monitor .requests-list-timings-container {
  display: flex;
  flex: 1;
  align-items: center;
}

.network-monitor .requests-list-timings-offset {
  transition: width 0.2s ease-out;
}

.network-monitor .requests-list-timings-box {
  border: none;
  min-width: 1px;
  transition: width 0.2s ease-out;
}

/* Stack trace panel */

.network-monitor .stack-trace {
  font-family: var(--monospace-font-family);
  /* The markup contains extra whitespace to improve formatting of clipboard text.
     Make sure this whitespace doesn't affect the HTML rendering */
  white-space: normal;
  padding: 5px;
}

.network-monitor .stack-trace .frame-link-source,
.network-monitor .message-location .frame-link-source {
  /* Makes the file name truncated (and ellipsis shown) on the left side */
  direction: rtl;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: end;
}

.network-monitor .stack-trace .frame-link-source-inner,
.network-monitor .message-location .frame-link-source-inner {
  /* Enforce LTR direction for the file name - fixes bug 1290056 */
  direction: ltr;
  unicode-bidi: embed;
}

.network-monitor .stack-trace .frame-link-function-display-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-inline-end: 1ch;
}

/* Security tabpanel */

/* Overwrite tree-view cell colon `:` for security panel and tree section */
.network-monitor .security-panel .treeTable .treeLabelCell::after,
.network-monitor .treeTable .tree-section .treeLabelCell::after {
  content: "";
}

/* Layout additional warning icon in tree value cell  */
.network-monitor .security-info-value {
  display: flex;
}

.network-monitor .security-warning-icon {
  background-image: url(chrome://devtools/skin/images/alerticon-warning.png);
  background-size: 13px 12px;
  margin-inline-start: 5px;
  vertical-align: top;
  width: 13px;
  height: 12px;
}

@media (min-resolution: 1.1dppx) {
  .network-monitor .security-warning-icon {
    background-image: url(chrome://devtools/skin/images/alerticon-warning@2x.png);
  }
}

/* Custom request panel */

.network-monitor .custom-request-panel {
  height: 100%;
  overflow: auto;
  padding: 0 4px;
  background-color: var(--theme-sidebar-background);
}

.theme-dark .network-monitor .custom-request-panel {
  color: var(--theme-selection-color);
}

.network-monitor .custom-request-label {
  font-weight: 600;
}

.network-monitor .custom-request-panel textarea {
  resize: none;
  font: message-box;
}

.network-monitor .custom-header,
.network-monitor .custom-method-and-url,
.network-monitor .custom-request,
.network-monitor .custom-section {
  display: flex;
}

.network-monitor .custom-header {
  flex-grow: 1;
  font-size: 1.1em;
  padding-top: 4px;
}

.network-monitor .custom-section {
  flex-direction: column;
  margin-top: 0.5em;
}

.network-monitor .custom-method-value {
  width: 4.5em;
}

.network-monitor .custom-url-value {
  flex-grow: 1;
  margin-inline-start: 6px;
}
