@import "../../styles/variables";

:host {
  ::ng-deep th.resize-enabled span.p-column-resizer {
    width: 8px;
    z-index: 20;

    &:hover {
      background: $blue-300;
      background-clip: content-box;
    }
  }

  ::ng-deep th.resize-disabled span.p-column-resizer {
    cursor: auto;
  }

  ::ng-deep .p-column-resizer-helper {
    background-color: $blue-300;
    z-index: 1000;
  }

  ::ng-deep .p-datatable-scrollable > .p-datatable-wrapper > .p-datatable-table > .p-datatable-thead {
    z-index: 20;
  }

  .table-header {
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .table-header-title {
    font-weight: 500;
    text-transform: uppercase;
    padding-left: 16px;
    margin-right: auto;
  }

  .table-actions {
    padding-top: 1px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 24px;
  }

  .selected-col-header {
    pointer-events: none;
  }

  .table-load-more {
    background-color: transparent !important;
  }

  .load-more-wrapper {
    padding: 32px 0;

    button {
      padding: 8px 40px;
      width: 175px;
    }

    .load-spinner {
      display: inline-block;
      vertical-align: middle;
      background-image: url("../../../../assets/icons/Spinner.svg");
      background-repeat: no-repeat;
      background-size: 16px;
      width: 16px;
      height: 16px;
      margin-right: 6px;

    }
  }


  .no-data {
    text-align: center;
    padding: 15px 0 10px 0;
    font-size: 14px;
    width: 120px;
  }

  tr {
    transition: height 0.5s cubic-bezier(.55,.06,.68,.19);

    &:not(.no-data-row):not(.load-more-wrapper) {
      border-bottom: 1px solid $blue-600;
    }

    &:hover:not(.header):not(.selected):not(.no-data-row):not(.simple):not(.load-more-wrapper) {
      background-color: $blue-650;
      border-bottom: 1px solid $blue-600;
    }

    &.checked:not(.header):not(.selected):not(.no-data-row):not(.simple) {
      background-color: $blue-500;
      .td{
        border-bottom: none;
      }

      &:hover, &.contexted {
        background-color: $blue-550;
      }
    }

    &.selected {
      .td{
        border-bottom-color: $blue-600;
      }
      background-color: $blue-400;

      &:hover {
        background-color: $blue-480;
      }
    }


    &.header {
      height: 48px;
      background-color: $blue-700;
    }

    th {
      vertical-align: middle;
      color: $blue-300;
      border-bottom: none;
      padding:0 8px;

      &.disable-drag {
        cursor: initial !important;
      }

      .col-header {
        text-align: left;
        font-size: 12px !important;
        font-weight: 500;
      }

      &:hover {
        background-color: $blue-600;
      }
    }

    td {
      vertical-align: middle;
      color: $blue-100;
      font-size: 1rem;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      padding: 0 8px;
      &:not(.no-data):not(.load-more-wrapper){
        &.simple{
          border-bottom-color: $blue-100;

        }
      }

      &.no-data {
        color: $blue-250;
        text-align: center;
        padding: 15px 0 10px 0;;
      }
    }

    &:hover {
      .context-button {
        opacity: 1;
      }
    }

    .context-button {
      cursor: pointer;
      position: absolute;
      opacity: 0;
      transition: opacity 0.35s ease-in-out;
      margin-top: 8px;
      width: calc(var(--rowHeight) * 0.666);
      height: calc(var(--rowHeight) * 0.666);
      padding: 3px;
      color: $blue-400;
      background-color: rgba($blue-600, 95%);
      border-radius: 4px;
      border: solid 1px $blue-400;
      &:hover {
        color: $blue-300;
        background-color: $blue-570;
      }
    }
  }

  :host-context(.light-theme) {
    tr {
      &:not(.no-data-row):not(.load-more-wrapper) {
        border-bottom: 1px solid $blue-50;
      }
      &.checked:not(.header):not(.no-data-row):not(.simple):not(.load-more-wrapper) {
        background-color: $blue-100;
        border-bottom-color: $blue-50;

        &:hover, &.contexted {
          background-color: $blue-50;
        }
      }

      &:hover:not(.header):not(.no-data-row):not(.simple):not(.load-more-wrapper) {
        background-color: $blue-50;
        border-bottom-color: $blue-50;
      }

      &.header {
        background-color: $blue-50;
        @supports (-moz-appearance:meterbar) {
          border-bottom: 3px solid $blue-500;
        }
      }

      th {
        color: $blue-400;
        font-weight: 500;
        border-bottom: none;

        &:hover {
          background-color: $blue-100;
        }
      }

      td {
        color: $blue-400;
        border-bottom: none;
        &.no-data {
          color: $blue-300;
        }
      }
    }
  }
}
:host-context(.dark-theme-table.table-first-column-color) {
  tr td:not(.no-data):not(.load-more-wrapper).simple {
    border-bottom-color: $dark-grey-blue;
    color: $blue-280;
    &:first-child {
      color: $blue-400;
    }
  }
}
