@import '../../main_dependencies';

#bb-table-header {
  .dt-filter {
    float: left;
    input {
      height: 35px;
      background-color: #fff;
      width: 300px;
      border-radius: 2px;
      border-color: #d1d4dc;
      box-shadow: none;
      &:focus {
        @include outline
      }
    }
    @media (max-width: $screen-sm-max) {
      float: none;
    }

    .dataTables_filter {
      text-align: left;
    }
  }

  .buttons {
    float: right;

    @media (max-width: $screen-sm-max) {
      float: none;
    }

    .dt-button {
      &:focus {
        @include outline;
      }
    }
  }
}

#bb-table-footer {
  display: flex;
  flex-direction: row;
  align-items: center;

  div.dataTables_paginate {
    margin-right: 10px;
  }

  .pagination > li > a {
    color: #333;
    cursor: pointer;
    &:focus {
      z-index: 10;
    }
  }

  .pagination > .active > a {
    background-color: #3171b4;
    border: 1px solid #3171b4;
    color: white;
  }

  .pagination > li.disabled a {
    color: #9b9b9b;
    cursor:not-allowed;
  }


  // fixes icons in buttons not being centred properly
  .paginate_button.next,
  .paginate_button.previous {
    a {
      display: flex;
    }

    i {
      line-height: 1.42857;
    }
  }
}


.disabled-item-badge {
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #31343b;
  background-color: #fecb1d;
}

.dataTables_wrapper {

  
  th { 
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  td.flex-center-row-with-badge {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  tr[bb-dt-row] {
    td {
      vertical-align: middle;
    }
  }

  .dt-button-collection.dropdown-menu {
    background-color: white;
    border-radius: 2px;
  }

  .dataTables_filter {
    input.form-control {
      margin-left: 0;
    }
  }
}

.dataTables_wrapper .dataTables_processing {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 80px;
  margin-left: -50%;
  text-align: center;
  font-size: 1.2em;
  background-color: white;
  z-index: 1000;
}

bb-data-table-cell {
  max-width: 100%;
}

.dt-cell {
  $border: $bb-dark-gray;
  $bg: white;
  $arrowSize: 8px;
  &__content {
    overflow: hidden;
    text-overflow: ellipsis;
    &--overflows {
      cursor: pointer;
    }
  }
  &__popover {
    border: 1px solid $border;
    box-shadow: 0px 0px 10px #ccc;
    min-width: calc(100% + 80px);
    max-width: 350px;
    white-space: normal;
    background: $bg;
    position: absolute; 
    z-index: 99;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin: 0 auto;
    padding: 8px;
    transition: all 0.25s ease;
    opacity: 0;
    z-index:-1;
    &:before {
      content: "";
      position: absolute;
      left: 0;
      right: 0;
      margin: 0 auto;
      bottom: -$arrowSize/2 - 1px;
      height: $arrowSize; 
      width: $arrowSize;
      border-left: 1px solid $border;
      border-bottom: 1px solid $border;
      transform: rotate(-45deg);
      background: $bg;
    }
    &--bottom {
      top: 100%;
      bottom: unset;
      &:before {
        transform: rotate(135deg);
        bottom: unset;
        top: -$arrowSize/2 - 1px;
      }
    }
    &--visible {
      z-index:1;
      opacity: 1;
    }
  }
}