$table-row-background: #FFFFFF;
$table-row-alt-background: #F4F4F4;
$table-row-hover-background: #F9F9F9;
$table-pager-active-background: #4DB0F7;

table[md-data-table],
table[md-table] {
  border-spacing: 0;

  .md-table-progress {
    th {
      height: 1px;
    }
  }


  > thead,
  > thead:not(.md-table-progress) {

    > tr {

      > th {
        color: $font-color;
        text-align: left;
        font-size: 16px;
        font-size: 1.6rem;
        font-weight: 600;
        height: 50px;

        > div {
          height: 50px;
        }

        > md-checkbox {
          margin: 0 10px 0 16px;
        }

        md-icon {

          &.md-asc,
          &.md-desc {
            min-height: 16px;
            min-width: 16px;
          }
        }
      }
    }
  }

  tbody {

    tr {

      &:hover {
        background-color: $table-row-hover-background !important;
      }

      td {
        color: $font-color;
        padding: 15px 0px 15px 20px;
        font-size: 16px;
        font-size: 1.6rem;
        font-weight: normal;

        a {
          font-weight: 600;
          transition: $font-color-hover-animation;
          color: $font-link-color;
          text-decoration: none;
          cursor: pointer;

          &:hover {
            color: $font-link-color-hover;
          }
        }

        em {
          color: $font-color-disabled;
          font-size: 13px;
          font-size: 1.3rem;
          font-style: normal;
        }

        md-switch {
          margin: 10px 0;

          &:first-child {
            margin-top: 0;
          }

          &:last-child {
            margin-bottom: 0;
          }
        }

        md-checkbox {
          margin: 0 10px 0 20px;
        }

        md-input-container {
          margin: 0;
        }
      }
    }
  }



  thead:not(.md-table-progress) tr,
  tbody tr {
    background: $table-row-background;
    min-height: 50px;

    th, td {

      &:last-child {
        width: 100%;
      }

      &.thumbnail-small, .thumbnail-small {
        max-width: 35px;
        min-width: 35px;
        margin-right: 10px;

        img {
          border-radius: 50%;
          margin: 0;
        }
      }
    }

    .action {
      text-align: right;
    }
  }

  &.condensed {

    tr {
      height: auto;

      td {
        font-size: 14px;
        font-size: 1.4rem;
        padding: 4px 0px 4px 20px;
      }
    }
  }
}

table[md-data-table]:not([md-row-select])>tbody>tr>td:first-child,
table[md-data-table]:not([md-row-select])>tfoot>tr>td:first-child,
table[md-table]:not([md-row-select])>tbody>tr>td:first-child,
table[md-table]:not([md-row-select])>tfoot>tr>td:first-child {
  padding: 14px 28px 14px 24px;
}

table[md-data-table]:not([md-row-select])>tbody>tr>td:nth-child(n+2):nth-last-child(n+2),
table[md-data-table]:not([md-row-select])>tfoot>tr>td:nth-child(n+2):nth-last-child(n+2),
table[md-table]:not([md-row-select])>tbody>tr>td:nth-child(n+2):nth-last-child(n+2),
table[md-table]:not([md-row-select])>tfoot>tr>td:nth-child(n+2):nth-last-child(n+2) {
  padding: 14px 28px;
}

table[md-data-table]>tbody>tr>td:last-child,
table[md-data-table]>tfoot>tr>td:last-child,
table[md-table]>tbody>tr>td:last-child,
table[md-table]>tfoot>tr>td:last-child {
  padding: 14px 24px 14px 28px;
}

table[md-table]:not([md-row-select])>thead:not(.md-table-progress)>tr>th:first-child {
  padding: 0 28px 0 24px;
}

table[md-table]:not([md-row-select])>thead:not(.md-table-progress)>tr>th:nth-child(n+2):nth-last-child(n+2) {
  padding: 0 28px;
}

table[md-table]>thead:not(.md-table-progress)>tr>th:last-child {
  padding: 0 24px 0 28px;
}

table[md-table]>tbody>tr>td {
  border-top: 1px rgba(0,0,0,.12)solid;
}

md-data-table-container,
md-table-container {
  padding: 0;
}

md-data-table-pagination,
md-table-pagination {
  padding: 0 20px;

  div {
    font-size: 16px;
    font-size: 1.6rem;
  }

  md-list {
    list-style: none;
    padding-left: 0;
    justify-content: center;
    align-items: center;
    margin: 0;

    li {
      display: inline-block;

      &:nth-child(even) {
        background: $table-row-alt-background;
      }

      &.active {
        background: $table-pager-active-background;

        a {
          color: $inverse-font-color;
        }
      }

      a {
        font-size: 13px;
        font-size: 1.3rem;
        text-decoration: none;
        display: block;
        padding: 5px 10px;
        text-align: center;
        min-width: 10px;
        color: $nav-link-color;
      }
    }
  }
}

/* Mobile */
@media (max-width: 767px) {

  table[md-data-table] > tbody > tr:hover,
  table[md-table] > tbody > tr:hover {
    background-color: $table-row-background !important;
  }

}
