/**
 * @license
 * Copyright 2020 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */

.vars {
  /* Palette using Material Design Colors
   * https://www.materialui.co/colors */
  --color-gray-600: #757575;
  --color-gray-900: #212121;

  --control-background-color: #e7f1fe;
  --text-color-secondary: #474747;

  --text-color: var(--color-gray-900);
  --text-color-active: #2a67ce;
  --text-color-active-secondary: #4484f3c7;
  --separator-color: rgba(0, 0, 0, 0.1);

  --unused-stripes: repeating-linear-gradient(
    -45deg,
    rgba(220, 54, 46, 0.3) 0 1px,
    transparent 1px 5px
  ), rgba(220, 54, 46, 0.08);
}

body {
  font-family: '.SFNSDisplay-Regular', 'Helvetica Neue', 'Lucida Grande', sans-serif;
  color: var(--text-color);
  margin: 0;
  overflow-y: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

.lh-button,
.lh-header__inputs select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid #c7c7c7;
  border-radius: 8px;
  background-color: white;
  color: var(--text-color);
  font-family: inherit;
  font-size: 12px;
  line-height: 18px;
  cursor: pointer;
}
.lh-button {
  white-space: nowrap;
  flex-shrink: 0;
}
.lh-button--active {
  background-color: var(--control-background-color);
  border-color: #a8c7fa;
  color: var(--text-color-active);
}

.lh-text-dim {
  color: var(--text-color-secondary);
  font-weight: 400;
}

.lh-text-bold {
  font-weight: 500;
}

.lh-main {
  display: grid;
  height: 100vh;
  grid-template-columns: 1fr 0;
  grid-template-rows: auto 1fr;
  grid-column-gap: 0px;
  grid-row-gap: 0px;
  transition: grid-template-rows 0.2s;
  animation: 0.7s curtain cubic-bezier(0.86, 0, 0.07, 1) 0.4s both;
}
.lh-main--show-table {
  grid-template-columns: 3fr 1fr;
}

.lh-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  grid-area: 1 / 1 / 2 / 3;
  height: 56px;
  padding: 0 14px;
  border-bottom: 1px solid var(--separator-color);
  box-sizing: border-box;
  gap: 16px;
}
.lh-header > div {
  flex: 1;
}
.lh-header > div:first-child {
  margin-right: auto;
}
.lh-header > div:last-child {
  margin-left: auto;
}

.lh-header__url {
  text-align: center;
  min-width: 0;
}

.lh-header--url-and-size {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  font-size: 14px;
  line-height: 20px;
}

