/**
 *
 * @ai-apps/angular v2.154.0-next.30 | _unstable_pagination.scss
 *
 * Copyright 2014, 2024 IBM
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0

 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


//
// Copyright IBM Corp. 2016, 2020
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
//

@use '../../breakpoint' as *;
@use '../../config' as *;
@use '../../motion' as *;
@use '../../spacing' as *;
@use '../../theme' as *;
@use '../../type' as *;
@use '../../utilities/component-reset';
@use '../../utilities/convert' as *;
@use '../../utilities/focus-outline' as *;
@use '../select';

/// Unstable pagination styles
/// @access private
/// @group pagination
@mixin unstable_pagination {
  .#{$prefix}--unstable-pagination {
    @include component-reset.reset;
    @include type-style('body-compact-01');

    display: flex;
    width: 100%;
    min-height: rem(40px);
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid $border-subtle;
    border-bottom: 1px solid transparent;
    background-color: $layer;
  }

  .#{$prefix}--unstable-pagination__text {
    @include breakpoint('md') {
      display: inline-block;
    }

    margin: 0 $spacing-05;
    color: $text-secondary;
  }

  .#{$prefix}--unstable-pagination__left,
  .#{$prefix}--unstable-pagination__right {
    display: flex;
    height: 100%;
    align-items: center;
  }

  .#{$prefix}--unstable-pagination__left {
    padding: 0 $spacing-05 0 0;
  }

  .#{$prefix}--unstable-pagination__left > .#{$prefix}--form-item,
  .#{$prefix}--unstable-pagination__right > .#{$prefix}--form-item {
    height: 100%;
  }

  .#{$prefix}--unstable-pagination__left
    .#{$prefix}--unstable-pagination__text {
    margin-right: rem(1px);
  }

  .#{$prefix}--unstable-pagination__right
    .#{$prefix}--unstable-pagination__text {
    margin-right: $spacing-05;
    margin-left: rem(1px);
  }

  .#{$prefix}--unstable-pagination__button {
    @include component-reset.reset;

    display: flex;
    width: rem(40px);
    height: rem(40px);
    min-height: rem(32px);
    align-items: center;
    justify-content: center;
    border: none;
    border-left: 1px solid $border-subtle;
    margin: 0;
    background: none;
    color: $icon-primary;
    cursor: pointer;
    fill: $icon-primary;
    transition: outline $duration-fast-02 motion(standard, productive),
      background-color $duration-fast-02 motion(standard, productive);
  }

  // Unset height/width set by icon-only button:
  .#{$prefix}--unstable-pagination__button .#{$prefix}--btn__icon {
    width: initial;
    height: initial;
  }

  .#{$prefix}--unstable-pagination__button.#{$prefix}--btn--icon-only.#{$prefix}--tooltip__trigger:focus {
    @include focus-outline('outline');
  }

  .#{$prefix}--unstable-pagination__button:hover {
    background: $layer-hover;
    color: $icon-primary;
  }

  .#{$prefix}--unstable-pagination__button--no-index {
    cursor: not-allowed;
    fill: $icon-disabled;
  }

  .#{$prefix}--unstable-pagination__button.#{$prefix}--btn:disabled {
    border-color: $border-subtle;
    background: transparent;
  }

  .#{$prefix}--unstable-pagination__button:disabled:hover,
  .#{$prefix}--unstable-pagination__button--no-index:hover {
    background: transparent;
    cursor: not-allowed;
    fill: $icon-disabled;
  }

  .#{$prefix}--unstable-pagination__page-selector,
  .#{$prefix}--unstable-pagination__page-sizer {
    height: 100%;
    align-items: center;
  }

  .#{$prefix}--unstable-pagination__page-selector
    .#{$prefix}--select-input--inline__wrapper,
  .#{$prefix}--unstable-pagination__page-sizer
    .#{$prefix}--select-input--inline__wrapper {
    display: flex;
    height: 100%;
  }

  .#{$prefix}--unstable-pagination__page-selector .#{$prefix}--select-input,
  .#{$prefix}--unstable-pagination__page-sizer .#{$prefix}--select-input {
    @include type-style('body-short-01');

    width: auto;
    min-width: auto;
    height: 100%;
    padding: 0 2.25rem 0 $spacing-05;
    line-height: rem(40px);
  }

  .#{$prefix}--unstable-pagination__page-selector
    .#{$prefix}--select-input:hover,
  .#{$prefix}--unstable-pagination__page-sizer .#{$prefix}--select-input:hover {
    background: $layer-hover;
  }

  .#{$prefix}--unstable-pagination__page-selector .#{$prefix}--select__arrow,
  .#{$prefix}--unstable-pagination__page-sizer .#{$prefix}--select__arrow {
    top: 50%;
    transform: translateY(-50%);

    @include breakpoint('md') {
      right: $spacing-05;
    }
  }

  .#{$prefix}--unstable-pagination__page-selector {
    border-left: 1px solid $border-subtle;
  }

  .#{$prefix}--unstable-pagination__page-sizer {
    border-right: 1px solid $border-subtle;
  }
}
