
/**********
 * button *
 **********/

button,
button.flat:hover,
toolbar.inline-toolbar toolbutton > button.flat,
.inline-toolbar toolbutton > button,
.inline-toolbar toolbutton > button.flat,
.mate-panel-menu-bar button:hover {
    border: 1px solid shade(@button_border, 0.95);
    border-top-color: @button_border;
    border-bottom-color: shade(@button_border, 0.9);
    border-radius: 3px;
    box-shadow: inset 0 1px alpha(white, 1.0),
                inset 1px 0 alpha(white, 0.4),
                inset -1px 0 alpha(white, 0.4),
                inset 0 -1px alpha(white, 0.2),
                1px 0 alpha(black, 0.05),
                -1px 0 alpha(black, 0.05),
                0 1px alpha(black, 0.1);
}

button.flat,
button.sidebar-button,
button.flat:disabled,
button.sidebar-button:disabled,
.mate-panel-menu-bar button {
    border-color: transparent;
    border-image: none;
    box-shadow: none;
}

button:active,
button:checked,
button.flat:active,
button.flat:checked,
.inline-toolbar button:active,
.inline-toolbar button:checked,
.inline-toolbar button.flat:active,
.inline-toolbar button.flat:checked,
.mate-panel-menu-bar button:active,
.mate-panel-menu-bar button:checked {
    border: 1px solid shade(@button_border, 0.95);
    border-top-color: @button_border;
    border-bottom-color: shade(@button_border, 0.9);
    border-radius: 3px;
    box-shadow: inset 0 1px alpha(black, 0.1),
                inset 1px 0 alpha(black, 0.08),
                inset -1px 0 alpha(black, 0.08),
                inset 0 -1px alpha(black, 0.06);
}

button:disabled,
.inline-toolbar button:disabled,
.inline-toolbar button.flat:disabled {
    box-shadow: inset 0 1px alpha(white, 0.3),
                inset 1px 0 alpha(white, 0.15),
                inset -1px 0 alpha(white, 0.15),
                inset 0 -1px alpha(white, 0.06);
}

button:active:disabled,
button:checked:disabled,
.inline-toolbar button:active:disabled,
.inline-toolbar button:checked:disabled,
.inline-toolbar button.flat:checked:disabled {
    box-shadow: inset 0 1px alpha(black, 0.1),
                inset 1px 0 alpha(black, 0.08),
                inset -1px 0 alpha(black, 0.08),
                inset 0 -1px alpha(black, 0.06);
}

button.default {
    border-color: @theme_selected_bg_color;
    box-shadow: inset 0 1px @theme_selected_bg_color,
                inset 1px 0 @theme_selected_bg_color,
                inset -1px 0 @theme_selected_bg_color,
                inset 0 -1px @theme_selected_bg_color;
}

/************************************
* Primary toolbar/headerbar buttons *
*************************************/

headerbar button.titlebutton,
headerbar button.titlebutton:hover,
headerbar button.titlebutton:active,
headerbar button.titlebutton:checked {
    border: none;
    box-shadow: none;
}

headerbar button.flat,
headerbar button.titlebutton.appmenu,
.primary-toolbar button.flat {
    border: 1px solid transparent;
    border-radius: 3px;
    box-shadow: none;
}

headerbar button,
headerbar button.flat:hover,
headerbar button.toggle:hover,
headerbar button.titlebutton.appmenu:hover,
.primary-toolbar button,
.primary-toolbar button:hover,
.primary-toolbar button.flat:hover {
    border: 1px solid shade(@button_border, 0.9);
    border-top-color: shade(@button_border, 0.95);
    border-bottom-color: shade(@button_border, 0.85);
    border-radius: 3px;
    box-shadow: inset 0 1px alpha(white, 1.0),
                inset 1px 0 alpha(white, 0.2),
                inset -1px 0 alpha(white, 0.2),
                inset 0 -1px alpha(white, 0.05),
                1px 0 alpha(white, 0.01),
                -1px 0 alpha(white, 0.01),
                0 1px alpha(white, 0.3);
}

