// When color definition differs for dark and light variant,
// it gets @if ed depending on $variant


$base_color: if($variant =='light', #ffffff, #242424);
$text_color: if($variant == 'light', #363636, #dedede);
$bg_color: if($variant =='light', #f5f5f5, #333333);
$fg_color: if($variant =='light', #242424, #dedede);

$selected_fg_color: #ffffff;
$selected_bg_color: if($variant == 'light', #0046DB, #498dff);
$selected_borders_color: darken($selected_bg_color, 20%);
$borders_color: if($variant =='light', rgba(black, 0.12), rgba(white, 0.12));
$solid_borders_color: if($variant == 'light', darken($bg_color, 10%), lighten($bg_color, 10%));
$highlight: if($variant =='light', rgba(white, 0.75), rgba(white, 0.10));

$link_color: #3484e2;
$link_visited_color: if($variant == 'light', lighten($text_color, 10%), darken($text_color, 15%));

$selection_mode_bg: #0e6bff;
$selection_mode_fg: $selected_fg_color;
$warning_color: #F27835;
$error_color: #FC4138;
$warning_fg_color: white;
$error_fg_color: white;
$success_color: #71c837;
$destructive_color: #f8464c;
$suggested_color: #3484e2;
$destructive_fg_color: white;
$suggested_fg_color: white;

$progress_color: $selected_bg_color;

$drop_target_color: #F08437;

//insensitive state derived colors
$insensitive_fg_color: if($variant == 'light', transparentize($fg_color, 0.45), transparentize($fg_color, 0.55));
$insensitive_bg_color: if($variant == 'light', mix($bg_color, $base_color, 40%), lighten($bg_color, 2%));

$header_bg: black;
@if $transparency=='true' and $variant=='light' { $header_bg: transparentize(#e5e5e5, 0.05); }
@if $transparency=='false' and $variant=='light' { $header_bg: #e5e5e5; }
@if $transparency=='true' and $variant=='dark' { $header_bg: transparentize(#373737, 0.02); }
@if $transparency=='false' and $variant=='dark' { $header_bg: #373737; }
@if $transparency=='true' and $darker=='true' { $header_bg: transparentize(#373737, 0.02); }
@if $transparency=='false' and $darker=='true' { $header_bg: #373737; }

$header_highlight: if($transparency=='true', transparentize(#f5f5f5, 0.0), #f5f5f5);
$header_top: if($transparency=='true', transparentize(#e9e9e9, 0.0), #e9e9e9);
$header_middle: if($transparency=='true', transparentize(#e2e2e2, 0.0), #e2e2e2);
$header_bottom: if($transparency=='true', transparentize(#d2d2d2, 0.0), #d2d2d2);

$header_bg_backdrop: if($variant == 'light', #F6F6F6, #404040);
$header_border: if($variant=='light', #afafaf, #484848);
$bar_border: if($variant=='light', #E1E1E1, #4B4B4B);

$header_fg: if($darker == 'true', #FFFFFF, saturate(transparentize($fg_color, 0.2), 10%));

$dark_sidebar_bg: white;
@if $transparency=='true' and $variant=='light' { $dark_sidebar_bg: transparentize(#f6f6f6, 0.06); }
@if $transparency=='false' and $variant=='light' { $dark_sidebar_bg: #f6f6f6; }
@if $transparency=='true' and $variant=='dark' { $dark_sidebar_bg: transparentize(#3B3B3B, 0.06); }
@if $transparency=='false' and $variant=='dark' { $dark_sidebar_bg: #3B3B3B; }

$dark_sidebar_fg: $text_color;
$dark_sidebar_border: if($variant=='light', darken(opacify($dark_sidebar_bg, 1), 5%), lighten(opacify($dark_sidebar_bg, 1), 5%));
$sidebar_theme_color: if($variant=='light', #C7C7C7, rgba(#C7C7C7, 0.25));

$osd_fg_color: $text_color;
$osd_bg_color: if($variant=='light', transparentize(#f5f5f5, 0.05), transparentize(#242424, 0.05));

$osd_button_bg: transparentize(lighten($osd_bg_color, 22%), 0.6);
$osd_button_border: $borders_color;

$osd_entry_bg: transparentize(lighten($osd_bg_color, 22%), 0.6);
$osd_entry_border: $borders_color;

$osd_insensitive_bg_color: darken($osd_bg_color, 3%);
$osd_insensitive_fg_color: mix($osd_fg_color, opacify($osd_bg_color, 1), 30%);
$osd_borders_color: $borders_color;

// Panel colors
$panel_bg: if($variant == 'light', #f5f5f5, #2a2a2a);
$panel_fg: $text_color;
$panel_top_color: if($variant == 'dark', #333333, #f5f5f5);
$panel_bottom_color: if($variant == 'dark', #2a2a2a, #e2e2e2);
$panel_border_color: if($variant =='light', rgba(black, 0.2), rgba(black, 0.72));

$entry_bg: if($variant=='light', $base_color, lighten($base_color, 0%));
$entry_border: $borders_color;
$entry_highlight: lighten($selection_mode_bg, 25%);

$header_entry_bg: if($darker == 'true' or $variant == 'dark', transparentize(lighten($header_bg, 22%), 0.6), transparentize($base_color, 0.1));
$header_entry_border: if($darker == 'true' or $variant == 'dark', transparentize(darken($header_bg, 12%), 0.6), transparentize($header_fg, 0.7));

$button_bg: if($variant == 'light', white, #484848);
$button_border: $entry_border;

$header_button_bg: if($darker == 'true' or $variant == 'dark', transparentize(lighten($header_bg, 25%), 0.4), white);
$header_button_hover_bg: if($darker == 'true' or $variant == 'dark', transparentize(lighten($header_bg, 25%), 0.1), #fafafa);
$header_button_active_bg: if($darker == 'true' or $variant == 'dark', transparentize(lighten($header_bg, 25%), 0), #afafaf);
$header_button_checked_bg: if($darker == 'true' or $variant == 'dark', transparentize(lighten($header_bg, 30%), 0), #686868);
$header_button_border: transparent;

//WM Buttons

// Close
$wm_button_close_bg: if($variant == 'light' and $darker == 'false', #f46067, #cc575d);
$wm_button_close_hover_bg: if($variant == 'light' and $darker == 'false', #f68086, #d7787d);
$wm_button_close_active_bg: if($variant == 'light' and $darker == 'false', #f13039, #be3841);

$wm_icon_close_bg: if($variant == 'light' and $darker == 'false',#F8F8F9 , #2f343f);

// Minimize, Maximize
$wm_button_hover_bg: if($variant == 'light' and $darker == 'false', #fdfdfd, #454C5C);
$wm_button_active_bg: $selected_bg_color;

$wm_button_hover_border: if($variant == 'light' and $darker == 'false', #D1D3DA, #262932);

$wm_icon_bg: if($variant == 'light' and $darker == 'false', #90949E, #90939B);
$wm_icon_unfocused_bg: if($variant == 'light' and $darker == 'false', #B6B8C0, #666A74);
$wm_icon_hover_bg: if($variant == 'light' and $darker == 'false', #7A7F8B, #C4C7CC);
$wm_icon_active_bg: $selected_fg_color;

// Titlebar
$titlebar_gradient_a: $header_highlight;
$titlebar_gradient_b: $header_middle;
