/* Button background */
.button,
.toolbar .button.raised,
.toolbar .raised .button,
.toolbar GtkComboBox .button,
.spinbutton.vertical .button {
    background-image: linear-gradient(to bottom, 
                                      @button_gradient_color_a, 
                                      @button_gradient_color_b 40%,
                                      @button_gradient_color_c
                                      );
    background-color: transparent;
}

/* Pushed button and progressbar through background */
.button:active, 
.button:active:hover,
.spinbutton.vertical .button:active,
.spinbutton.vertical .button:active:hover,
.toolbar .button:active,
.toolbar .button:active:hover,
.toolbar .button.raised:active,
.toolbar .raised .button:active,
.toolbar .button.raised:active:hover,
.toolbar .raised .button:active:hover,
.trough,
.trough.highlight,
.trough row,
.trough row:hover {
    background-image: linear-gradient(to bottom,
                                      @borders,
                                      shade(@theme_bg_color, 0.95)
                                      );
    background-color: transparent; 
}

/* Flipped pushed button background for vertical progressbar through and the like */
.trough.vertical {
    background-image: linear-gradient(to right,
                                      @borders,
                                      shade(@theme_bg_color, 0.95)
                                      );
}

/* Primary and inline toolbars pushed button background */
.primary-toolbar .button:active,
.primary-toolbar .button:active:hover,
.inline-toolbar .button:active,
.inline-toolbar .button:active:hover {
    background-image: linear-gradient(to bottom,
				      shade(@borders, 0.95),
                                      shade(@theme_bg_color, 0.88)
                                      );
    background-color: transparent;
}

/* Prelit button background */
.button:hover,
.toolbar .button:hover,
.toolbar .button.raised:hover,
.toolbar .raised .button:hover,
.toolbar GtkComboBox .button:hover,
.spinbutton.vertical .button:hover {
    background-color: transparent;
    background-image: linear-gradient(to bottom,
				      @button_hover_gradient_color_a,
                                      @button_hover_gradient_color_b
                                      );
}

/* Prelit button on primary toolbar background */
.primary-toolbar .button:hover {
    background-color: transparent;
    background-image: linear-gradient(to bottom,
				      alpha(@toolbar_button_prelight, 0),
                                      @toolbar_button_prelight 54%,
                                      alpha(@toolbar_button_prelight, 0)
                                      );
}

/* Insensitive button background */
.button:insensitive,
.spinbutton.vertical .button:insensitive,
.toolbar GtkComboBox .button:insensitive,
.toolbar .button.raised:insensitive,
.toolbar .raised .button:insensitive {
    background-image: none;
    background-color: @insensitive_bg_color;
}

/* Pushed + Insensitive button background */
.button:active:insensitive,
.toolbar .button:active:insensitive,
.toolbar GtkComboBox .button:active:insensitive {
    background-image: linear-gradient(to bottom,
                                      shade(@insensitive_bg_color, 0.95),
                                      @insensitive_bg_color 40%,
                                      @insensitive_bg_color
				      );
    background-color: transparent;
}

/* Unfocused window button background */
.button:backdrop,
.toolbar .button.raised:backdrop,
.toolbar .raised .button:backdrop,
.toolbar .button:backdrop:hover,
.toolbar GtkComboBox .button:backdrop,
.toolbar GtkComboBox .button:backdrop:hover,
.primary-toolbar .raised .button:backdrop:hover {
    background-image: none;
    background-color: @unfocused_button_background;
}

/* Unfocused window pushed button background */
.button:active:backdrop,
.toolbar .button:active:backdrop,
.toolbar .button:active:hover:backdrop {
    background-image: none;
    background-color: @unfocused_borders;
}

/* Unfocused window insensitive button background */
.button:insensitive:backdrop,
.toolbar .button:insensitive:backdrop {
    background-image: none;
    background-color: @unfocused_insensitive_bg_color;
}

.button:insensitive:active:backdrop {
    background-image: none;
    background-color: mix(@unfocused_insensitive_bg_color, @unfocused_borders, 0.5);
}

/* Entry background */
.entry,
GtkComboBox.combobox-entry .button,
GtkComboBox.combobox-entry .button:hover,
.primary-toolbar GtkComboBox.combobox-entry .button,
.primary-toolbar GtkComboBox.combobox-entry .button:hover,
.level-bar.trough {
    background-image: linear-gradient(to bottom,
                                      @entry_background_a,
                                      @entry_background_b
                                      );
    box-shadow: inset 0 1px @entry_inset, 
                inset 0 2px alpha(@entry_inset, 0.4);
}

