/* ----------------------------------------------- */
/* ############### 3.11 Pagination ############### */
/* ----------------------------------------------- */

.pagination {
  .page-item {
    + .page-item { padding-left: 2px; }

    .page-link {
      color: $gray-700;
      padding: 11px 0;
      width: 35px;
      height: 40px;
      text-align: center;

      &:hover,
      &:focus {
        background-color: $gray-200;
      }
    }
  }

  .active {
    .page-link {
      &,&:hover,&:focus {
        color: #fff;
        background-color: theme-color('info');
        border-color: transparent;
      }
    }
  }
}

.pagination-basic {
  .page-item {

    .page-link {
      border: 0;
      width: 35px;
      height: 40px;
      text-align: center;
      padding: 11px 0;
      background-color: $gray-200;
      @include border-radius();

      &:hover,
      &:focus { background-color: $gray-300; }
    }
  }

  .active {
    .page-link {
      &,&:hover,&:focus {
        border: 0;
        background-color: theme-color('info');
      }
    }
  }

  .disabled .page-link { background-color: transparent; }
}

.pagination-dark {
  .page-item {

    &.disabled {
      .page-link {
        background-color: transparent;
        color: rgba(#fff,0.2);
      }
    }

    &.active {
      .page-link {
        &,&:hover,&:focus {
          border-color: transparent;
          background-color: #fff;
          color: $gray-800;
        }
      }
    }

    .page-link {
      color: rgba(#fff, 0.5);
      border: 0;
      width: 35px;
      text-align: center;
      padding-left: 0;
      padding-right: 0;
      @include border-radius(2px);

      &:hover,
      &:focus {
        background-color: rgba(#fff,.2);
        color: #fff;
      }
    }
  }
}

.pagination-circle {
  .page-item {
    + .page-item { margin-left: 5px; }

    .page-link {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 40px;
      height: 40px;
      padding: 0;
      border: 1px solid $gray-300;
      @include border-radius(100%);
    }

    span.page-link { border: 0; }

    &.active {
      .page-link {
        &,&:hover,&:focus {
          background-color: theme-color('info');
          border-color: transparent;
          color: #fff;
        }
      }
    }
  }

  &.pagination-dark {
    .page-item {
      .page-link { border-color: rgba(#fff, 0.2); }
    }

    .active {
      .page-link { border-color: transparent; }
    }
  }
}

.pagination-rounded {
  .page-item {
    + .page-item { padding-left: 8px; }

    .page-link {
      background-color: transparent;
      border: 1px solid $gray-300;
      @include border-radius();
    }
  }

  .active {
    .page-link {
      &,&:hover,&:focus {
        border-color: transparent;
        background-color: theme-color('info');
      }
    }
  }

  &.pagination-dark {
    .page-item {
      .page-link { border-color: rgba(#fff,0.1); }
      span.page-link { border: 0; }
    }
  }
}

.pagination-circle,
.pagination-rounded {
  .page-item {
    span.page-link {
      border-color: transparent;
      padding-left: 0;
      padding-right: 0;
      width: auto;
    }

    &.disabled .page-link { background-color: transparent; }
  }
}


.pagination-dark {
  .page-link {
    background-color: transparent;
    color: #fff;
    border-color: rgba(#fff, .2);

    &:hover,
    &:focus {
      background-color: $gray-800;
    }
  }
}

// Pagination color variant
.pagination-primary { @include pagination-variant(theme-color('primary')); }
.pagination-success { @include pagination-variant(theme-color('success')); }
.pagination-warning { @include pagination-variant(theme-color('warning')); }
.pagination-danger { @include pagination-variant(theme-color('danger')); }
.pagination-info { @include pagination-variant(theme-color('info')); }
.pagination-inverse { @include pagination-variant($gray-800); }
.pagination-indigo { @include pagination-variant($indigo); }
.pagination-purple { @include pagination-variant($purple); }
.pagination-pink { @include pagination-variant($pink); }
.pagination-orange { @include pagination-variant($orange); }
.pagination-teal { @include pagination-variant($teal); }

/* ########## RTL SUPPORT ########## */
.rtl {
  .pagination {
    padding: 0;
    .page-item + .page-item {
      padding-left: 0;
      padding-right: 3px;
    }
  }
}
