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

// Items hidden by search.
.searchHidden {
  opacity: var(--search-hidden-opacity, 0.2);
  // TODO: Testing whether scale transform triggers slow sheet animations: https://github.com/DestinyItemManager/DIM/issues/7458
  // transform: scale(0.75);
}

// The top-level item container. Global because it's referenced by other styles.
:global(.item) {
  position: relative;
  contain: layout paint style size;
  box-sizing: border-box;
  width: var(--item-size);
  height: var(--item-size);
  // searchHidden will adjust opacity/transform, this transitions them
  transition:
    opacity 0.2s,
    transform 0.2s;
}

.hasBadge {
  height: calc(var(--item-size) + #{$badge-height} - #{$item-border-width});
}

// The wrapper for draggable items. Global because it's referenced by other styles.
:global(.item-drag-container) {
  contain: layout paint style;
  box-sizing: border-box;
  width: var(--item-size);
  cursor: grab;

  @include interactive($hover: true) {
    @include draggable-hover-border;
  }
}

// Subclass items
.subclassBase {
  border-color: transparent !important;
}
.subclass {
  &::before {
    background-image: url('../../images/subclass-border.svg');
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
    left: 0;
    top: 0;
  }
}
.subclassSuperIcon {
  position: absolute;
  width: calc(var(--item-size) - 4px);
  height: calc(var(--item-size) - 4px);
  left: 2px;
  top: 2px;
}

// The bar we show for items that have some progress on them
.xpBar {
  background: rgb(0, 0, 0, 0.5);
  position: absolute;
  width: auto;
  left: $item-border-width + 2px;
  right: $item-border-width + 2px;
  opacity: 1;
  top: $item-border-width + 2px;
  height: calc(var(--item-size) / 9);
}
.xpBarAmount {
  height: 100%;
  background-color: $xp;
}

// The container for the tag/notes/wishlist icons
.icons {
  position: absolute;
  right: $item-border-width + 2px;
  top: calc(var(--item-size) - #{$badge-height});
  display: flex;
  flex-direction: row;
}

// Individual icons in the icon tray
.icon {
  display: block;
  position: static;
  width: calc(var(--item-size) / 5);
  height: calc(var(--item-size) / 5);
  font-size: calc(var(--item-size) / 5);
  margin-right: 1px;
  color: #29f36a; // #5eff92;
  filter: drop-shadow(0 0 2px rgb(0, 0, 0, 0.8));
}

.warningIcon {
  display: block;
  width: calc(var(--item-size) / 5);
  height: calc(var(--item-size) / 5);
  font-size: calc(var(--item-size) / 5);
  position: absolute;
  top: $item-border-width + 2px;
  right: $item-border-width + 3px;
  pointer-events: none;
  filter: drop-shadow(0 0 2px rgb(0, 0, 0, 0.8));
}

.statFocus {
  display: block;
  width: calc(#{dim-item-px(13)});
  height: calc(#{dim-item-px(13)});
  position: absolute;
  top: $item-border-width;
  right: $item-border-width;
  pointer-events: none;
  background-size: contain;
  filter: drop-shadow(0 0 1px rgb(0, 0, 0, 1)) drop-shadow(0 0 0.5px rgb(0, 0, 0, 1));
}