/* Entry pushed button background */
.primary-toolbar GtkComboBox.combobox-entry .button:active,
/* .primary-toolbar GtkComboBox.combobox-entry .button:hover:active,*/
GtkComboBox.combobox-entry .button:active,
.spinbutton .button:active,
.spinbutton .button:active:hover,
column-header.button:active,
column-header .button:active,
column-header.button:active:hover,
column-header .button:active:hover {
    background-image: linear-gradient(to bottom,
                                      shade(@entry_background_a, 0.9),
                                      @entry_background_b
                                      );
    background-color: transparent;
    box-shadow: inset 0 1px @entry_inset, 
                inset 0 2px alpha(@entry_inset, 0.4);
}

/* Insensitive entry background */
.entry:insensitive,
GtkComboBox.combobox-entry .button:insensitive,
.level-bar.trough:insensitive {
    background-color: @insensitive_bg_color;
    background-image: none;
    box-shadow: none;
}

/* Unfocused windows entry background */
.entry:backdrop,
GtkComboBox.combobox-entry .button:backdrop,
column-header.button:backdrop,
column-header .button:backdrop,
column-header.button:insensitive:backdrop,
column-header .button:insensitive:backdrop,
.level-bar.trough:backdrop,
.spinbutton.vertical.entry:backdrop {
    background-image: none;
    background-color: @theme_unfocused_base_color;
    box-shadow: none;
}

/* Unfocused windows insensitive entry background */
.entry:insensitive:backdrop,
GtkComboBox.combobox-entry .button:insensitive:backdrop,
.level-bar.trough:insensitive:backdrop,
.spinbutton.vertical.entry:insensitive:backdrop {
    background-image: none;
    background-color: @unfocused_insensitive_bg_color;
}


/* Primary and inline toolbars background */
.primary-toolbar .toolbar,
.primary-toolbar.toolbar,
.inline-toolbar.toolbar  {
    background-image: linear-gradient(to bottom,
                                      @toolbar_gradient_a,
                                      @toolbar_gradient_b 50%,
                                      @toolbar_gradient_c
                                      );
    background-color: transparent;
}

.primary-toolbar .toolbar.vertical,
.primary-toolbar.toolbar.vertical,
.inline-toolbar.toolbar.vertical {
    background-image: linear-gradient(to right,
                                      @toolbar_gradient_a,
                                      @toolbar_gradient_b 50%,
                                      @toolbar_gradient_c
                                      );
    background-color: transparent;
}

/* Unfocused window primary and inline toolbars background */
.primary-toolbar .toolbar:backdrop,
.primary-toolbar.toolbar:backdrop,
.inline-toolbar.toolbar:backdrop  {
    background-image: none;
    background-color: @unfocused_dark_bg;
}

/* Active switch background*/
GtkSwitch.trough:active,
.scale.progressbar {
    background-image: linear-gradient(to bottom,
                                      @switch_trough_active_bg_a,
                                      @switch_trough_active_bg_b
                                      );
    background-color: transparent;
}

GtkSwitch.trough:backdrop {
    background-color: @theme_unfocused_bg_color; /* FIXME */
    background-image: none;
}

GtkSwitch.trough:active:backdrop {
    background-color: @unfocused_borders;
    background-image: none;
}

.scale.progressbar.vertical {
    background-image: linear-gradient(to right,
                                      @switch_trough_active_bg_a,
                                      @switch_trough_active_bg_b
                                      );
    background-color: transparent;
}

/* Progressbar backgrounds */

.progressbar,
.progressbar row,
.progressbar row:hover,
.progressbar row:selected,
.progressbar row:selected:focus {
    background-image: linear-gradient(to left top,
                                      alpha (@progressbar_pattern, 0.25),
                                      alpha (@progressbar_pattern, 0.25) 25%,
                                      transparent 25%,
                                      transparent 50%,
                                      alpha (@progressbar_pattern, 0.25) 50%,
                                      alpha (@progressbar_pattern, 0.25) 75%,
                                      transparent 75%,
                                      transparent
                                      ),
                      linear-gradient(to bottom,
                                      @progressbar_background_a,
                                      @progressbar_background_b 75%,
                                      shade(@progressbar_background_a, 0.85)
                                      );
    background-size: 40px 40px, auto;
    box-shadow: inset 1px 1px alpha(white, 0.2), inset -1px -1px alpha(white, 0.1);
}

.progressbar.vertical {
    background-image: linear-gradient(to right top,
                                      alpha (@progressbar_pattern, 0.25),
                                      alpha (@progressbar_pattern, 0.25) 25%,
                                      transparent 25%,
                                      transparent 50%,
                                      alpha (@progressbar_pattern, 0.25) 50%,
                                      alpha (@progressbar_pattern, 0.25) 75%,
                                      transparent 75%,
                                      transparent),
                      linear-gradient(to right,
                                      @progressbar_background_a,
                                      @progressbar_background_b 75%,
                                      shade(@progressbar_background_a, 0.85)
                                      );
}