.lh-header--url {
  color: var(--text-color);
  font-weight: 500;
  text-decoration: none;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.lh-header--url:hover {
  text-decoration: underline;
}

.lh-header--url-bytes {
  white-space: nowrap;
  flex-shrink: 0;
}

.lh-header__inputs {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.lh-header__inputs select {
  width: 12vw;
  min-width: 120px;
  text-overflow: ellipsis;
  /* Replace the native arrow with the design's arrow_drop_down icon. */
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23474747'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
}

.lh-header__logotitle {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 16px;
  line-height: 24px;
  color: var(--text-color-secondary);
  white-space: nowrap;
}

.lh-topbar__logo {
  width: 28px;
  height: 28px;
  user-select: none;
  flex: none;
}

.lh-button--back {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 4px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-color-secondary);
  cursor: pointer;
}
.lh-button--back:hover {
  background-color: rgba(0, 0, 0, 0.06);
}

.lh-header--zoomed .lh-button--back {
  display: inline-flex;
}
.lh-header--zoomed .lh-topbar__logo,
.lh-header--zoomed .lh-header--title {
  display: none;
}

.lh-treemap {
  grid-area: 2 / 1 / 3 / 2;
}

.lh-treemap-hint {
  grid-area: 2 / 1 / 3 / 2;
  align-self: end;
  justify-self: start;
  position: relative;
  z-index: 2;
  margin: 8px;
  padding: 4px 8px;
  border: 1px solid var(--text-color);
  border-radius: 4px;
  background-color: white;
  font-size: 12px;
  line-height: 16px;
  pointer-events: none;
}

.lh-table {
  grid-area: 2 / 2 / 3 / 3;

  display: grid;
  grid-template-columns: 1fr auto;
  grid-column-gap: 8px;
  align-content: start;
  overflow-y: auto;
  padding: 0 16px 12px;
  border-left: 1px solid var(--separator-color);
  font-size: 12px;
  line-height: 16px;
}

.lh-table-header {
  grid-column: 1/-1;
  font-weight: 500;
  background-color: white;
  position: sticky;
  top: 0;

  display: flex;
  justify-content: space-between;
  padding: 12px 0 8px;
  border-bottom: 1px solid var(--separator-color);
  margin-bottom: 8px;
}

.lh-table-header div:first-child {
  color: var(--text-color-secondary);
}

.lh-table-row {
  display: contents;
  word-break: break-word;
}

.lh-table-row div:nth-child(2) {
  text-align: right;
  white-space: nowrap;
}

.lh-table-subrow div:first-child {
  margin-left: 0;
  border-left: 1px solid #A8C7FA;
  padding-left: 8px;
}

.lh-table-subrow div {
  padding-top: 4px;
}

.lh-table-subrow div:nth-child(2) {
  color: var(--text-color-secondary);
}

.lh-table-separator {
  grid-column: 1/-1;
  border-bottom: 1px solid var(--separator-color);
  margin: 8px 0;
}

.lh-coverage-bar {
  grid-column: 1/-1;
  display: flex;
  justify-content: flex-end;
  height: 8px;
  margin-top: 4px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  overflow: hidden;
  background-color: white;
}
.lh-coverage-bar--unused {
  width: calc(100% * var(--unused) / var(--total));
  border-left: 1px solid var(--separator-color);
  background: var(--unused-stripes);
}
.lh-coverage-bar--unused.lh-coverage-bar--empty {
  border-left: none;
}

.webtreemap-node {
  cursor: pointer;
  position: absolute;
  border: solid 1px rgba(0, 0, 0, 0.2);
  border-radius: 2px;
  overflow: hidden;
  background: white;
  transition: left .15s, top .15s, width .15s, height .15s;
}
.webtreemap-node--root {
  border: none;
  background-color: transparent !important;
}

.webtreemap-node--hover {
  outline: 2px solid black;
}

.lh-treemap--view-mode--all:not(.lh-treemap--hover-duplicate) .webtreemap-node {
  border: none;
}

/* Duplicate modules are always outlined, in every view mode. */
.lh-treemap .webtreemap-node.webtreemap-node--duplicate {
  border: solid 1px var(--text-color);
}

.lh-treemap--view-mode--unused-bytes .webtreemap-node:not(.webtreemap-node--root)::before {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  content: '';
  display: block;
  width: var(--pctUnused);
  background: var(--unused-stripes);
  pointer-events: none;
}

.webtreemap-caption {
  font-size: 12px;
  line-height: 16px;
  padding: 2px 6px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-color-secondary);
}
.webtreemap-caption span {
  margin-right: 4px;
}
.webtreemap-caption .lh-text-dim {
  opacity: 0.7;
}

/* Copied from viewer.css */

.drop_zone {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  visibility: hidden;
}
.drop_zone.dropping {
  visibility: visible;
  font-size: var(--heading-font-size);
  background-color: rgba(255,255,255,0.8);
  color: var(--unknown-color);
}
.drop_zone.dropping::after {
  content: 'Drop report here';
  border: 2px dashed currentColor;
  border-radius: 5px;
  padding: 25px;
  width: 33vw;
  min-width: 250px;
  height: 20vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #fff;
}
.treemap-placeholder {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
}
.treemap-placeholder-inner {
  display: flex;
  align-items: center;
  border-radius: 5px;
  padding: 16px;
  max-width: 80vw;
  border: 2px dashed rgba(0,0,0,0.2);
  cursor: pointer;
  background-color: #fff;
}
.treemap-placeholder-inner.lh-loading {
  filter: blur(2px) grayscale(1);
  cursor: wait
}
.treemap-placeholder-inner.lh-loading>div {
  pointer-events: none;
}
.treemap-placeholder-inner.dropping {
  border-color: currentColor;
}
.treemap-placeholder__heading {
  font-weight: 300;
  margin: 0;
  line-height: 32px;
}
.treemap-placeholder__help {
  margin-top: 12px;
  line-height: 1.6;
}
.treemap-placeholder-logo {
  width: 140px;
  height: 140px;
}
.treemap-placeholder__url {
  padding: 8px;
  width: 100%;
  border: 1px solid #eee;
  margin-top: 16px;
  display: none;
}


@media screen and (max-width: 635px) {
  .treemap-placeholder-inner {
    display: block;
    text-align: center;
  }
  .treemap-placeholder-logo {
    width: 100px;
    height: 100px;
  }
  .treemap-placeholder__url {
    display: block;
  }
}

@media screen and (min-width: 636px) {
  .treemap-placeholder-inner {
    padding: 40px 32px;
  }
  .treemap-placeholder-logo {
    margin-right: 16px;
  }
}

/* app z-indexes */
.drop_zone {
  z-index: 3;
}
