@use "sass:color";
@use "../sizes" as *;
@use "../colors" as *;

// adduse

$pivotgrid-area-background: $base-bg !default;
$pivotgrid-border-color: $base-border-color !default;

/**
* $name 10. Header text color
* $type color
*/
$pivotgrid-area-color: null !default;
$pivotgrid-data-area-color: $base-text-color !default;

/**
* $name 20. Total background color
* $type color
*/
$pivotgrid-totalcolor: null !default;

/**
* $name 30. Grand total background color
* $type color
*/
$pivotgrid-grandtotalcolor: null !default;

/**
* $name 40. Field area text color
* $type color
*/
$pivotgrid-field-area-text-color: null !default;
$pivotgrid-accent-color: null !default;
$pivotgrid-drag-header-border-color: null !default;
$pivotgrid-drag-header-first-shadow-color: null !default;
$pivotgrid-drag-header-second-shadow-color: null !default;
$pivotgrid-position-indicator-color: null !default;

/**
* $name 50. Arrow icon color
* $type color
*/
$pivotgrid-spin-icon-color: null !default;

@if $color == "carmine" {
  $pivotgrid-area-color: $base-header-color !default;
  $pivotgrid-totalcolor: color.adjust($pivotgrid-area-background, $lightness: -2.7%, $space: hsl) !default;
  $pivotgrid-grandtotalcolor: color.adjust($pivotgrid-area-background, $lightness: -4%, $space: hsl) !default;
  $pivotgrid-field-area-text-color: color.adjust($pivotgrid-area-color, $lightness: -26.2%, $space: hsl) !default;
  $pivotgrid-accent-color: $base-accent !default;
  $pivotgrid-drag-header-border-color: color.change($pivotgrid-accent-color, $alpha: 0.5) !default;
  $pivotgrid-drag-header-first-shadow-color: color.change($base-shadow-color, $alpha: 0.1) !default;
  $pivotgrid-drag-header-second-shadow-color: color.change($base-shadow-color, $alpha: 0.2) !default;
  $pivotgrid-position-indicator-color: gray !default;
  $pivotgrid-spin-icon-color: color.adjust($base-icon-color, $lightness: 3%, $space: hsl) !default;
}

@if $color == "contrast" {
  $pivotgrid-area-color: $base-text-color !default;
  $pivotgrid-totalcolor: $base-bg !default;
  $pivotgrid-grandtotalcolor: $base-bg !default;
  $pivotgrid-accent-color: $base-border-color !default;
  $pivotgrid-drag-header-border-color: $base-border-color !default;
  $pivotgrid-drag-header-first-shadow-color: $base-shadow-color !default;
  $pivotgrid-drag-header-second-shadow-color: $base-shadow-color !default;
  $pivotgrid-field-area-text-color: $pivotgrid-area-color !default;
  $pivotgrid-position-indicator-color: $base-accent !default;
  $pivotgrid-spin-icon-color: $base-icon-color !default;
}

@if $color == "dark" {
  $pivotgrid-area-color: color.adjust($base-text-color, $lightness: -30%, $space: hsl) !default;
  $pivotgrid-totalcolor: color.adjust($pivotgrid-area-background, $lightness: 2.5%, $space: hsl) !default;
  $pivotgrid-grandtotalcolor: $base-hover-bg !default;
  $pivotgrid-field-area-text-color: color.adjust($pivotgrid-area-color, $lightness: 26.2%, $space: hsl) !default;
  $pivotgrid-accent-color: $base-accent !default;
  $pivotgrid-drag-header-border-color: color.change($pivotgrid-accent-color, $alpha: 0.5) !default;
  $pivotgrid-drag-header-first-shadow-color: color.change($base-shadow-color, $alpha: 0.1) !default;
  $pivotgrid-drag-header-second-shadow-color: color.change($base-shadow-color, $alpha: 0.2) !default;
  $pivotgrid-position-indicator-color: gray !default;
  $pivotgrid-spin-icon-color: color.adjust($base-icon-color, $lightness: -38%, $space: hsl) !default;
}

@if $color == "darkmoon" {
  $pivotgrid-area-color: $screen-text-color !default;
  $pivotgrid-totalcolor: color.adjust($base-bg, $lightness: -2%, $space: hsl) !default; // #465672 => #40506b
  $pivotgrid-grandtotalcolor: $base-hover-bg !default;
  $pivotgrid-field-area-text-color: color.adjust($pivotgrid-area-color, $lightness: 26.2%, $space: hsl) !default;
  $pivotgrid-accent-color: $base-accent !default;
  $pivotgrid-drag-header-border-color: color.change($pivotgrid-accent-color, $alpha: 0.5) !default;
  $pivotgrid-drag-header-first-shadow-color: color.change($base-shadow-color, $alpha: 0.1) !default;
  $pivotgrid-drag-header-second-shadow-color: color.change($base-shadow-color, $alpha: 0.2) !default;
  $pivotgrid-position-indicator-color: gray !default;
  $pivotgrid-spin-icon-color: $base-icon-color !default;
}

