/*
TODO : Should we be specifying font size here and in button component?  seems to work fine without it
*/

@mixin disabled-item() {
  cursor: not-allowed;

  &:hover {
    border-color: #d9d9d9;
    a {
      color: #d9d9d9;
    }
  }
}

.rc-pagination {
  //font-size: $font-size;
  user-select: none;
  padding: 0;
  display: flex;
  align-items: center;

  > li {
    list-style: none;
    margin-right: 0.8rem;
    min-width: 3.5rem;
    align-items: center;
    text-align: center;

    &:last-child {
      margin-right: 0;
    }
    &:empty {
      display: none;
    }
  }

  .ItemPerPage {
    display: flex;
    align-items: center;
    margin-left: auto;

    .rc-pagination {
      margin: 0px 1rem;
    }
  }
  &-total-text {
    // float: left;
    height: 3rem;
    line-height: 3rem;
    list-style: none;
    padding: 0;
    margin: 0 0.8rem 0 0;
  }

  //   &:after {
  //     content: " ";
  //     display: block;
  //     height: 0;
  //     clear: both;
  //     overflow: hidden;
  //     visibility: hidden;
  //   }

  &-item {
    // cursor: pointer;
    // border-radius: 6px;
    // min-width: 28px;
    // height: 28px;
    // line-height: 28px;
    // text-align: center;
    list-style: none;
    // float: left;
    // border: 1px solid #d9d9d9;
    // background-color: #fff;
    // margin-right: 8px;

    a {
      text-decoration: none;
      color: #666;
    }

    &:hover {
      border-color: #2db7f5;
      a {
        color: #2db7f5;
      }
    }

    &-disabled {
      @include disabled-item();
    }

    &-active {
      background-color: #2db7f5;
      border-color: #2db7f5;

      a {
        color: #fff;
      }

      &:hover {
        a {
          color: #fff;
        }
      }
    }
  }

  &-jump-prev,
  &-jump-next {
    &:after {
      content: "•••";
      display: block;
      letter-spacing: 0.2rem;
      color: #ccc;
      //font-size: $font-size;
      margin-top: 0.1rem;
    }

    &:hover {
      &:after {
        color: #2db7f5;
      }
    }
  }

  &-jump-prev {
    &:hover {
      &:after {
        content: "«";
      }
    }
  }

  &-jump-next {
    &:hover {
      &:after {
        content: "»";
      }
    }
  }

  &-jump-prev-custom-icon,
  &-jump-next-custom-icon {
    position: relative;

    &:after {
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
      margin: auto;
      //   transition: all @include 2s;

      content: "•••";
      opacity: 1;
      display: block;
      letter-spacing: 0.2rem;
      color: #ccc;
      //font-size: $font-size;
      margin-top: 0.1rem;
    }

    .custom-icon-jump-prev,
    .custom-icon-jump-next {
      opacity: 0;
      //   transition: all @include 2s;
    }

    &:hover {
      &:after {
        opacity: 0;
        color: #ccc;
      }

      .custom-icon-jump-prev,
      .custom-icon-jump-next {
        opacity: 1;
        color: #2db7f5;
      }
    }
  }

  &-jump-to-page-wrapper {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    margin-left: 1.6rem;
    margin-right: 1.6rem;
    user-select: none;

    select {
      height: 3.6rem;
      line-height: 3.6rem !important;
      padding-top: 0px !important;
      color: #9e9e9e !important;
      font-size: 1.4rem;
      line-height: 2rem;
    }
  }

  &-jump-to-page-label {
    font-size: 1.4rem;
    font-weight: normal;
    font-stretch: normal;
    font-style: normal;
    line-height: 2rem;
    letter-spacing: normal;
    color: #212121;
    user-select: none;
    margin-right: 0.8rem;
    margin-left: .4rem;
  }

  &-spacer {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-right: .8rem;
    min-width: 2.8rem;
    height: 3.8rem;
    line-height: 2.8rem;
    user-select: none;
  }

  &-spacer-icon {
    fill: #637381;
  }

  &-simple-pagination {
    display: flex;
    flex: 1 0 100%;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    margin: 2.4rem 0px;
  }

  &-prev,
  &-jump-prev,
  &-jump-next {
    margin-right: 0.8rem;
  }
  &-prev,
  &-next,
  &-jump-prev,
  &-jump-next {
    cursor: pointer;
    color: #666;
    font-size: 1rem;
    border-radius: 0.6rem;
    list-style: none;
    min-width: 2.8rem;
    height: 3.8rem;
    line-height: 2.8rem;
    // float: left;
    text-align: center;
  }

  &-prev {
    a {
      &:after {
        content: "‹";
        display: block;
      }
    }
  }

  &-next {
    a {
      &:after {
        content: "›";
        display: block;
      }
    }
  }

  &-disabled {
    cursor: not-allowed;
    a {
      color: #ccc;
    }

    .rc-pagination-item,
    .rc-pagination-prev,
    .rc-pagination-next {
      @include disabled-item();
    }

    .rc-pagination-jump-prev,
    .rc-pagination-jump-next {
      pointer-events: none;
    }
  }

  &-options {
    // float: left;
    margin-left: 1.5rem;
    &-size-changer {
      //   float: left;
      width: 8rem;
    }

    &-quick-jumper {
      //   float: left;
      margin-left: 1.6rem;
      height: 2.8rem;
      line-height: 2.8rem;

      input {
        margin: 0 .8rem;
        box-sizing: border-box;
        background-color: #fff;
        border-radius: 0.6rem;
        border: 1px solid #d9d9d9;
        outline: none;
        padding: 0.3rem 1.2rem;
        width: 5rem;
        height: 2.8rem;

        &:hover {
          border-color: #2db7f5;
        }
      }

      button {
        display: inline-block;
        margin: 0 0.8rem;
        font-weight: 500;
        text-align: center;
        touch-action: manipulation;
        cursor: pointer;
        background-image: none;
        border: 1px solid transparent;
        white-space: nowrap;
        padding: 0 1.5rem;
        //font-size: $font-size;
        border-radius: 0.6rem;
        height: 2.8rem;
        user-select: none;
        transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
        position: relative;
        color: rgba(0, 0, 0, 0.65);
        background-color: #fff;
        border-color: #d9d9d9;

        &:hover,
        &:active,
        &:focus {
          color: #2db7f5;
          background-color: #fff;
          border-color: #2db7f5;
        }
      }
    }
  }

  &-simple {
    .rc-pagination-prev,
    .rc-pagination-next {
      border: none;
      height: 2.4rem;
      line-height: 2.4rem;
      margin: 0;
      font-size: 1.8rem;
    }

    .rc-pagination-simple-pager {
      //   float: left;
      margin-right: 0.8rem;
      list-style: none;

      .rc-pagination-slash {
        margin: 0 1rem;
      }

      input {
        margin: 0 0.8rem;
        box-sizing: border-box;
        background-color: #fff;
        border-radius: 0.6rem;
        border: 1px solid #d9d9d9;
        outline: none;
        padding: 0.5rem 0.8rem;
        min-height: 2rem;

        &:hover {
          border-color: #2db7f5;
        }
      }

      button {
        display: inline-block;
        margin: 0 0.8rem;
        font-weight: 500;
        text-align: center;
        touch-action: manipulation;
        cursor: pointer;
        background-image: none;
        border: 1px solid transparent;
        white-space: nowrap;
        padding: 0 0.8rem;
        //font-size: $font-size;
        border-radius: 0.6rem;
        height: 2.6rem;
        user-select: none;
        transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
        position: relative;
        color: rgba(0, 0, 0, 0.65);
        background-color: #fff;
        border-color: #d9d9d9;

        &:hover,
        &:active,
        &:focus {
          color: #2db7f5;
          background-color: #fff;
          border-color: #2db7f5;
        }
      }
    }
  }
}

@media only screen and (max-width: 1024px) {
  .rc-pagination-item {
    &-after-jump-prev,
    &-before-jump-next {
      display: none;
    }
  }
}

.button {
  padding: 0.8rem;
  min-height: auto;
  min-width: 3.5rem;
  color: #212121;
}

.select {
  height: 3.6rem;
}

.pageNumber {
  font-size: 1.4rem;
  line-height: 2rem;
}