/* ======================================================================== *
 * Copyright 2025 HCL America Inc.                                          *
 * 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.                                           *
 * ======================================================================== */

@use "sass:map";
@use "../../common";
@use "../../common/palette";
@use "../../common/themeMap.module";
@use "../../common/typography";

@mixin enchanted-table-pagination-base-styles {
  &::part(container) {
    @include typography.body2;
    color: palette.clr(light, text, primary);
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    margin: 4px 12px;
    min-height: 28px;
    padding: 0px;
    position: relative;
  }

  &::part(rows-section),
  &::part(pages-section) {
    display: flex;
    flex-direction: row;
    align-items: center;
  }

  &::part(rows-description),
  &::part(pages-description) {
    @include typography.body2;
    display: flex;
    flex-direction: row;
    align-items: center;
  }
  &::part(pages-nav-button) {
    padding-inline-end: 4px;
  }

  &::part(rows-description) {
    margin-inline-start: 12px;
  }

  &::part(pages-description) {
    margin-inline-start: 4px;
  }

  &::part(div) {
    display: flex;
    flex-direction: row;
    align-items: baseline;
  }

  /* styles for text variant of enchanted-button */
  &::part(button-enchanted-text) {
    @include common.button;
    border: none !important;
    padding: 6px 6px !important;  
    background-color: palette.clr(light, background, paper);
    color: map.get(themeMap.$enchantedPalette, HCLSOFTWAREBLUE06);
  }
  &::part(button-enchanted-text-disabled) {
    @include common.button-disabled;
    background-color: palette.clr(light, background, paper);
    border: none;
    padding: 6px !important;  
  }
  &::part(button-enchanted-text-focused) {
    @include common.enchanted-button-focused;
    @include common.button;
    border: none;
    background-color: palette.clr(light, background, paper);
    color: map.get(themeMap.$enchantedPalette, HCLSOFTWAREBLUE06);
    padding: 6px !important;    
  }
  &::part(button-enchanted-text):hover {
    border: none !important;
    background-color: palette.clr(light, action, hover);
    color: map.get(themeMap.$enchantedPalette, HCLSOFTWAREBLUE06); 
    padding: 6px !important;    
  }
  &::part(button-enchanted-text):active {
    @include common.enchanted-button-focused;
    border: none !important;
    background-color: palette.clr(light, action, hover);
    color: map.get(themeMap.$enchantedPalette, HCLSOFTWAREBLUE06); 
    padding: 6px !important;    
  }

  &::part(pagination-select-button),
  &::part(pagination-select-button-outlined),
  &::part(pagination-select-button-outlined-focused),
  &::part(pagination-select-button-contained-focused) {
    border-radius: 2px;
    height: 28px !important;
    padding: 1px 7px !important;
  }

  &::part(pagination-select-div) {
    margin-bottom: 4px !important;
    margin-top: 4px !important;
  }
}
