@import "./base.less";

.@{css-prefix}.table {
  position: relative;
  // overflow: hidden;
  background: #FFF;
  color: @base-font-color;
  font-size: @base-font-color;
  .border;
  z-index: 1;

  .header, .body {
    overflow: hidden;
  }

  .header {
    .filters {
      cursor: pointer;
      display: inline-block;
      padding-right: .6em;
      .content {
        position: absolute;
        background: #ffffff;
      }
    }
  }

  table {
    table-layout: fixed;
    text-align: left;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;

    td, th {
      transition: background .1s ease,color .1s ease;
      padding: @table-cell-padding;
      border-bottom: @table-cell-border-style;
      word-wrap: break-word;
      /**
      white-space: nowrap;
      text-overflow:ellipsis;
      overflow: hidden;
      **/

      i {
        cursor: pointer;
      }
    }

    thead th, tfoot th {
      background: @table-th-background-color;
      font-weight: 500;
    }

    thead {
      tr {
        th {
          color: rgba(0, 0, 0, .75);
          &.sortable:hover {
            background: @table-th-hover-background-color;
          }
          &.sortable {
            cursor: pointer;
          }
        }
      }
    }

    tbody {
      tr {
        &:hover, &.hover {
          background: @table-cell-hover-background-color;
        }
        &.count {
          background: @warning-background-color;
        }
        &.active {
          background: @active-background-color;
        }
        td {
          &.no-more {
            background: @warning-background-color;
            font-style: italic;
          }
        }

        &:last-child td {
          border-bottom: none;
        }
      }
    }

    tfoot {
      tr {
        th {
        }
      }
    }

  }

  &.bordered {
    border-right: none;
    td, th {
      border-right: @table-cell-border-style;
    }
  }
  &.bordered-header {
    th {
      border-right: @table-cell-border-style;
    }
  }
  &.striped {
    tr:nth-child(even) td {
      background: #FAFAFB;
    }
  }

  .fixed {
    position: absolute;
    top: 0;
    background: @table-cell-hover-background-color;

    table {
      width: auto;
    }

    .body {
      overflow: hidden;
    }

    &.left {
      left: 0;
      box-shadow: 6px 0 6px -4px rgba(0,0,0,.2);
    }
    &.right {
      right: 0;
      box-shadow: -6px 0 6px -4px rgba(0,0,0,.2);

      .patch {
        position: absolute;
        right: -15px;
        top: 0;
        width: 15px;
        background: @table-th-background-color;
      }
    }
  }
}

@media only screen and (max-width: @largestMobileScreen) {
  .@{css-prefix}.table {
    table {
      th, td {
        white-space: pre-wrap;
      }
    }
  }
}
