@import './theme/default.pcss';
$blue: $theme-primary-2;
$darkblue: $theme-primary-1;
$orange: $theme-error-3;

.zent-table-container {
  margin-bottom: 20px;
}

.zent-table {
  box-sizing: border-box;
  width: 100%;

  a {
    color: $blue;
    cursor: pointer;

    &:hover {
      cursor: pointer;
      text-decoration: none;
    }
  }

  .tr {
    display: flex;
    border-bottom: 1px solid $theme-stroke-7;
  }

  .expanded-item {
    width: 70px;
    text-align: center;
    position: relative;

    i {
      height: 100%;

      &::before {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
      }
    }
  }

  .thead {
    .tr {
      border-top: none;
      border-bottom: 1px solid $theme-stroke-7;
      background: $theme-stroke-8;
    }
  }

  .tbody {
    .tr {
      &:hover {
        background: $theme-stroke-9;

        .empty-data {
          background: transparent;
        }
      }

      &--expanded {
        background-color: $theme-stroke-9;
      }

      .td {
        padding: 16px 0 8px;

        .expandable-btn {
          position: absolute;
          top: 50%;
          transform: translateY(-50%);
          display: inline-block;
          box-sizing: border-box;
          cursor: pointer;
          width: 17px;
          height: 17px;
          text-align: center;
          background: $theme-stroke-10;
          line-height: 10px;
          border: 1px solid $theme-stroke-7;

          &.expand-btn::after {
            content: "+";
            box-sizing: border-box;
          }

          &.collapse-btn::after {
            content: "-";
            box-sizing: border-box;
          }
        }
      }
    }

    .cell {
      min-height: 30px;
    }
  }

  .tfoot {
    margin-top: 10px;
    box-sizing: border-box;

    &__batchcomponents {
      float: left;
      padding: 5px;
      padding-left: 10px;

      &--has-children {
        border: 1px solid $theme-stroke-7;
        background: $theme-stroke-10;
      }

      &--fixed {
        position: fixed;
        bottom: 0;
      }
    }

    &__page {
      float: right;
    }
  }

  .cell {
    position: relative;
    display: flex;
    flex: auto;
    flex-basis: 0;
    padding: 10px;
    padding-left: 0;
    min-height: 20px;
    align-items: center;
    text-align: left;
    font-size: 12px;

    &__child-container {
      overflow: hidden;
      width: 100%;
      text-overflow: ellipsis;
    }

    &:first-child {
      padding-left: 10px;
    }

    &:last-child {
      justify-content: flex-end;

      .cell__child-container {
        text-align: right;
      }
    }

    &.empty-data {
      line-height: 20px;
      height: 40px;
      justify-content: center;
    }

    &.cell--selection {
      padding-left: 34px;
    }

    &.cell--money,
    &.cell--right {
      justify-content: end;

      .cell__child-container {
        text-align: right;
      }
    }

    &.cell--start {
      justify-content: start;

      .cell__child-container {
        text-align: left;
      }
    }

    &.cell--center {
      justify-content: center;

      .cell__child-container {
        text-align: center;
      }
    }

    .asc,
    .desc {
      margin-left: 3px;
    }

    .desc {
      &:after {
        position: absolute;
        content: '\2193';
      }
    }

    .asc {
      &:after {
        position: absolute;
        content: '\2191';
      }
    }

    .select-check {
      position: absolute;
      left: 10px;
      top: 50%;
      transform: translateY(-50%);
      margin-top: 0;
    }
  }

  .card__thumb {
    float: left;
    margin-right: 5px;
    height: 50px;
  }

  .card__title {
    display: block;
    height: 32px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
    color: $blue;

    &:hover {
      text-decoration: none;
    }
  }

  .card__info {
    font-size: 12px;
    color: $orange;
  }

  .clearfix:after {
    content: "";
    display: table;
    clear: both;
  }
}
