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

$transparency: 'false'!default;

$_dark_base_color: #272a34;

$base_color: if($variant == 'light', darken(#ffffff, 2%), $_dark_base_color)!default;
$text_color: if($variant == 'light', black, white);
$bg_color: if($variant == 'light', #ffffff, darken($_dark_base_color, 2%))!default;
$fg_color: if($variant == 'light', #5c616c, #eeeeec);

$selected_fg_color: #ffffff!default;
$selected_bg_color: saturate(#367bf0, 20%)!default;
$selected_borders_color: if($variant== 'light', darken($selected_bg_color, 15%), darken($selected_bg_color, 30%));
$borders_color: if($variant == 'light', darken($bg_color, 15%), darken($bg_color, 7%))!default;
$alt_borders_color: if($variant == 'light', darken($bg_color, 24%), darken($bg_color, 18%));
$borders_edge: if($variant == 'light', transparentize(white, 0.2), transparentize($fg_color, 0.93));
$link_color: if($variant == 'light', darken($selected_bg_color, 10%), lighten($selected_bg_color, 20%));
$link_visited_color: if($variant == 'light', darken($selected_bg_color, 20%), lighten($selected_bg_color, 10%));
$top_hilight: $borders_edge;
$dark_fill: mix($borders_color, $bg_color, 35%);
$headerbar_color: transparentize($bg_color, if($transparency == 'true', .2, 0));
$headerbar_bg_color: $headerbar_color;
$menu_color: if($variant == 'light', $base_color, mix($borders_color, $bg_color, 15%));
$menu_selected_color: mix($fg_color, $base_color, 10%);
$popover_bg_color: $menu_color;
$popover_hover_color: $menu_selected_color;

$scrollbar_bg_color: $base_color;
$scrollbar_slider_color: mix($fg_color, $bg_color, 60%);
$scrollbar_slider_hover_color: mix($fg_color, $bg_color, 80%);
$scrollbar_slider_active_color: $selected_bg_color;

$warning_color: #fd7d00;
$error_color: #bf1717;
$success_color: if($variant == 'light', #3db47e, darken(#3db47e, 10%));
$destructive_color: if($variant == 'light', #d41919, darken(#d41919, 10%));

$osd_fg_color: white;
$osd_text_color: white;
$osd_bg_color: lighten($_dark_base_color, 4%);
$osd_insensitive_bg_color: transparentize(mix($osd_fg_color, opacify($osd_bg_color, 1), 10%), 0.5);
$osd_insensitive_fg_color: mix($osd_fg_color, opacify($osd_bg_color, 1), 50%);
$osd_borders_color: black;
$osd_outer_borders_color: transparentize(white, 0.9);

$sidebar_bg_color: mix($bg_color, $base_color, 50%);
$base_hover_color: transparentize($fg_color, 0.95);

$panel_bg: transparentize($bg_color, if($transparency=='true', if($variant=='light', 0.1, 0.2), 0));
$panel_fg: if($variant=='light', darken($fg_color, 10%), $fg_color);

$tooltip_borders_color: $osd_outer_borders_color;
$shadow_color: transparentize(black, if($variant == 'light', 0.9, 0.7));
$system_bg_color: $_dark_base_color;

$drop_target_color: #19a187;

//insensitive state derived colors
$insensitive_fg_color: mix($fg_color, $bg_color, 50%);
$insensitive_bg_color: mix($bg_color, $base_color, 60%);
$insensitive_borders_color: $borders_color;

//colors for the backdrop state, derived from the main colors.
$backdrop_base_color: if($variant == 'light', darken($base_color, 1%), lighten($base_color, 1%));
$backdrop_text_color: mix($text_color, $backdrop_base_color, 80%);
$backdrop_bg_color: $bg_color;
$backdrop_fg_color: mix($fg_color, $backdrop_bg_color, 50%);
$backdrop_insensitive_color: if($variant == 'light', darken($backdrop_bg_color, 15%), lighten($backdrop_bg_color, 15%));
$backdrop_selected_fg_color: if($variant == 'light', $backdrop_base_color, $backdrop_text_color);
$backdrop_selected_bg_color: transparentize(desaturate($selected_bg_color,100%),0.5);
$backdrop_borders_color: $borders_color;
$backdrop_dark_fill: mix($backdrop_borders_color, $backdrop_bg_color, 35%);
$backdrop_sidebar_bg_color: mix($backdrop_bg_color, $backdrop_base_color, 50%);

$backdrop_scrollbar_bg_color: darken($backdrop_bg_color, 3%);
$backdrop_scrollbar_slider_color: mix($backdrop_fg_color, $backdrop_bg_color, 40%);

$backdrop_menu_color: if($variant == 'light', $backdrop_base_color, mix($backdrop_bg_color, $backdrop_base_color, 20%));

//special cased widget colors
$suggested_bg_color: $selected_bg_color;
$suggested_border_color: $selected_borders_color;
$progress_bg_color: $selected_bg_color;
$progress_border_color: $selected_borders_color;
$checkradio_bg_color: $selected_bg_color;
$checkradio_fg_color: $selected_fg_color;
$checkradio_borders_color: if($variant == 'light', darken($checkradio_bg_color,20%), darken($checkradio_bg_color,40%));
$switch_bg_color: $selected_bg_color;
$switch_borders_color: if($variant == 'light',darken($switch_bg_color,15%),darken($switch_bg_color,30%));
$focus_border_color: if($variant == 'light', transparentize($selected_bg_color, 0.5), transparentize($selected_bg_color, 0.3));
$alt_focus_border_color: if($variant == 'light', transparentize(white, 0.2), transparentize(white,0.7));
$dim_label_opacity: 0.55;

//colors for cinnamon
$button_bg: if($variant == 'light', lighten($bg_color, 2%), lighten($base_color, 2%));
$button_border: $borders_color;
$entry_bg: $base_color;
$entry_border: $borders_color;
$osd_button_bg: transparentize(lighten($osd_bg_color, 22%), 0.6);
$osd_button_border: transparentize(darken($osd_bg_color, 12%), 0.6);
$osd_entry_bg: $osd_button_bg;
$osd_entry_border: $osd_button_border;
$separator_color: if($variant == 'light', #DFDFDF, darken($bg_color, 6%));
$tooltip_bg_color: #fbeaa0;
$tooltip_border_color: #d0d0d0;
$tooltip_fg_color: #4a4a4a;
