/* @file
 * Tables
 *
 */

td,
th {
  padding: 15px;
}

th.select-all {
  label {
    display: inline;
  }
}
table.highlight>tbody {
  background: $white;
  >tr {
    &:hover {
      background: color($utility, 'lighten-3');
      color: $black;
      a,
      button {
        cursor: pointer;
      }
    } // dont change background on hover for titles
    &.region-title {
      &:hover {
        background: color($utility, 'lighten-4') !important;
      }
    }
  }
}

td.is-active {
  background-color: transparent;
}

table {
  margin: 20px 0;
  &.responsive-table {
    @media #{$medium-and-down} {
      th {
        width: 100%;
      }
    }
  }
  .collection {
    margin: inherit;
    border: 0;
    .collection-item {
      background: inherit;
    }
  }
  .region-title {
    background: color($utility, 'lighten-4');
    color: color($utility, 'darken-2');
    .button.button--small {
      font-size: 0.85em;
    }
    td {
      font-size: 0.9em;
      font-weight: normal;
    }
  }
}

table td {
  font-weight: 200;
}

table thead th {
  color: color($utility, 'darken-1');
  font-size: .9em;
  font-weight: normal;
  a {
    color: $black;
  }
}

tr.region-empty {
  background: $white;
  &:hover {
    background: $white !important;
  }
}

.tablesort {
  &.tablesort--asc {
    background-image: none;
    &::after {
      @extend .material-icons;

      padding-left: 5px;
      content: 'keyboard_arrow_down';
    }
  }
  &.tablesort--desc {
    background-image: none;
    &::after {
      @extend .material-icons;

      padding-left: 5px;
      content: 'keyboard_arrow_up';
    }
  }
}

tr.drag {
  border-top: 1px dashed color($utility, 'darken-2');
  border-bottom: 1px dashed color($utility, 'darken-2');
  background: color($highlight-color-base, 'lighten-4');
}

table.highlight tbody,
table tbody {
  tr.drag-previous,
  tr.drag-previous.field-plugin-settings-editing,
  tr.drag.field-plugin-settings-editing,
  tr.drag {
    @extend .yellow,
    .lighten-5;

    border-top: 2px dashed color($highlight-color-base, 'lighten-4');
    border-bottom: 2px dashed color($highlight-color-base, 'lighten-4');
    &:hover {
      background: color($highlight-color-base, 'lighten-4') !important;
    }
  }
}

.draggable {
  background: $white;
  min-height: 30px;
  a.tabledrag-handle {
    display: inline-block;
    float: none;
    height: auto;
    overflow: visible;
    vertical-align: middle;
    &~* {
      display: inline-block;
      padding: 5px;
      vertical-align: middle;
    }
    .handle {
      background: none;
      width: 30px;
      height: 30px;
      &::before {
        @extend .material-icons;

        color: color($utility, 'darken-2');
        font-size: 20px;
        content: 'drag_handle';
      }
    }
  }
}

//editing widget table styling 
table>tbody>tr.field-plugin-settings-editing {
  @extend .grey,
  .lighten-5;

  border-top: 2px solid color($accent, 'darken-2');
  border-bottom: 2px solid color($accent, 'darken-2');
}

.tabledrag-changed-warning {
  padding: 10px;
  font-size: 1em;
}

.tabledrag-toggle-weight-wrapper {
  .tabledrag-toggle-weight {
    @extend .button-link;
  }
}
