/*!
 * Copyright (c) 2023 D2ArmorPicker by Mijago.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

.slot-icon-container {
  float: right;
  position: relative;

  .slot-icon {
    height: 30px;
    position: absolute;
    left: -30px;
    filter: invert(1) drop-shadow(1px 1px 3px rgba(0, 0, 0, 0.25)) !important;
  }
}

.container {
  height: 60px;
}

.select-button {
  min-width: 40px;
}

.selector-element {
  position: relative;
  float: right;
  width: 90px;
  height: 70px;
  top: -21px;

  .lock {
    position: absolute;
    bottom: 2px;
    left: 60px;
  }

  .element-list {
    float: left;
    width: 70px;
    padding-left: 5px;

    .element-icon {
      border: #00000000 solid 2px;
      height: 26px;
      width: 26px;
      margin-right: 1px;
      margin-bottom: 1px;
      margin-top: 1px;
      cursor: pointer;
      filter: grayscale(0.4);

      &:hover {
        filter: grayscale(0.2);
      }
      &.selected {
        filter: grayscale(0);
      }
    }
  }
}

:host ::ng-deep .selector-slots .mat-button-toggle {
  background-color: inherit;
}

.modslot-selection {
  width: 180px;
}

.selector-slots {
  position: relative;
  float: right;
  //width: 155px;
  // margin-right: 9px;
  top: -10px;

  .lock {
    position: absolute;
    bottom: 2px;
    left: 140px;
  }

  .element-list {
    float: left;
    height: 70px;
    width: 175px;
    padding-left: 5px;

    .element-icon {
      height: 30px;
      width: 30px;
      border: #00000000 solid 2px;
      margin-right: 1px;
      margin-top: -2px;
      cursor: pointer;

      &.disabled {
        opacity: 0.5;
        cursor: default;
        border: #00000000 solid 2px !important;
      }
    }
  }
}

.impossible {
  background-color: rgba(255, 0, 0, 0.3);
  cursor: help;
}

.left_line {
  pointer-events: none;
  height: 15px;
  width: 100%;
  border-left: 1px solid white;
  border-bottom: 1px solid white;
  position: absolute;
  bottom: 0px;
  left: 0;
}

.overlay-icon-container {
  position: relative;

  .overlay-icon {
    width: 20px;
    position: absolute;
    left: 7px;
    bottom: 11px;
    pointer-events: none;
  }
}

.element-icon:hover {
  border: cornflowerblue solid 2px !important;
}

.selected,
.selected:hover {
  background-color: rgba(137, 178, 255, 0.24);
  border: #0059ff solid 2px !important;
}

.energy-container {
  .energy-bar {
    float: left;
    margin-right: 3px;
    width: 20px;
    height: 10px;

    border: white solid 2px;

    cursor: pointer;
  }

  .energy-bar.none {
    border: indianred solid 2px;
  }

  .energy-bar:hover,
  .hovered {
    background-color: #6e6e6e;
  }

  .hovered-higher {
    background-color: rgba(0, 0, 0, 0) !important;
  }

  .energy-bar.active {
    background-color: white;
  }

  .energy-bar.blocked {
    border: #606060 solid 2px;
    background-color: #6e6e6e;
  }
}

.mod-info {
  position: relative;
  float: left;
  height: 40px;
  width: 40px;
  margin-right: 5px;

  .mod-number {
    position: absolute;
    top: 1px;
    bottom: 1px;
    right: 1px;
    left: 1px;
    pointer-events: none;
    fill: #e0e0e0;
  }

  .mod-minor {
    display: none;
  }

  .overlay {
    position: absolute;
    top: 0px;
    width: 100%;
    height: 100%;

    background: linear-gradient(
        to top left,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0) calc(50% - 0.8px),
        rgb(0, 0, 0) 50%,
        rgba(0, 0, 0, 0) calc(50% + 0.8px),
        rgba(0, 0, 0, 0) 100%
      ),
      linear-gradient(
        to top right,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0) calc(50% - 0.8px),
        rgb(0, 0, 0) 50%,
        rgba(0, 0, 0, 0) calc(50% + 0.8px),
        rgba(0, 0, 0, 0) 100%
      );
  }

  .mod-icon {
    width: 40px;
    height: 40px;
  }

  .mod-minor {
    border: #00000000 solid 3px;
    width: 34px;
    height: 34px;
  }

  &.major,
  &.minor {
    .overlay {
      display: none;
    }
  }

  &.minor {
    .mod-minor {
      display: block;
    }

    .mod-major {
      display: none;
    }
  }
}

.menuArmorIcon {
  position: absolute;
  top: 8px;
}
.menuArmorText {
  padding-left: 35px;
}

.selected-menu {
  background-color: rgba(137, 178, 255, 0.24);
  &:hover {
    background-color: rgba(137, 178, 255, 0.3);
  }
}

::ng-deep .modslot-select-scroll-menu {
  overflow-y: auto;
  max-height: 250px !important;
}
