$pagination-page-link-background: #f5f6fa !default;
$pagination-page-link-color: #a3a9b5 !default;
$pagination-page-link-background-active: $primary !default;
$pagination-page-link-color-active: #fff !default;

@mixin pagination-container-base($background-color, $text-color) {
  background-color: $background-color;
  border: 1px solid $background-color;
  color: $text-color;

  path {
    fill: $text-color;
  }
}

.pagination-container {
  display: flex;
  justify-content: space-between;

  &[disabled] {
    display: none;
  }

  @include media-breakpoint-down(sm) {
    flex-direction: column;
  }

  &.position-bottom {
    padding-top: 30px;
  }

  &.position-top {
    padding-bottom: 30px;
  }

  .pagination-limit {
    align-items: center;
    color: #033333;
    display: flex;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;

    @include media-breakpoint-down(sm) {
      margin-bottom: 15px;
    }

    select {
      margin: 0 10px;
    }
  }

  .pagination {
    margin: 0 0 0 auto;
    padding: 0;

    @include media-breakpoint-down(sm) {
      justify-content: space-between;
      margin: 0;
    }

    .page-item {
      margin: 0 5px 0 0;

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

      &.active .page-link {
        @include pagination-container-base($pagination-page-link-background-active, $pagination-page-link-color-active);
        cursor: default;
        pointer-events: none;

        &:hover {
          @include pagination-container-base($pagination-page-link-background-active, $pagination-page-link-color-active);
        }
      }
    }

    .page-link {
      @include pagination-container-base($pagination-page-link-background, $pagination-page-link-color);
      align-items: center;
      border-radius: 2px;
      display: flex;
      font-size: 12px;
      font-weight: 600;
      height: 24px;
      margin: 0;
      padding: 0 8px;
      position: relative;
      user-select: none;
      text-align: center;
      white-space: nowrap;
      cursor: pointer;

      &:not(.no-hover):hover {
        @include pagination-container-base($pagination-page-link-background-active, $pagination-page-link-color-active);
      }

      &[href=''] {
        pointer-events: none;
      }

      &.no-hover {
        cursor: default;
      }

      &[disabled] {
        @include pagination-container-base($pagination-page-link-background, $pagination-page-link-color);
        cursor: not-allowed;
        opacity: 0.4;
        outline: none;
        pointer-events: none;
      }
    }

    .page-link-light-hover {
      &:not(.no-hover):hover {
        @include pagination-container-base($pagination-page-link-background-active, $pagination-page-link-color-active);
        background-color: rgba($pagination-page-link-background-active, 0.5);
        border-color: rgba($pagination-page-link-background-active, 0.5);
      }
    }
  }
}

.tb {
  background-color: #00000000 !important;
  border: none !important;
}

.ml10 {
  margin-left: 10px;
}

.mlm17 {
  @include media-breakpoint-down(sm) {
    margin-left: -17px;
  }
}

.mrm18 {
  @include media-breakpoint-down(sm) {
    margin-right: -18px;
  }
}

.go-to {
  @include media-breakpoint-down(sm) {
    margin-top: 10px !important;
    justify-content: end !important;
  }
}

.limit {
  color: $pagination-page-link-color;
  font-size: 12px;
  font-weight: 600;
  height: 24px;
  margin-top: -25px;
  text-align: right;
  @include media-breakpoint-down(sm) {
    display: none;
  }
}

.align-end {
  align-self: end;
}

.page-number {
  background-color: $pagination-page-link-background;
  border-width: 1px;
  border-style: solid;
  border-radius: 2px;
  border-color: $pagination-page-link-color;
  color: $pagination-page-link-color;
}

.page-number:focus {
  border: 1px solid $pagination-page-link-color;
}

.fml5 {
  margin-left: 5px !important;
}

.top-pagination-outer-container {
  display: flex;
}

.logs-topbar .pagination-container {
  @media (min-width: 600px) {
    margin-left: 80px;
  }
}