/*!
  *  Copyright (C) 2018 Robert Bosch GmbH Copyright (C) 2018 Robert Bosch Manufacturing Solutions GmbH, Germany. All rights reserved.
 */

@import '@bci-web-core/common-styles/sass/bci/colors';
@import '@bci-web-core/common-styles/sass/bci/bci-variables';
@import '@bci-web-core/common-styles/sass/bci/mixins/borders';

$drop-border-width: 1px;

.scroll-viewport {
  height: 240px;
  width: 100%;
  overflow-x: hidden;
}

.drag-drop-list-container {
  position: relative;
  box-sizing: border-box;
  border: none;
  height: 100%;
}

.drop-zone-overlay {
  white-space: normal;
  text-align: center;
  overflow-x: hidden;
  overflow-y: auto;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  margin: auto;
  pointer-events: none;
  color: transparent;
  border: none;

  &.empty {
    border: $drop-border-width dashed $boschGray90;
    color: $boschGray85;
  }

  &.active {
    border: $drop-border-width dashed $boschBlue50;
    color: $boschBlue50;
  }
}

mat-selection-list.item-selection-list {
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 0;
  border: none;

  & > mat-list-option.item {
    margin-bottom: $padding-small-vertical;

    &:last-child {
      margin-bottom: 0;
    }
  }
}

mat-list-item.item,
mat-list-option.item {
  background-color: $boschGray95;
  user-select: none;

  &.selected.dragging {
    display: none;
  }
}

.mat-mdc-list-option {
  cursor: default;
}

.overlay-icon {
  height: 50px;
  width: 50px;
  font-size: $icon-font-size-xlarge;
}

.item-label {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.drag-preview-container {
  width: 30 * $grid-size;
  min-height: 6 * $grid-size;
}

.source,
.target:not(.sortable) {
  .item {
    // !important is needed here because the CDK uses transform: translate to move the items but we want it disabled
    transform: none !important;

    .drag-placeholder {
      height: 0;
    }
  }
}

.target.sortable {
  .drag-placeholder {
    height: 6 * $grid-size;
  }
}
