@import "../mixins/mixins";
@import "../mixins/utils";
@import "../config/variables";
@import "./select";

@include b(pagination) {
  white-space: nowrap;
  color: $--color-primary;
  list-style: none;
  text-align: center;
  font-weight: bold;
  display: flex;
  flex-direction: row;
  align-items: center;
  @include utils-clearfix;

  @include e(quick) {
    width: 24px;
    height: 24px;
    background: $--color-primary;
    color: $--color-white;
    cursor: pointer;
    border-radius: $--border-radius;
    border: none;
    flex-basis: 24px;
    &:hover {
      background: $--color-light;
    }
    &:active {
      background: $--color-focus;
    }
    @include when(disabled) {
      cursor: not-allowed;
      color: $--color-silver;
      background: rgba($--color-disabled, 0.5);
    }
  }

  @include e(prev) {
    margin-right: 5px;
  }

  @include e(next) {
    margin-left: 5px;
  }

  @include e(page) {
    width: 8px;
    height: 8px;
    vertical-align: middle;
    flex-basis: 8px;
    margin: 0 3px;
    position: relative;
    &:before {
      width: 4px;
      height: 4px;
      content: '';
      background: $--color-light;
      transition: all .2s ease-in-out;
      position: absolute;
      top: 2px;
      left: 2px;
      border-radius: 100%;
    }
    @include when(active) {
      &:before {
        width: 8px;
        height: 8px;
        top: 0;
        left: 0;
        background: $--color-primary;
      }
    }
  }

  @include when(dark) {
    @include e(quick) {
      background: $--color-white;
      color: $--color-primary;
      &:hover {
        background: darken($--color-white, 10%);
        color: $--color-light;
      }
      &:active {
        background: darken($--color-white, 20%);
        color: $--color-focus;
      }
      @include when(disabled) {
        color: $--color-silver;
        background: rgba($--color-disabled, 0.5);
      }
    }
    @include e(page) {
      &:before {
        background: $--color-white;
      }
    }
  }

  @include when(disabled) {
    @include e(quick) {
      color: $--color-silver;
      background: rgba($--color-disabled, 0.5);
      cursor: not-allowed;
    }
    @include e(page) {
      &:before {
        background: rgba($--color-disabled, 0.5);
        cursor: not-allowed;
      }
    }
  }
}
