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


$base_color: if($variant == 'light', #fff, #111);
$bg_color: if($variant == 'light', #fff, #000);
$fg_color: if($variant == 'light', #000, #fff);

$selected_fg_color: if($variant == 'light', #fff, #000);
$selected_bg_color: if($variant == 'light', #000, #ddd); //#4a90d9;
$selected_borders_color: if($variant == 'light', #000, #aaa);
$popover_bg_color: $bg_color;
$popover_hover_color: lighten($bg_color, 5%);

$borders_color: mix($bg_color,$fg_color,50%);
$borders_edge: if($variant == 'light', #fff, #000);
$link_color: $selected_bg_color;

$scrollbar_bg_color: if($variant == 'light', mix($bg_color, $fg_color, 95%), mix($base_color, $bg_color, 60%));
$scrollbar_slider_color: mix($fg_color, $bg_color, 60%);
$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%));

$suggested_color: #4a90d9;
$warning_color: #f57900;
$error_color: #cc0000;
$success_color: #73d216;
$destructive_color: #ef2929;
$dark_fill: if($variant == 'light', mix($fg_color, $bg_color, 50%), mix($fg_color, $bg_color, 10%));

$osd_fg_color: #fff;
$osd_bg_color: transparentize(#000,0.2);
$osd_borders_color: transparentize(#fff,0.8);

//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: mix($borders_color, $base_color, 50%);

//colors for the backdrop state, derived from the main colors.
$backdrop_base_color: $base_color;
$backdrop_bg_color: $bg_color;
$backdrop_fg_color: $fg_color;
$backdrop_borders_color: mix($borders_color, $bg_color, 90%);
$backdrop_dark_fill: mix($fg_color, $bg_color, 30%);
$backdrop_scrollbar_bg_color: darken($backdrop_bg_color, 3%);
$backdrop_scrollbar_slider_color: mix($backdrop_fg_color, $backdrop_bg_color, 40%);

//apps rely on some named colors to be exported
/* GTK NAMED COLORS */
@define-color theme_fg_color #{"" + $fg_color};
@define-color theme_bg_color #{"" + $bg_color};
@define-color theme_base_color #{"" + $base_color};
@define-color theme_selected_bg_color #{"" + $selected_bg_color};
@define-color theme_selected_fg_color #{"" + $selected_fg_color};
@define-color insensitive_bg_color #{"" + $insensitive_bg_color};
@define-color insensitive_fg_color #{"" + $insensitive_fg_color};
@define-color insensitive_base_color #{"" + $base_color};
@define-color theme_unfocused_fg_color #{"" + $backdrop_fg_color};
@define-color theme_unfocused_bg_color #{"" + $backdrop_bg_color};
@define-color theme_unfocused_base_color #{"" + $backdrop_base_color};
@define-color theme_unfocused_selected_bg_color #{"" + $selected_bg_color};
@define-color theme_unfocused_selected_fg_color #{"" + $selected_fg_color};
@define-color unfocused_insensitive_color #{"" + $insensitive_fg_color};
@define-color borders #{"" + $borders_color};
@define-color unfocused_borders #{"" + $backdrop_borders_color};

@define-color warning_color #{"" + $warning_color};
@define-color error_color #{"" + $error_color};
@define-color success_color #{"" + $success_color};

//WM

$_wm_highlight: $borders_edge;

@define-color wm_title shade(#{"" + $fg_color}, 1.8);
@define-color wm_unfocused_title #{"" + $backdrop_fg_color};
@define-color wm_highlight #{"" + $_wm_highlight};
@define-color wm_borders_edge #{"" + $borders_edge};

@define-color wm_bg_a shade(#{"" + $bg_color}, 1.2);
@define-color wm_bg_b #{"" + $bg_color};

@define-color wm_shadow alpha(black, 0.35);
@define-color wm_border alpha(black, 0.18);

@define-color wm_button_hover_color_a shade(#{"" + $bg_color}, 1.3);
@define-color wm_button_hover_color_b #{"" + $bg_color};
@define-color wm_button_active_color_a shade(#{"" + $bg_color}, 0.85);
@define-color wm_button_active_color_b shade(#{"" + $bg_color}, 0.89);
@define-color wm_button_active_color_c shade(#{"" + $bg_color}, 0.9);

//FIXME this is really an API

@define-color content_view_bg #{"" + $base_color};

