@use "sass:map";
@use "../core/_index.scss" as *;

/// The width of the border around the Window.
/// @group window
$kendo-window-border-width: k-spacing(1) 0 0 !default;
/// The border radius of the Window.
/// @group window
$kendo-window-border-radius: k-border-radius(md) !default;
/// The font family of the Window.
/// @group window
$kendo-window-font-family: var( --kendo-font-family, inherit ) !default;
/// The font size of the Window.
/// @group window
$kendo-window-font-size: var( --kendo-font-size, inherit ) !default;
/// The line height of the Window.
/// @group window
$kendo-window-line-height: var( --kendo-line-height, normal ) !default;

/// The horizontal padding of the Window titlebar.
/// @group window
$kendo-window-titlebar-padding-x: k-spacing(6) !default;
/// The vertical padding of the Window titlebar.
/// @group window
$kendo-window-titlebar-padding-y: k-spacing(5) !default;
/// The width of the border of the Window titlebar.
/// @group window
$kendo-window-titlebar-border-width: 0 !default;
/// The style of the border of the Window titlebar.
/// @group window
$kendo-window-titlebar-border-style: solid !default;

/// The font size of the title of the Window.
/// @group window
$kendo-window-title-font-size: var( --kendo-font-size-xl, inherit ) !default;
/// The line height of the title of the Window.
/// @group window
$kendo-window-title-line-height: var( --kendo-line-height, normal ) !default;
/// The font weight of the title of the Window.
/// @group window
$kendo-window-title-font-weight: var( --kendo-font-weight-bold, bold ) !default;

/// The spacing between the buttons in the Window titlebar.
/// @group window
$kendo-window-actions-gap: k-spacing(0) !default;
/// OThe opacity of the buttons in the Window titlebar.
/// @group window
$kendo-window-action-opacity: 1 !default;
/// The opacity of the hovered buttons in the Window titlebar.
/// @group window
$kendo-window-action-hover-opacity: 1 !default;

/// The horizontal padding of the content of the Window.
/// @group window
$kendo-window-inner-padding-x: k-spacing(6) !default;
/// The vertical padding of the content of the Window.
/// @group window
$kendo-window-inner-padding-y: k-spacing(3) !default;

/// The horizontal padding of the Window action buttons.
/// @group window
$kendo-window-buttongroup-padding-x: k-spacing(6) !default; // $kendo-actions-padding-x
/// The vertical padding of the Window action buttons.
/// @group window
$kendo-window-buttongroup-padding-y: k-spacing(6) !default; // $kendo-actions-padding-y
/// The width of the top border of the Window action buttons.
/// @group window
$kendo-window-buttongroup-border-width: 0 !default;
/// The spacing between the Window action buttons.
/// @group window
$kendo-window-buttongroup-spacing: k-spacing(3) !default;

/// The background color of the Window.
/// @group window
$kendo-window-bg: var( --kendo-component-bg, initial ) !default;
/// The text color of the Window.
/// @group window
$kendo-window-text: var( --kendo-component-text, initial ) !default;
/// The border color of the Window.
/// @group window
$kendo-window-border: if($kendo-enable-color-system, k-color( primary ), k-get-theme-color-var( primary-100 )) !default;
/// The box shadow of the Window.
/// @group window
$kendo-window-shadow: var( --kendo-box-shadow-depth-8, none ) !default;
/// The box shadow of the focused Window.
/// @group window
$kendo-window-focus-shadow: var( --kendo-box-shadow-depth-9, none ) !default;

/// The background color of the Window titlebar.
/// @group window
$kendo-window-titlebar-bg: var( --kendo-component-bg, initial ) !default; // $kendo-component-header-bg
/// The text color of the Window titlebar.
/// @group window
$kendo-window-titlebar-text: if($kendo-enable-color-system, k-color( primary ), k-get-theme-color-var( primary-100 )) !default; // $kendo-component-header-text
/// The border color of the Window titlebar.
/// @group window
$kendo-window-titlebar-border: if($kendo-enable-color-system, k-color( primary ), k-get-theme-color-var( primary-100 )) !default;

/// The map of the width of the different Window sizes.
/// @group window
$kendo-window-sizes: (
    sm: 300px,
    md: 800px,
    lg: 1200px
) !default;

/// The theme variations for the Window.
/// @group window
$kendo-window-brand-colors: (
    primary: primary
 ) !default;

// Matrix with window theme colors in the order: bg, color, border
$_tc-window-matrix: (
    (normal: if($kendo-enable-color-system, (color, on-color, color), (100, $kendo-color-white, 100))),
) !default;

$_tc-window-dark-matrix: (
    (normal: if($kendo-enable-color-system, (color, on-color, color), (160, $kendo-color-white, 160))),
) !default;

$_tc-window-light-matrix: (
    (normal: if($kendo-enable-color-system, (color, on-color, color), (50, 160, 50))),
) !default;

/// The theme colors map for the Window.
/// @group window
$kendo-window-theme-colors: () !default;

@each $ui-states in $_tc-window-matrix {
    @each $brand-color, $palette in $kendo-window-brand-colors {
        $kendo-window-theme-colors: map.deep-merge(
            $kendo-window-theme-colors,
            k-generate-theme-variation( $brand-color, $palette, $ui-states )
        );
    };
}

@each $ui-states in $_tc-window-dark-matrix {
    $kendo-window-theme-colors: map.deep-merge(
        $kendo-window-theme-colors,
        k-generate-theme-variation( dark, if($kendo-enable-color-system, dark, neutral), $ui-states )
    );
}

@each $ui-states in $_tc-window-light-matrix {
    $kendo-window-theme-colors: map.deep-merge(
        $kendo-window-theme-colors,
        k-generate-theme-variation( light, if($kendo-enable-color-system, light, neutral), $ui-states )
    );
}
