/* ==========================================================================
   Data Table
   ========================================================================== */

.datatable {
  overflow-x: auto;
  width: 100%;

  .table {
    border: 0 solid $white;
    margin: 0;
    table-layout: auto;

    tr {
      height: 36px;

      th,
      td {
        font-family: $font-mono;
        font-size: 13px;
        letter-spacing: -.5px;
        max-width: 280px;
        min-width: 140px;
        overflow: hidden;
        padding: 0 20px;
        text-overflow: ellipsis;
        vertical-align: middle;
        white-space: nowrap;
      }

      th {
        color: $accent;
        font-weight: 700;
        line-height: 34px;
        text-transform: none;
      }

      th:nth-child(odd) {
        background: rgba($accent, .05);
      }

      th:nth-child(even) {
        background: rgba($accent, .1);
      }
    }

    tr:nth-child(odd) {
      background: rgba($primary, 0);
    }

    tr:nth-child(even) {
      background: rgba($primary, .02);
    }
  }

  .datatable-type {
    color: rgba($primary, .4);
    font-size: 10px;
    margin-left: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: capitalize;
    white-space: nowrap;
  }

  .datatable-type::first-letter {
    text-transform: uppercase;
  }

  .datatable-string,
  .datatable-number,
  .datatable-boolean,
  .datatable-object,
  .datatable-array {
    color: rgba($primary, .6);
    font-weight: 500;
  }

  .datatable-undefined,
  .datatable-null {
    color: rgba($primary, .2);
    font-weight: 500;
  }

  /* Reset Table Borders
     ======================================================================== */

  .table tr th,
  .table tr td {
    border-bottom: 0 solid rgba($primary, .2);
    border-right: 0 solid rgba($primary, .2);
  }

  .table tr th:first-child,
  .table tr td:first-child {
    border-left: 0 solid rgba($primary, .2);
  }

  .table tr th:first-child,
  .table tr td:first-child {
    border-left: 0 solid rgba($primary, .2);
  }

  .table tr th {
    border-top: 0 solid rgba($primary, .2);
  }

  .table.no-header tr:first-child td {
    border-top: 0 solid rgba($primary, .2);
  }

  .table tr:first-child th:first-child {
    border-top-left-radius: 0;
  }

  .table.no-header tr:first-child td:first-child {
    border-top-left-radius: 0;
  }

  .table tr:first-child th:last-child {
    border-top-right-radius: 0;
  }

  .table.no-header tr:first-child td:last-child {
    border-top-right-radius: 0;
  }

  .table tr:last-child td:first-child {
    border-bottom-left-radius: 0;
  }

  .table tr:last-child td:last-child {
    border-bottom-right-radius: 0;
  }
}

/* Loading
   ========================================================================== */

.light-loader {
  display: none;
  height: 100%;
  position: absolute;
  width: 100%;
  z-index: 97;

  .spinner {
    left: 50%;
    position: absolute;
    top: 50%;
    transform: translateX(-50%) translateY(-50%);
  }
}

.loading .light-loader {
  display: block;
}

/* Empty Collections, Empty Data
   ========================================================================== */

.empty-collection,
.empty-data {
  animation: fadeIn .5s cubic-bezier(.3, 0, .3, 1) 0s 1 forwards;
  background: $white;
  display: none;
  height: 100%;
  position: absolute;
  width: 100%;
  z-index: 97;

  .notfound {
    position: relative;
    top: 50%;
    transform: translateY(-50%);

    .notfound-icon [class*="icon-"] {
      font-size: 36px;
    }
  }
}

.no-collections .empty-collection {
  display: block;
}

.no-data .empty-data {
  display: block;
}
