$link: #0c3ccb;
* {
  box-sizing: border-box;
}
body,
html {
  font-family: -apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI',
    'Roboto', 'Helvetica Neue', Arial, sans-serif;
  font-size: 100%;
}

a {
  cursor: pointer;
  text-decoration: none;
  color: $link;
  &:visited {
    color: $link;
  }
  &:hover {
    text-decoration: underline;
  }
}

.treemap {
  position: relative;
  width: 100vw;
  height: calc(100vh - 150px);
}

.box {
  position: absolute;
  overflow: hidden;
  cursor: pointer;
}

.hide-box {
  opacity: 0 !important;
  box-shadow: none !important;
}

.no-interact {
  cursor: default;
}

$anim-duration: 400ms;
.box-transition-position {
  .box {
    transition: top $anim-duration, left $anim-duration, width $anim-duration,
      height $anim-duration, background-color 250ms;
  }
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes fadeOut {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.animate-in-box {
  opacity: 0;
  animation: fadeIn 400ms forwards;
  animation-delay: 500ms;
}

.animate-out-box {
  animation: fadeOut 0.3s forwards;
}

.long-task-warning {
  box-shadow: 0 0 100px black;
}

.label {
  padding: 0.2rem 0.3rem;
  display: block;
  white-space: nowrap;
  font-size: 0.78rem;
  position: relative;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  position: relative;
  z-index: 1;
  transition: opacity 1s;
  > div {
    font-weight: 600;
  }
}

.legend {
  display: inline-block;
  text-align: center;
  font-size: 0.8rem;
  > div:first-of-type {
    margin-bottom: 0.2rem;
    line-height: 1;
  }
}

.legend__text {
  display: flex;
  font-size: 0.8rem;
  justify-content: space-between;
  > div:nth-of-type(2) {
    position: relative;
    right: -1rem;
  }
}

.legend__colors {
  display: flex;
  align-items: center;
  > div {
    width: 15px;
    height: 10px;
  }
  .legend__label {
    width: 40px;
  }
  > .legend__label:last-of-type {
    margin-left: 0.3rem;
  }
}

.breadcrumb-container {
  margin: 0.5rem 1rem;
  min-height: 1.75rem;
  display: flex;
  justify-content: space-between;

  ul {
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    list-style: none;
  }
  li {
    &:last-of-type {
      a {
        font-weight: bold;
        color: black;
        &:hover {
          text-decoration: none;
        }
      }
    }
  }
}

.tooltip {
  font-size: 0.95rem;
  pointer-events: none;
  opacity: 0.9;
  min-height: 4rem;
  transition: opacity 0.25s;
  position: fixed;
  background-color: black;
  color: white;
  padding: 0.5rem 1rem;
  top: 0;
  right: 0;
  width: 100vw;
  box-shadow: 0 5px 30px hsla(0, 0%, 0%, 0.2);
  -webkit-font-smoothing: antialiased;
  @media (min-width: 768px) {
    width: auto;
    min-width: 30rem;
    top: 1rem;
    right: 1rem;
    border-radius: 4px;
  }

  z-index: 10000;
  h3 {
    margin-bottom: 0.1rem;
    font-size: 1rem;
    margin-top: 0;
  }
  ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
  }
  .hovered-data-row {
    display: flex;
    align-items: center;
    > div {
      margin-right: 1.75rem;
    }
  }
}

.tooltip-hidden {
  opacity: 0;
}

.summary {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem 1rem 2rem 1rem;

  a {
    text-decoration: none;
    &:hover,
    &:focus {
      text-decoration: underline;
    }
  }

  h2 {
    font-size: 1.2rem;
    margin-top: 2rem;
  }

  table {
    table-layout: fixed;
    width: 100%;
    border-collapse: collapse;
    td,
    th {
      text-align: left;
      border-bottom: 1px solid hsla(0, 0%, 0%, 0.2);
      padding: 0.5rem;
    }
    th,
    td {
      text-align: center;
    }

    td:first-of-type,
    th:first-of-type {
      width: 3rem;
    }
    td:nth-of-type(2),
    th:nth-of-type(2) {
      width: 30rem;
      padding-right: 2rem;
      text-align: left;
    }
  }

  tfoot > tr > td {
    border-bottom: none;
    font-weight: bold;
  }
}

.screenshot {
  display: block;
  max-height: 22rem;
  max-width: 40rem;
  width: auto;
  margin: 0.5rem 0 2.5rem 0;
  border: 1px solid hsla(0, 0%, 0%, 0.5);
}

figure {
  margin: 0;
}

.nav {
  display: flex;
  border-bottom: 1px solid hsla(0, 0%, 0%, 0.2);
  align-items: center;
  padding: 0 1rem;
  ul {
    display: flex;
    padding: 0;
    margin: 0 0 0 3rem;
  }

  a {
    height: 100%;
    display: block;
    min-width: 8rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
    padding: calc(0.75rem + 4px) 1rem 0.75rem 1rem;
    border-bottom: 4px solid transparent;
    line-height: 1;
    font-weight: bold;

    &:hover {
      border-color: hsla(225, 58%, 45%, 0.5);
    }
  }
  .active {
    a {
      cursor: default;
      border-bottom: 4px solid $link;
      color: black;
      &:hover {
        text-decoration: none;
      }
    }
  }
}

.logo {
  display: none;
  @media (min-width: 768px) {
    display: block;
  }
}
.loading {
  height: 100vh;
  width: 100vw;
  display: flex;
  justify-content: center;
  align-items: center;
}

.control-panel {
  background-color: hsla(0, 0%, 0%, 0.9);
  padding: 0.5rem;

  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  z-index: 100;

  > div {
    max-width: 1200px;
    margin: 0 auto;
    color: white;
    z-index: 100;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    color: white;
    transition: transform 2s;
    cursor: pointer;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
  }
}

.hide-coverage {
  .box {
    background-color: hsla(0, 0%, 0%, 0.02) !important;
    box-shadow: 0 0 0 1px hsla(0, 0%, 0%, 0.3) !important;
  }
}

.sourcemap-control {
  input {
    margin-right: 0.5rem;
  }
}
