.zed-table {
  display: flex;
  min-height: 0;
  flex-flow: column;
  height: 100%;
  width: 100%;
  font-family: var(--mono-font);

  --header-height: 34px;
  --row-height: 26px;
}

.zed-table__header {
  width: 100%;
  position: sticky;
  top: 0;
  left: 0;
  background: var(--bg-color);
  z-index: 1;
}

.zed-table__header-group {
  display: flex;
  align-items: center;
  position: relative;
  height: var(--header-height);
  border-bottom: 1px solid var(--border-color);

  &--parent {
    display: flex;
    align-items: center;
    position: relative;
    height: var(--header-height);
    border-bottom: none;
  }
}

.zed-table__header-cell {
  flex-shrink: 0;
  line-height: var(--header-height);
  height: 100%;
  white-space: nowrap;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  border-right: 1px solid transparent;
  color: var(--fg-color-less);
  background: var(--chrome-color);
  border-right-color: var(--border-color);

  &:not(.isPlaceholder).hasChildren {
    border-bottom: 1px solid var(--border-color);
  }
}

.zed-table__header-cell-info {
  display: flex;
  align-items: center;
  height: 100%;
  min-width: 0;
  position: sticky;
  left: 10px;
}

.hasChildren .zed-table__header-cell-text {
  font-weight: normal;
  font-style: italic;
}

.zed-table__header-cell-text {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;

  padding-right: 2px; // So we don't clip the italics
}

.zed-table__sort-icon {
  margin: 0 4px;
  width: 11px;
  height: 11px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.zed-table__header-resize-area {
  width: 17px;
  height: 100%;
  position: absolute;
  cursor: col-resize;
  display: flex;
  justify-content: center;
  bottom: 0;
  right: -8px;
  z-index: 2;
  border: none;
}

.zed-table__cell {
  &.even {
    background-color: var(--emphasis-bg-less);
  }

  overflow: hidden;
  white-space: nowrap;
  padding: 0 10px;
  padding-right: 0;
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);

  a {
    display: flex;
    align-items: center;
    user-select: none;
  }

  a:hover {
    background-color: rgba(0, 0, 0, 0.04);
    border-radius: 3px;
    cursor: default;
  }
}

.zed-table__line {
  white-space: pre;
  height: var(--row-height);
  display: flex;
  align-items: center;
}

.zed-table__header-cell-menu-button {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  width: 20px;
  padding: 0;
  border-radius: 6px;
  border: none;
  z-index: 1;
  background: none;
  position: absolute;
  right: 10px;
  opacity: 0;
  background: var(--chrome-color);
  border: 1px solid var(--border-color);

  &:active {
    background: var(--chrome-color-more);
  }

  .zed-table__header-cell:hover & {
    opacity: 1;
  }

  .zed-table--resizing & {
    opacity: 0 !important;
  }
}
