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

$light_fg: #2e3436;
$dark_fg: #eeeeec;
$light_bg: $light_2;
$dark_bg: darken(desaturate($dark_3, 100%), 4%);

$accent_bg_color: gtkcolor(accent_bg_color);
$accent_fg_color: gtkcolor(accent_fg_color);
$accent_color: gtkcolor(accent_color);

$destructive_bg_color: gtkcolor(destructive_bg_color);
$destructive_fg_color: gtkcolor(destructive_fg_color);
$destructive_color: gtkcolor(destructive_color);

$success_color: gtkcolor(success_color);
$warning_color: gtkcolor(warning_color);
$error_color: gtkcolor(error_color);

$base_color: if($variant == 'light', $light_1, lighten(desaturate($dark_4, 100%), 2%));
$text_color: if($variant == 'light', black, white);
$bg_color: if($variant == 'light', $light_bg, $dark_bg);
$fg_color: if($variant == 'light', $light_fg, $dark_fg);

$borders_color: gtkalpha(currentColor, .15);
$thin_borders_color: gtkalpha(currentColor, .05);
$link_color: $accent_color;
$link_visited_color: gtkmix($accent_color, $text_color, 80%);
$dark_fill: if($variant == 'light', darken($bg_color, 9%), darken($bg_color, 5%));
$headerbar_bg_color: darken($bg_color, if($variant == 'dark', 5%, 10%));
$headerbar_fg_color: $fg_color;
$headerbar_border_color: $fg_color;
$menu_color: $base_color;

$view_hover_color: gtkalpha(currentColor, .07);
$view_active_color: gtkalpha(currentColor, .16);
$view_selected_color: gtkalpha(currentColor, .1);
$view_selected_hover_color: gtkalpha(currentColor, .13);
$view_selected_active_color: gtkalpha(currentColor, .19);

$trough_color: gtkalpha(currentColor, .15);
$trough_hover_color: gtkalpha(currentColor, .2);
$trough_active_color: gtkalpha(currentColor, .25);

$fill_color: $accent_bg_color;
$fill_text_color: $accent_fg_color;
$fill_hover_color: gtkmix($accent_bg_color, currentColor, 90%);
$fill_active_color: gtkmix($accent_bg_color, black, 80%);

$slider_color: mix(white, $base_color, 80%);
$slider_hover_color: white;

$osd_fg_color: $dark_fg;
$osd_text_color: white;
$osd_bg_color: transparentize(black, 0.3);

$sidebar_bg_color: mix($bg_color, $base_color, 50%);

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

$drop_target_color: if($variant == 'light', $green_4, $green_5);

//special cased widget colors
$focus_border_color:  gtkalpha($accent_bg_color, 0.5);
$alt_focus_border_color: if($variant == 'light', transparentize(white, 0.2), transparentize(white,0.7));
$dim_label_opacity: 0.55;

// High Contrast color overrides
@if $contrast == 'high' {

  $fg_color: if($variant == 'light', darken($fg_color, 3%), lighten($fg_color, 2%));
  $bg_color: if($variant == 'light', lighten($bg_color, 3%), darken($bg_color, 2%));
  $borders_color: gtkalpha(currentColor, .5);
  $thin_borders_color: gtkalpha(currentColor, .25);

  //focus rings
  $focus_border_color: gtkalpha($accent_bg_color, 0.8);
  $alt_focus_border_color: if($variant == 'light', white, transparentize(white,0.4));

  $dim_label_opacity: 0.9;

  $trough_color: gtkalpha(currentColor, .3);
  $trough_hover_color: gtkalpha(currentColor, .4);
  $trough_active_color: gtkalpha(currentColor, .5);
}
