@use "sass:color";
@use "sass:map";
@use "../abstracts/cds-config" as c;

/// #####################################################
/// DARK MODE
/// #####################################################

$color_dark-foreground: c.$config-dark-foreground;
$color_dark-background: c.$config-dark-background;

$color_dark-accents: (
    "primary": c.$config-dark-accent-primary,
    "danger": c.$config-dark-accent-danger
);

$color_dark-feedbacks: (
    "information": c.$config-dark-feedback-information,
    "success": c.$config-dark-feedback-success,
    "alert": c.$config-dark-feedback-alert,
    "error": c.$config-dark-feedback-error
    //"neutral": c.$config-dark-feedback-neutral
);

$color_dark-alternatives: (
    1: c.$config-dark-alternative-1,
    2: c.$config-dark-alternative-2,
    3: c.$config-dark-alternative-3,
    4: c.$config-dark-alternative-4,
    5: c.$config-dark-alternative-5,
    6: c.$config-dark-alternative-6,
    7: c.$config-dark-alternative-7,
    8: c.$config-dark-alternative-8,
    9: c.$config-dark-alternative-9,
    10: c.$config-dark-alternative-10
);

///Getting background from neutral color
/// =========================
//$color_dark-background: mix($color_dark-foreground, white, 2%); // #f3f5f8;

//Neutral palette
$palette-neutral-1000-dark: $color_dark-foreground;
$palette-neutral-900-dark: color.mix($color_dark-foreground, $color_dark-background, 95%);
$palette-neutral-800-dark: color.mix($color_dark-foreground, $color_dark-background, 80%);
$palette-neutral-700-dark: color.mix($color_dark-foreground, $color_dark-background, 60%);
$palette-neutral-600-dark: color.mix($color_dark-foreground, $color_dark-background, 50%);
$palette-neutral-500-dark: color.mix($color_dark-foreground, $color_dark-background, 25%);
$palette-neutral-400-dark: color.mix($color_dark-foreground, $color_dark-background, 20%);
$palette-neutral-300-dark: color.mix($color_dark-foreground, $color_dark-background, 15%);
$palette-neutral-200-dark: color.mix($color_dark-foreground, $color_dark-background, 10%);
$palette-neutral-100-dark: color.mix($color_dark-foreground, $color_dark-background, 5%);
$palette-neutral-000-dark: $color_dark-background;

$color_accent-palettes-dark: (
);

@each $key, $accent-color in $color_dark-accents {
    $palette: (
        100: color.mix($accent-color, $color_dark-background, 20%),
        200: color.mix($accent-color, $color_dark-background, 40%),
        300: color.mix($accent-color, $color_dark-background, 60%),
        400: color.mix($accent-color, $color_dark-background, 80%),
        500: $accent-color,
        600: color.mix($accent-color, $color_dark-foreground, 80%),
        700: color.mix($accent-color, $color_dark-foreground, 60%),
        800: color.mix($accent-color, $color_dark-foreground, 40%),
        900: color.mix($accent-color, $color_dark-foreground, 20%),
    );
$color_accent-palettes-dark: map.merge($color_accent-palettes-dark, ($key: $palette));
}

$color_feedback-palettes-dark: (
);

@each $key, $feedback-color in $color_dark-feedbacks {
    $palette: (
        100: color.mix($feedback-color, $color_dark-background, 20%),
        200: color.mix($feedback-color, $color_dark-background, 40%),
        300: color.mix($feedback-color, $color_dark-background, 60%),
        400: color.mix($feedback-color, $color_dark-background, 80%),
        500: $feedback-color,
        600: color.mix($feedback-color, $color_dark-foreground, 80%),
        700: color.mix($feedback-color, $color_dark-foreground, 60%),
        800: color.mix($feedback-color, $color_dark-foreground, 40%),
        900: color.mix($feedback-color, $color_dark-foreground, 20%)
    );
$color_feedback-palettes-dark: map.merge($color_feedback-palettes-dark, ($key: $palette));
}

$color_alternative-palettes-dark: (
);

@each $key, $alternative-color in $color_dark-alternatives {
    $palette: (
        100: color.mix($alternative-color, $color_dark-background, 20%),
        200: color.mix($alternative-color, $color_dark-background, 40%),
        300: color.mix($alternative-color, $color_dark-background, 60%),
        400: color.mix($alternative-color, $color_dark-background, 80%),
        500: $alternative-color,
        600: color.mix($alternative-color, $color_dark-foreground, 80%),
        700: color.mix($alternative-color, $color_dark-foreground, 60%),
        800: color.mix($alternative-color, $color_dark-foreground, 40%),
        900: color.mix($alternative-color, $color_dark-foreground, 20%)
    );
$color_alternative-palettes-dark: map.merge($color_alternative-palettes-dark, ($key: $palette));
}

