@import "mixins/mixins";
@import "mixins/utils";
// @import "common/var";
@import "select";

@include b(pagination) {
  white-space: nowrap;
  // padding: 2px 5px;
  color: $--pagination-font-color;
  font-weight: $--font-weight-700;
  @include utils-clearfix;
  span:not([class*=suffix]),
  button {
    display: inline-block;
    font-size: $--checkbox-font-size;
    min-width: $--pagination-button-width;
    height: $--pagination-button-height;
    // line-height: $--pagination-button-height;
    line-height: 22px;
    vertical-align: top;
    box-sizing: border-box;
    color: $--color-text-2;
  }
  @include e(total) {
    margin-right: 16px;
    font-weight: $--font-weight-400;
    color: $--color-text-regular;
    line-height: 22px;
    padding-top: 5px;
    padding-bottom: 5px;
  }

  .el-input__inner {
    text-align: center;
    -moz-appearance: textfield;
    line-height: 22px;
    border-radius: $--border-radius-small;
  }

  // pagesize 的下拉 icon
  .el-input__suffix {
    right: 8px;
    height: 32px;
    top: 2px;
    .el-select__caret{
      color: $--color-text-2 !important;
      transform: rotateX(180deg) !important;
    }
    .is-reverse {
      transform: rotateX(0deg) !important;
    }
    // transform: scale(.8);
  }

  .el-select .el-input {
    width: 91px;
    margin-left: 12px;

    .el-input__inner {
      padding-right: 25px;
      // border-radius: $--pagination-border-radius;
      border-radius: $--border-radius-small;
      height: 32px;
      border: $--border-1 solid $--color-border-3;
      line-height: 22px;
    }

  }

  button {
    border: none;
    padding: 0 6px;
    background: transparent;

    &:focus {
      outline: none;
    }

    &:hover {
      color: $--pagination-hover-color;
    }

    &:disabled {
      color: $--pagination-button-disabled-color;
      background-color: $--pagination-button-disabled-background-color;
      cursor: not-allowed;
    }
  }

  .btn-prev,
  .btn-next {
    background: center center no-repeat;
    background-size: 16px;
    background-color: $--pagination-background-color;
    cursor: pointer;
    margin: 0;
    color: $--pagination-button-color;

    .el-icon {
      display: block;
      font-size: $--font-size-medium
    }
  }

  .btn-prev {
    padding-right: 12px;
  }

  .btn-next {
    padding-left: 12px;
  }

  .el-pager li.disabled {
    color: $--color-text-placeholder;
    cursor: not-allowed;
  }

  @include m(small) {
    .btn-prev,
    .btn-next,
    .el-pager li,
    .el-pager li.btn-quicknext,
    .el-pager li.btn-quickprev,
    .el-pager li:last-child {
      border-color: transparent;
      font-size: $--font-size-body-1;
      line-height: 22px;
      height: 22px;
      min-width: 22px;
    }

    .arrow.disabled {
      visibility: hidden;
    }

    .more::before,
    li.more::before {
      line-height: 24px;
    }

    span:not([class*=suffix]),
    button {
      height: 22px;
      line-height: 22px;
    }

    @include e(editor) {
      height: 22px;
      &.el-input .el-input__inner {
        height: 22px;
      }
    }
  }

  @include e(sizes) {
    margin: 0;
    font-weight: $--font-weight-400;
    color: $--color-text-regular;

    .el-input .el-input__inner {
      font-size: $--checkbox-font-size;
      padding-left: 12px;

      &:hover {
        border-color: $--color-text-3;
      }
    }
  }

  @include e(jump) {
    margin-left: 16px;
    font-weight: $--font-weight-400;
    color: $--color-text-regular;

    .el-input__inner {
      padding: 0 3px;
    }
  }

  @include e(rightwrapper) {
    float: right;
  }

  @include e(editor) {
    line-height: 18px;
    padding: 0 2px;
    height: $--pagination-button-height;

    text-align: center;
    margin: 0 8px;
    box-sizing: border-box;
    // border-radius: $--pagination-border-radius;
    border-radius: $--border-radius-small;

    &.el-input {
      width: 52px;
    }

    &.el-input .el-input__inner {
      height: $--pagination-button-height;
    }

    .el-input__inner::-webkit-inner-spin-button,
    .el-input__inner::-webkit-outer-spin-button {
      -webkit-appearance: none;
      margin: 0;
    }
  }
  @include e(simple) {
    font-weight: $--font-weight-400;
  }
  @include when(background) {
    .btn-prev,
    .btn-next,
    .el-pager li {
      margin: 0 4px;
      // background-color: $--color-info-lighter;
      color: $--color-text-2;
      min-width: 32px;
      line-height: 22px;
      padding-top: 4px;
      padding-bottom: 4px;
      // border-radius: 2px;
      border-radius: $--border-radius-small;
      border: $--border-1 solid $--color-border-3;
      font-weight: $--font-weight-400;
      &.disabled {
        // color: $--color-text-placeholder;
        color: $--color-border-2;
      }
    }
    .btn-prev {
      margin-left: 0;
      // margin-right: 8px;
    }
    .btn-next {
      margin-right: 0;
      // margin-left: 8px;
    }
    .el-pager li.el-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    .btn-prev, .btn-next {
      padding: 0;
      border: $--border-1 solid $--color-border-3;
      background-color: none;
      &:hover{
        background: $--color-bg-3;
      }
      &:active{
        border-color: $--color-border-4;
        background-color: $--color-fill-4;
      }
      &:disabled {
        color: $--pagination-button-disabled-color;
        border-color: $--color-border-3;
        background: none!important;
      }
    }
    // .btn-prev:hover, .btn-next:hover {
      // background: $--color-bg-3;
    // }
    // .btn-prev:active, .btn-next:active{
    //   border-color: $--color-border-4;
    //   background-color: $--color-fill-4;
    // }
    .el-pager li:not(.disabled) {
      &:hover {
        // color: $--pagination-hover-color;
        background-color: $--color-bg-3;
      }

      &.active {
        background-color: $--color-primary;
        color: $--color-white;
        border: 1px solid $--color-primary;
      }
    }

    &.el-pagination--small {
      .btn-prev,
      .btn-next,
      .el-pager li {
        margin: 0 3px;
        min-width: 22px;
      }
    }
  }
}

@include b(pager) {
  user-select: none;
  list-style: none;
  display: inline-block;
  vertical-align: top;
  font-size: 0;
  padding: 0!important;
  margin: 0;

  .more::before {
    line-height: 30px;
  }

  li {
    padding: 0 4px;
    background: $--pagination-background-color;
    vertical-align: top;
    display: inline-block;
    font-size: $--checkbox-font-size;
    min-width: $--pagination-button-width;
    height: $--pagination-button-height;
    line-height: $--pagination-button-height;
    cursor: pointer;
    box-sizing: border-box;
    text-align: center;
    margin: 0;

    &.btn-quicknext,
    &.btn-quickprev {
      line-height: $--pagination-button-height;
      color: $--pagination-button-color;

      &.disabled {
        color: $--color-text-placeholder;
      }
    }

    &.btn-quickprev:hover {
      cursor: pointer;
    }

    &.btn-quicknext:hover {
      cursor: pointer;
    }

    &.active + li {
      border-left: 0;
    }

    &:hover {
      color: $--pagination-hover-color;
    }

    &.active {
      color: $--pagination-hover-color;
      cursor: default;
    }
  }
}
.el-pagination__editor{
  .el-input__inner{
    padding: 0;
  }
}