headerbar button:active,
headerbar button:checked,
headerbar button.flat:active,
headerbar button.flat:checked,
headerbar button.toogle:active,
headerbar button.toggle:checked,
headerbar button.titlebutton.appmenu:active,
headerbar button.titlebutton.appmenu:hover,
.primary-toolbar button:active,
.primary-toolbar button:checked,
.primary-toolbar button.flat:active,
.primary-toolbar button.flat:checked {
    border: 1px solid shade(@button_border, 0.9);
    border-top-color: shade(@button_border, 0.95);
    border-bottom-color: shade(@button_border, 0.85);
    border-radius: 3px;
    box-shadow: inset 0 1px alpha(black, 0.1),
                inset 1px 0 alpha(black, 0.08),
                inset -1px 0 alpha(black, 0.08),
                inset 0 -1px alpha(black, 0.06),
                1px 0 alpha(white, 0.01),
                -1px 0 alpha(white, 0.01),
                0 1px alpha(white, 0.3);
}

headerbar button:disabled,
.primary-toolbar .button:disabled {
    box-shadow: inset 0 1px alpha(white, 0.3),
                inset 1px 0 alpha(white, 0.15),
                inset -1px 0 alpha(white, 0.15),
                inset 0 -1px alpha(white, 0.06),
                0 1px alpha(white, 0.3);
}

headerbar button.flat:disabled,
headerbar button.titlebutton.appmenu:disabled,
.primary-toolbar button.flat:disabled {
    box-shadow: none;
}

headerbar button:active:disabled,
headerbar button:checked:disabled,
.primary-toolbar button:active:disabled,
.primary-toolbar button:checked:disabled {
    box-shadow: inset 0 1px alpha(black, 0.1),
                inset 1px 0 alpha(black, 0.08),
                inset -1px 0 alpha(black, 0.08),
                inset 0 -1px alpha(black, 0.06);
}

/*****************
 * column-header *
 *****************/

treeview.view header button,
treeview.view header button:active,
treeview.view header button:hover,
treeview.view header button:disabled {
    border-style: none solid solid none;
    border-radius: 0;
    border-color: @border;
    border-image: none;
}

treeview.view header button:last-child {
    border-right-style: none;
}

/**********
 * switch *
 **********/

switch {
    border: 1px solid @border;
    border-radius: 4px;
    box-shadow: inset 0 1px alpha(black, 0.1),
                inset 1px 0 alpha(black, 0.08),
                inset -1px 0 alpha(black, 0.08),
                inset 0 -1px alpha(black, 0.06),
                0 1px alpha(white, 0.2);
}

switch:disabled,
switch:disabled:active {
    border-color: shade(@border, 1.1);
}

switch slider {
    border: 1px solid @border;
    border-radius: 4px;
    box-shadow: inset 0 1px alpha(white, 1.0),
                inset 1px 0 alpha(white, 0.5),
                inset -1px 0 alpha(white, 0.5),
                inset 0 -1px alpha(white, 0.1);
}

switch slider:disabled {
    border-color: shade(@border, 1.1);
    box-shadow: inset 0 1px alpha(white, 0.3),
                inset 1px 0 alpha(white, 0.15),
                inset -1px 0 alpha(white, 0.15),
                inset 0 -1px alpha(white, 0.06);
}

/***********
 * Entries *
 ***********/

entry,
GtkComboBox.combobox-entry .button {
    border: 1px solid shade(@button_border, 0.9);
    border-radius: 3px;
    box-shadow: inset 0 1px alpha(black, 0.1),
                inset 1px 0 alpha(black, 0.04),
                inset -1px 0 alpha(black, 0.04),
                inset 0 -1px alpha(black, 0.02),
                0 1px alpha(white, 0.4);
}

entry:disabled {
    border: 1px solid @button_border;
}

.linked:not(.vertical) > entry {
    border-radius: 0;
    border-right-style: none;
}

.linked:not(.vertical) > entry:first-child {
    border-top-left-radius: 3px;
    border-bottom-left-radius: 3px;
}

.linked:not(.vertical) > entry:last-child {
    border-top-right-radius: 3px;
    border-bottom-right-radius: 3px;
    border-right-style: solid;
}

.linked:not(.vertical) > entry:only-child {
    border-radius: 3px;
    border-style: solid;
}

.linked:not(.vertical) > entry + entry {
    border-left-color: @button_border;
}

