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


$base_color: if($variant == 'light', #fcfcfc, #2d2e30);
$text_color: if($variant == 'light', #212121, white);
$bg_color: if($variant == 'light', #cecece, #3b3e3f);
$fg_color: if($variant == 'light', #3c3c3c, #eeeeec);

$selected_fg_color: #ffffff;
$selected_bg_color: if($variant == 'light', #398ee7, darken(#398ee7,20%));
$selected_borders_color: if($variant== 'light', darken($selected_bg_color, 30%), darken($selected_bg_color, 20%));
$borders_color: if($variant == 'light', darken($bg_color,30%), darken($bg_color,12%));
$borders_edge: if($variant == 'light', transparentize(white, 0.2), transparentize($fg_color, 0.93));
$link_color: if($variant == 'light', #2d71b8, lighten(#2d71b8,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: if($variant == 'light', $bg_color, darken($bg_color, 3%));
$menu_color: if($variant == 'light', lighten($bg_color, 18%), mix($bg_color, $base_color, 20%));
$popover_bg_color: lighten($bg_color, 18%);
$popover_hover_color: $selected_bg_color;

$scrollbar_bg_color: if($variant == 'light', mix($bg_color, $fg_color, 80%), mix($base_color, $bg_color, 50%));
$scrollbar_slider_color: $bg_color;
$scrollbar_slider_hover_color: mix($fg_color, $bg_color, 80%);
$scrollbar_slider_active_color: if($variant=='light', darken($selected_bg_color, 10%), lighten($selected_bg_color, 10%));

$warning_color: #f57900;
$error_color: #cc0000;
$success_color: if($variant == 'light', #4e9a06, darken(#4e9a06,10%));
$destructive_color: if($variant == 'light', #ef2929, darken(#ef2929,10%));

$osd_fg_color: #eeeeee;
$osd_text_color: white;
$osd_bg_color: transparentize(#222, 0.2);
$osd_insensitive_bg_color: transparentize(#222, 0.2);
$osd_insensitive_fg_color: mix($osd_fg_color, opacify($osd_bg_color, 1), 50%);
$osd_borders_color: transparentize(black, 0.3);

$sidebar_bg_color: if($variant == 'light', #dae0e6, #222);
$base_hover_color: transparentize($fg_color, 0.95);

$tooltip_borders_color: transparentize(white, 0.9);
$shadow_color: transparentize(black, 0.9);

$drop_target_color: #4e9a06;

$panel_bg_color: #686868;
$panel_fg_color: #fcfcfc;

//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', darken($base_color, 50%), $backdrop_text_color);
$backdrop_selected_bg_color: if($variant == 'light', darken($base_color, 17%), lighten($bg_color, 17%));
$backdrop_borders_color: mix($borders_color, $bg_color, 90%);
$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: lighten($scrollbar_slider_color, 35%);

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