@use '../variables.scss' as *;

/* Row Headers */
.header {
  composes: flexRow from '../dim-ui/common.m.scss';
  align-items: center;
  padding-right: 16px;
  padding-left: 4px;
  cursor: pointer;
  position: sticky;
  left: 0;
  align-self: stretch;
  background-color: var(--theme-item-sheet-bg);
  z-index: 2;
  border-right: 1px solid #f5f5f540;
  img {
    height: 16px;
    width: 16px;
    vertical-align: bottom;
  }
}
.sortDesc {
  padding-right: 8px;
  color: var(--theme-accent-primary);
}
.sortAsc {
  padding-right: 8px;
  color: var(--theme-accent-secondary);
}
.highlighted {
  background-color: #202020;
}
.spacer {
  composes: header;
  cursor: default !important;
}
.headerContent {
  composes: flexRow from '../dim-ui/common.m.scss';
  align-items: center;
  gap: 2px;
}

// The highlight behind each item
.highlightBar {
  position: relative;
  &::after {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    // Reserve space for always-on scrollbars :-(
    width: calc(
      100vw - var(--scrollbar-width) - env(safe-area-inset-left) - env(safe-area-inset-right)
    );
    z-index: -1;
    pointer-events: none;
  }
  &.highlighted::after {
    background-color: #202020;
  }
}

/* Items */

// The toolbar across the top of each item
.itemActions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  // pull & lock buttons
  > div:nth-child(1),
  > div:nth-child(2) {
    padding: 4px;
  }
  // Tag selector
  > div > div > button {
    padding: 3px !important;
  }
}

.headerContainer {
  position: relative;
}

.separator {
  width: 0;
  height: 100%;
  border-right: 1px solid #f5f5f540;
  grid-row: 1 / -1; // Span all columns in the grid
}

// The "dismiss" button in the item header
.close {
  composes: resetButton from '../dim-ui/common.m.scss';
  width: 32px;
  height: 32px;
  background-size: 16px;
  background-image: url('images/close.png');
  background-position: center;
  background-repeat: no-repeat;

  @include interactive($hover: true) {
    background-color: var(--theme-accent-primary);
  }
}

// The item icon that's floated behind the stats
.itemAside {
  position: absolute;
  padding: 0;
  right: 4px;
  top: calc(32px + 4px + 1lh);
  cursor: pointer;
}