.linked.vertical > entry {
    border-radius: 0;
    border-bottom-style: none;
}

.linked.vertical > entry:first-child {
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
}

.linked.vertical > entry:last-child {
    border-bottom-right-radius: 3px;
    border-bottom-left-radius: 3px;
    border-style: solid;
}

.linked.vertical > entry + entry {
    border-top-color: @button_border;
}

/********************************************
 * Linked borders and shadows - Nomal/Hover *
 ********************************************/

/* Middle Button */

.linked > button,
.linked > button:hover,
.linked > button:active,
.linked > button:checked,
/*.inline-toolbar .linked > button,
.inline-toolbar .linked > button:hover,
.inline-toolbar .linked > button:active,
.inline-toolbar .linked > button:checked,
.inline-toolbar toolitem button,
.inline-toolbar.toolbar button:hover,
.inline-toolbar.toolbar button:active,
.inline-toolbar.toolbar button:checked,*/
.inline-toolbar button,
toolbar.inline-toolbar toolbutton > button.flat,
toolbar.inline-toolbar toolbutton > button.flat:hover,
toolbar.inline-toolbar toolbutton > button.flat:checked,
.linked > combobox > box > button.combo:dir(ltr),
.linked > combobox > box > button.combo:dir(rtl) {
    border-radius: 0;
    border-right-style: none;
}

.linked > button:first-child,
.linked > button:first-child:hover,
.linked > button:first-child:active,
.linked > button:first-child:checked,
toolbar.inline-toolbar toolbutton:first-child > button.flat,
.inline-toolbar button:first-child,
/*.inline-toolbar.toolbar button:first-child,
.inline-toolbar.toolbar button:first-child:hover,
.inline-toolbar.toolbar button:first-child:active,
.inline-toolbar.toolbar button:first-child:checked,*/
.linked > combobox:first-child > box > button.combo {
    border-top-left-radius: 3px;
    border-bottom-left-radius: 3px;
}

.linked > button:last-child,
.linked > button:last-child:hover,
.linked > button:last-child:active,
.linked > button:last-child:checked,
/*.inline-toolbar.toolbar button:last-child,
.inline-toolbar.toolbar button:last-child:hover,
.inline-toolbar.toolbar button:last-child:active,
.inline-toolbar.toolbar button:last-child:checked,*/
toolbar.inline-toolbar toolbutton:last-child > button.flat,
.inline-toolbar button:last-child,
.linked >combobox:last-child > box > button.combo {
    border-top-right-radius: 3px;
    border-bottom-right-radius: 3px;
    border-right-style: solid;
}

.linked > button:only-child,
.linked > button:only-child:hover,
.linked > button:only-child:active,
.linked > button:only-child:checked,
/*.inline-toolbar.toolbar button:only-child,
.inline-toolbar.toolbar button:only-child:hover,
.inline-toolbar.toolbar button:only-child:active,
.inline-toolbar.toolbar button:only-child:checked,*/
toolbar.inline-toolbar toolbutton:only-child > button.flat,
.inline-toolbar button:only-child,
.linked > combobox:only-child > box > button.combo {
    border-radius: 3px;
    border-style: solid;
}

.linked.vertical > button,
.linked.vertical > button:hover,
.linked.vertical > button:active,
.linked.vertical > button:checked,
.linked.vertical > combobox > box > button.combo {
    border-style: solid solid none solid;
    border-radius: 0;
}

.linked.vertical > button:first-child,
.linked.vertical > button:first-child:hover,
.linked.vertical > button:first-child:active,
.linked.vertical > button:first-child:checked,
.linked.vertical > combobox:first-child > box > button.combo {
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
}

.linked.vertical > button:last-child,
.linked.vertical > button:last-child:hover,
.linked.vertical > button:last-child:active,
.linked.vertical > button:last-child:checked,
.linked.vertical > combobox:last-child > box > button.combo {
    border-bottom-left-radius: 3px;
    border-bottom-right-radius: 3px;
    border-style: solid;
}

.linked.vertical > button:only-child,
.linked.vertical > button:only-child:hover,
.linked.vertical > button:only-child:active,
.linked.vertical > button:only-child:checked,
.linked.vertical > combobox:only-child > box > button.combo {
    border-radius: 3px;
    border-style: solid;
}
