@import '~styles/mixins';
@import '~styles/adminMixins';
@import '~styles/items/checkedBox';

.VirtualTable {
  font-size: 14px;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overflow-x: auto;

  .table {
    min-width: 100%;
  }

  .head {
    font-size: 18px;
    color: $color_table_head;
    font-weight: bold;
    position: relative;
    user-select: none;
    text-align: left;
    display: flex;
    align-items: center;
    width: 100%;
    text-transform: initial;

    &.head-label {
      &:not(.action) {
        &:not(.detail) {
          &:not(.edit) {
            height: 26px;
            border-right: 2px solid $color-border;
          }
        }
      }
    }

    &.index,
    &.button,
    &.edit,
    &.picture {
      width: 100%;
      display: flex;
      justify-content: center;
    }

    .arrow {
      @include v_align;
      right: 8px;

      &.inverted {
        transform: translateY(-50%) rotate(180deg);
      }
    }

    .filter {
      position: absolute;
      right: 10px;
      top: -2px;

      .icon {
        font-size: 22px;
      }
    }
  }

  .row {
    border-bottom: 2px solid $color_border;
    align-items: initial;
    overflow: visible !important;

    &:hover {
      background-color: rgb(250, 250, 250);
    }

    > * {
      height: 100%;
      overflow: initial !important;
    }
  }

  .header-row {
    box-shadow: 0 2px 20px 0 rgba(0, 0, 0, 0.05);
    border-bottom: 2px solid $color_border;
    border-top: 2px solid $color_border;
    background-color: #f8f8f8;
  }

  *:focus {
    outline: none;
  }

  .action {
    text-align: center;

    .button-icon {
      padding: 0;
      width: 32px;
      height: 32px;
      text-align: center;
      border-radius: 100%;
      background-color: $color_primary;
    }
  }

  .status {
    position: relative;

    .infos {
      > * {
        @include middle;
        @include status;
        margin-right: 5px;
        border-radius: 2px;
      }

      &:not(.label-info) {
        > * {
          height: 10px;
          width: 10px;

          &:before {
            border-radius: 2px;
          }
        }
      }
    }
  }

  a {
    color: $color_link;
    display: inline-block;
    @include underline($color_link);
  }

  .picture-wrapper {
    height: 100%;
    width: 100%;
    padding: 5%;
    .picture {
      height: 100%;
      width: 100%;
      background-size: contain;
      background-repeat: no-repeat;
      background-position: center;
      position: relative;
      border-radius: $border_radius;
      &.contain {
        background-size: contain;
      }

      &:hover {
        &:before {
          content: '';
          cursor: pointer;
          @include absolute-fill;
          background-color: rgba(255, 255, 255, 0.1);
        }
      }
    }
  }

  .cell-container {
    display: flex;
    align-items: center;
    height: 100%;
    overflow: hidden;

    &.cell-container-active {
      overflow: initial;
    }

    &.can-update {
      cursor: pointer;
    }

    &.center-value {
      justify-content: center;
    }

    &.cell-container-with-overflow {
      overflow: visible;
    }

    .text-cell-container {
      text-overflow: ellipsis;
      overflow: hidden;
      white-space: nowrap;
    }

    .index {
      width: 100%;
    }
  }

  .list-cell-container {
    width: 100%;
  }

  .list-cell-values {
    display: flex;
    overflow: hidden;
    width: 100%;
    &.list-cell-column {
      flex-direction: column;
    }
  }
}

:global .ReactVirtualized__Grid__innerScrollContainer {
  overflow: unset !important;
}

.CheckBoxList {
  .check {
    height: 14px;
    width: 14px;
    background-color: #ffffff;
    border: 1px solid $color_border;
    border-radius: 4px;
    cursor: pointer;

    &.active {
      background-color: $color_primary;
    }
  }
}