@if $color == "darkviolet" {
  $pivotgrid-area-color: color.adjust($base-text-color, $lightness: -30%, $space: hsl) !default;
  $pivotgrid-totalcolor: #1f1f2b !default;
  $pivotgrid-grandtotalcolor: color.change($base-accent-highlight-color, $alpha: 0.15) !default;
  $pivotgrid-field-area-text-color: color.adjust($pivotgrid-area-color, $lightness: 26.2%, $space: hsl) !default;
  $pivotgrid-accent-color: $base-accent !default;
  $pivotgrid-drag-header-border-color: color.change($pivotgrid-accent-color, $alpha: 0.5) !default;
  $pivotgrid-drag-header-first-shadow-color: color.change($base-shadow-color, $alpha: 0.1) !default;
  $pivotgrid-drag-header-second-shadow-color: color.change($base-shadow-color, $alpha: 0.2) !default;
  $pivotgrid-position-indicator-color: gray !default;
  $pivotgrid-spin-icon-color: $base-header-color !default;
}

@if $color == "greenmist" {
  $pivotgrid-area-color: color.adjust($base-text-color, $lightness: 38.5%, $space: hsl) !default;
  $pivotgrid-totalcolor: color.adjust($base-bg, $lightness: -1%, $space: hsl) !default; // #f5f5f5 => #f0f2f2
  $pivotgrid-grandtotalcolor: color.adjust($base-label-color, $lightness: 40.6%, $space: hsl) !default; // #728e94 => #e8eded
  $pivotgrid-field-area-text-color: $base-text-color !default;
  $pivotgrid-accent-color: $base-accent !default;
  $pivotgrid-drag-header-border-color: color.change($pivotgrid-accent-color, $alpha: 0.5) !default;
  $pivotgrid-drag-header-first-shadow-color: color.change($base-shadow-color, $alpha: 0.1) !default;
  $pivotgrid-drag-header-second-shadow-color: color.change($base-shadow-color, $alpha: 0.2) !default;
  $pivotgrid-position-indicator-color: gray !default;
  $pivotgrid-spin-icon-color: $base-icon-color !default;
}

@if $color == "light" {
  $pivotgrid-area-color: color.adjust($base-text-color, $lightness: 38.5%, $space: hsl) !default;
  $pivotgrid-totalcolor: color.change(color.adjust($pivotgrid-area-background, $lightness: -13.3%, $space: hsl), $alpha: 0.2) !default;
  $pivotgrid-grandtotalcolor: color.adjust($base-bg, $lightness: -4%, $space: hsl) !default;
  $pivotgrid-field-area-text-color: color.adjust($pivotgrid-area-color, $lightness: -26.2%, $space: hsl) !default;
  $pivotgrid-accent-color: $base-accent !default;
  $pivotgrid-drag-header-border-color: color.change($pivotgrid-accent-color, $alpha: 0.5) !default;
  $pivotgrid-drag-header-first-shadow-color: color.change($base-shadow-color, $alpha: 0.1) !default;
  $pivotgrid-drag-header-second-shadow-color: color.change($base-shadow-color, $alpha: 0.2) !default;
  $pivotgrid-position-indicator-color: gray !default;
  $pivotgrid-spin-icon-color: color.adjust($base-icon-color, $lightness: 38.5%, $space: hsl) !default;
}

@if $color == "softblue" {
  $pivotgrid-area-color: $base-icon-color !default;
  $pivotgrid-totalcolor: color.change(color.adjust($pivotgrid-area-background, $lightness: -4%, $space: hsl), $alpha: 0.7) !default; // #fff => #f5f5f5
  $pivotgrid-grandtotalcolor: color.adjust($base-bg, $lightness: -4%, $space: hsl) !default; // #fff => #f5f5f5
  $pivotgrid-field-area-text-color: color.adjust($pivotgrid-area-color, $lightness: -26.2%, $space: hsl) !default;
  $pivotgrid-accent-color: $base-accent !default;
  $pivotgrid-drag-header-border-color: color.change($pivotgrid-accent-color, $alpha: 0.5) !default;
  $pivotgrid-drag-header-first-shadow-color: color.change($base-shadow-color, $alpha: 0.1) !default;
  $pivotgrid-drag-header-second-shadow-color: color.change($base-shadow-color, $alpha: 0.2) !default;
  $pivotgrid-position-indicator-color: gray !default;
  $pivotgrid-spin-icon-color: $base-icon-color !default;
}

