/* stylelint-disable no-duplicate-selectors */
.list {
  background: var(--base00);
  box-sizing: border-box;
  font-size: 1.1rem;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.list-content {
  overflow: scroll;
  transform: translateZ(0);
}

.list {
  table {
    border-collapse: separate;
    border-spacing: 0;
    left: 0;
    position: absolute;
    table-layout: fixed;
    top: 0;
    width: 100%;
  }
}

.list-header {
  border-bottom: 1px solid var(--base05);
  height: 30px;
  overflow: hidden;
  overflow-y: scroll;
  position: relative;
  text-align: left;
  user-select: none;

  .list-row {
    background: var(--base00);
  }

  .list-cell {
    color: var(--inherit);
    font-weight: normal;
    opacity: 1;
    padding: 0;
    padding-left: 5px;
    position: relative;
  }
}

.list:not(.list-no-alternate-color) .list-content {
  .list-row {
    background: var(--base02);

    &.striped {
      background: var(--base00);
    }
  }
}

.list.list-css-striping {
  .list-row:nth-child(even) {
    background: var(--base00);
  }
}

.list-cell-content {
  width: 100%;
}

.list-cell {
  box-sizing: border-box;
  line-height: 30px;
  min-height: 30px;
  opacity: 0.7;
  overflow: hidden;
  padding-left: 5px;
  text-overflow: ellipsis;
  white-space: nowrap;

  &-size-small {
    flex: none;
    width: 50px;
  }

  &-size-medium {
    flex: none;
    width: 130px;
  }

  &-size-larger {
    flex: none;
    width: 350px;
  }

  &-size-large {
    flex: none;
    width: 250px;
  }

  &-size-huge {
    flex: none;
    width: 450px;
  }

  &-value-numeric {
    font-family: var(--font-monospace);
    min-width: 65px;
    padding-right: 10px;
    text-align: right;
  }

  &-main {
    font-weight: bold;
  }

  &-spacer {
    border: none;
    flex: none;
    width: 0;
  }

  &-clickable {
    cursor: pointer;
  }
}

/**
 * Content in a cell that should not take the entire
 * space. Usually because it has a $E after it.
 */
.list-cell-partial {
  display: inline-block;
  float: left;
  max-width: calc(100% - 40px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-cell-partial-clickable {
  cursor: pointer;
}

.list-cell-partial-size-medium {
  max-width: calc(100% - 60px);
}

/**
 * For example a $E icon to the right
 * of a cell.
 */
.list-cell-helper {
  float: right;
  margin-right: 5px;
}

.list-link {
  cursor: pointer;
}

.list-row:hover {
  .list-cell {
    opacity: 1;

    &-clickable {
      text-decoration: underline;
    }
  }

  .list-cell-partial-clickable {
    text-decoration: underline;
  }

  .list-link {
    text-decoration: underline;
  }
}

.list-row-highlight .list-cell,
.list-cell-highlight {
  opacity: 1;
}

/* ARROW FOR COLLAPSING AND EXPANDING */
.list-cell-arrow {
  cursor: pointer;
  display: block;
  float: left;
  height: 30px;
  position: relative;
  width: 15px;

  &::before {
    color: var(--base10);
    font-size: 75%;
    position: absolute;
    right: 5px;
    top: 0;
  }
}

/* cell expanding/collapsing */
.list-cell-arrow-expanded,
.list-cell-arrow-collapsed {
  cursor: pointer;
}

.list-cell-arrow-collapsed {
  .list-cell-arrow::before {
    content: "\25B6";
  }
}

.list-cell-arrow-expanded {
  .list-cell-arrow::before {
    content: "\25BC";
  }
}

.list-row-arrow-collapsed,
.list-row-arrow-expanded {
  cursor: pointer;
  position: relative;
}

.list-row-arrow-collapsed {
  .list-cell-arrow::before {
    content: "\25B6";
  }
}

.list-row-arrow-expanded {
  .list-cell-arrow::before {
    content: "\25BC";
  }
}
