/* common color definitions */

@define-color warning_color #faad3d;
@define-color warning_bg_color @warning_color;
@define-color warning_fg_color black;

@define-color question_color #8aadd4;
@define-color question_bg_color @question_color;
@define-color question_fg_color white;

@define-color error_color #ed3636;
@define-color error_bg_color @error_color;
@define-color error_fg_color white;

@define-color error_color #cc0000;
@define-color success_color #4e9a06;

* {
    -GtkRange-stepper-size: 2;
    -GtkScale-slider-length: 28;
    -GtkRange-slider-width: 28;

    -GtkTreeView-expander-size: 16;

    -GtkWidget-cursor-color: @theme_cursor_color;
    -GtkWidget-cursor-aspect-ratio: 0.08;

    -GtkWidget-focus-padding: 1;
    -GtkWidget-focus-line-width: 2;
    -GtkWidget-focus-line-pattern: "\002\002";

    -GtkMenu-horizontal-padding: 0;
    -GtkMenu-vertical-padding: 0;

    -GtkScrolledWindow-scrollbar-spacing: 0;
    -GtkScrolledWindow-scrollbars-within-bevel: 1;

    -GtkComboBox-arrow-scaling: 0.9;
    -GtkButton-default-border: 0;

    background-clip: padding-box;
}

GtkWindow {
    color: @theme_fg_color;
}

/* FIXME: this shouldn't be needed... */
* {
    background-color: @theme_base_color;
}

*:insensitive {
    background-color: @theme_button_insensitive_bg;
    border-color: @theme_button_insensitive_active_bg;
}

GtkCheckButton:selected,
GtkCheckButton:selected:focus {
    background-color: @theme_internal_bg;
    color: @theme_fg_color;
}

.image {
    color: @theme_active_color;
}

.image:hover {
    color: @theme_fg_color;
}

GtkLabel,
GtkLabel:insensitive,
GtkImage,
GtkImage:insensitive {
    background-color: transparent;
}

.tooltip {
    background-color: @theme_fg_color;
    color: @theme_insensitive_bg;
}

.view.rubberband,
.rubberband {
    border-color: @theme_fg_color;
    border-style: solid;
    border-width: 1px;

    background-color: alpha(@theme_internal_bg, 0.35);
}

.grip {
    background-color: @theme_insensitive_color;
}

/***********
 * Buttons *
 ***********/
.button {
    border-width: 2px;
    border-style: solid;
    border-color: @theme_button_fg;

    border-radius: 3px;

    background-color: @theme_button_bg;
    padding: 1px 4px;
    color: @theme_button_fg;
}

.button:active {
    background-color: @theme_slider_bg;
    color: @theme_base_color;
    border-color: @theme_slider_bg;
}

.button:insensitive {
    background-color: @theme_button_insensitive_bg;
    color: @theme_button_insensitive_fg;
    border-color: @theme_insensitive_border;
}

GtkComboBox:insensitive {
    color: @theme_button_insensitive_fg
}

.button:insensitive:active {
    background-color: @theme_button_insensitive_active_bg;
    border-color: @theme_button_insensitive_active_bg;
    color: @theme_button_insensitive_active_fg;
}

.button:hover {
    background-color: @theme_fg_color;
    border-color: @theme_fg_color;
    color: @theme_base_color;
}

.button:hover:active {
    background-color: @theme_fg_color;
    border-color: @theme_fg_color;
}

/***********
 * Entries *
 ***********/
.entry {
    border-width: 1px;
    border-style: solid;
    border-color: @theme_fg_color;

    border-radius: 3px;

    background-color: @theme_base_color;
    padding: 4px;
}

.entry:selected {
    background-color: @theme_active_color;
    color: @theme_base_color;
}

.entry:focus {
    border-width: 2px;
    border-color: @theme_highlight_color;
}

.entry:insensitive {
    border-color: @theme_insensitive_border;
    background-color: @theme_insensitive_bg;
    color: @theme_insensitive_color;
}

GtkComboBox *:hover {
    color: @theme_insensitive_bg;
}

GtkComboBox .separator {
    color: transparent;
}

.trough {
    background-color: @theme_button_bg;
    color: @theme_active_color;

    border-width: 1px;
    border-style: solid;
    border-color: @theme_active_color;
    border-radius: 3px;
}

.trough:insensitive {
    border-color: @theme_insensitive_border;
    background-color: @theme_insensitive_bg;
    color: @theme_insensitive_color;
}

.trough:insensitive:active {
    background-color: @theme_insensitive_bg;
}

.progressbar {
    background-color: @theme_highlight_color;
    border-width: 1px;
    border-color: @theme_highlight_border;
    border-radius: 3px
}

GtkComboBox .button {
    padding: 0 4px;
}

.combobox-entry .button {
    background-color: @theme_base_color;
    color: @theme_fg_color;
    border-width: 1px;
    border-color: @theme_fg_color;
}

.combobox-entry .button:hover {
    background-color: @theme_fg_color;
}

.combobox-entry .button:active {
    background-color: @theme_active_color;
    color: @theme_base_color;
}

.combobox-entry .button:insensitive {
    background-color: @theme_insensitive_bg;
    color: @theme_internal_bg;
    border-color: @theme_insensitive_border;
}

.combobox-entry .entry:first-child {
    border-right-width: 0px;
    border-radius: 2px 0 0 2px;
}

.combobox-entry .entry:last-child {
    border-left-width: 0px;
    border-radius: 0 2px 2px 0;
}

.combobox-entry .button:first-child {
    border-radius: 2px 0 0 2px;
}

.combobox-entry .button:last-child {
    border-radius: 0 2px 2px 0;
}

.spinbutton .button {
    padding: 2px 6px;
    color: @theme_active_color;

    border-width: 1px;
    border-radius: 0;
    background-color: @theme_base_color;
    background-clip: border-box;

    border-color: transparent @theme_internal_border;
}

.spinbutton .button:hover {
    background-color: @theme_active_color;
    color: @theme_insensitive_bg;
    border-color: @theme_active_color;
}

.spinbutton .button:insensitive {
    color: @theme_internal_bg;
    background-color: @theme_insensitive_bg;
}

.spinbutton .button:focus {
    border-top-color: @theme_highlight_color;
    border-bottom-color: @theme_highlight_color;
}

.spinbutton .button:first-child,
.spinbutton .button:last-child {
    border-color: transparent;
}

.spinbutton .button:first-child:focus {
    border-color: @theme_highlight_color;
    border-right-color: transparent;
}

.spinbutton .button:last-child:focus {
    border-color: @theme_highlight_color;
    border-left-color: transparent;
}

.spinbutton .button:first-child {
    border-radius: 2px 0 0 2px;
}

.spinbutton .button:last-child {
    border-radius: 0 2px 2px 0;
}

.menuitem {
    color: @theme_fg_color;
}

.menuitem:insensitive {
    color: @theme_button_insensitive_fg;
}

.menubar .menuitem {
    padding: 3px 5px;
}

.menubar .menuitem:hover {
    background-color: @theme_active_color;
    color: @theme_base_color;
}

.menu .menuitem {
    padding: 4px;
}

.menu .menuitem:hover {
    background-color: @theme_active_color;
    color: @theme_base_color;
}

.menu {
    border-style: solid;
    border-color: @theme_fg_color;
    border-width: 1px;

    color: @theme_fg_color;
}

.menuitem.separator {
    -GtkMenuItem-horizontal-padding: 0;
}

.toolbar {
    padding: 4px;
    border-width: 1px 0;
    border-style: solid;
    border-color: @theme_active_color;
}

.toolbar .button {
    background-color: transparent;
}

.toolbar .button:insensitive {
    background-color: @theme_base_color;
}

.primary-toolbar .button:insensitive {
    background-color: transparent;
    color: @theme_insensitive_color ;
}

.raised .button,
.raised.button {
    background-color: @theme_button_bg;
}

.primary-toolbar .raised .button:insensitive,
.primary-toolbar .raised.button:insensitive {
    border-color: @theme_button_insensitive_border;
    background-color: @theme_button_insensitive_bg;
    color: @theme_button_insensitive_fg;
}

.primary-toolbar .raised .button:active,
.primary-toolbar .raised.button:active,
.primary-toolbar .button:active,
.toolbar .button:active {
    background-color: @theme_slider_bg;
    border-color: @theme_slider_bg;
}

.primary-toolbar .raised .button:hover,
.primary-toolbar .raised.button:hover,
.primary-toolbar .button:hover,
.toolbar .button:hover {
    background-color: @theme_fg_color;
    border-color: @theme_fg_color;
}

.primary-toolbar .raised .button:active:insensitive,
.primary-toolbar .raised.button:active:insensitive,
.primary-toolbar .button:active:insensitive,
.toolbar .button:active:insensitive {
    border-color: @theme_button_insensitive_active_bg;
    background-color: @theme_button_insensitive_active_bg;

    color: @theme_base_color;
}

.linked .button,
.inline-toolbar .button {
    color: @theme_active_color;
    border-color: @theme_active_color;
    background-color: @theme_base_color;
}

.linked .button:hover,
.inline-toolbar .button:hover {
    color: @theme_base_color;
    border-color: @theme_fg_color;
}

.linked .button:active,
.inline-toolbar .button:active {
    color: @theme_base_color;
}

.linked .button:insensitive,
.inline-toolbar .button:insensitive {
    border-color: @theme_insensitive_border;
    background-color: @theme_button_insensitive_bg;

    color: @theme_button_insensitive_fg;
}

.primary-toolbar.toolbar,
.primary-toolbar .toolbar,
.menubar.toolbar,
.inline-toolbar {
    -GtkToolbar-button-relief: normal;
}

.primary-toolbar {
    background-color: @theme_primary_toolbar;
}

.inline-toolbar {
    background-color: @theme_button_bg;
}

.inline-toolbar {
    border-width: 0 1px 1px;
}

.inline-toolbar:last-child {
    border-radius: 0 0 3px 3px;
}

.primary-toolbar.toolbar,
.primary-toolbar .toolbar,
.menubar {
    -GtkWidget-window-dragging: true;
}

.primary-toolbar .button {
    border-color: transparent;
}

.primary-toolbar .button.raised,
.primary-toolbar .raised .button {
    border-color: @theme_button_fg;
}

.osd .button,
.linked .button,
.inline-toolbar .button {
    border-left-width: 0;
    border-radius: 0;
}

.osd .button:first-child,
.linked .button:first-child,
.inline-toolbar GtkToolButton:first-child .button {
    border-radius: 3px 0 0 3px;
    border-left-width: 2px;
}

.osd .button:last-child,
.linked .button:last-child,
.inline-toolbar GtkToolButton:last-child .button {
    border-radius: 0 3px 3px 0;
}

GtkScale.trough {
    background-image: linear-gradient(to bottom,
                                      transparent,
                                      transparent 14px,
                                      @theme_active_color 14px,
                                      @theme_active_color 16px,
                                      transparent 16px,
                                      transparent);

    background-color:transparent;
    border-style: none;
}

GtkScale.trough:insensitive {
    background-image: linear-gradient(to bottom,
                                      transparent,
                                      transparent 14px,
                                      @theme_button_insensitive_active_bg 14px,
                                      @theme_button_insensitive_active_bg 16px,
                                      transparent 16px,
                                      transparent);
    background-color: transparent;
}

GtkScale.trough.vertical {
    background-image: linear-gradient(to right,
                                      transparent,
                                      transparent 14px,
                                      @theme_active_color 14px,
                                      @theme_active_color 16px,
                                      transparent 16px,
                                      transparent);
    background-color:transparent;
    border-style: none;
}

GtkScale.trough.vertical:insensitive {
    background-image: linear-gradient(to right,
                                      transparent,
                                      transparent 14px,
                                      @theme_button_insensitive_active_bg 14px,
                                      @theme_button_insensitive_active_bg 16px,
                                      transparent 16px,
                                      transparent);
}

GtkScale.slider {
    background-clip: border-box;
    background-color: @theme_button_bg;
    color: transparent;

    border-radius: 15px;
    border-color: @theme_active_color;
    border-style: solid;
    border-width: 1px;
}

GtkScale.slider:hover {
    background-color: @theme_fg_color;
    border-color: @theme_fg_color;
}

GtkScale.slider:insensitive {
    background-color: @theme_button_insensitive_bg;
    border-color: @theme_button_insensitive_active_bg;
}

GtkSwitch {
    font: bold;
}

GtkSwitch.slider {
    padding: 2px;

    border-width: 0;
    border-style: solid;
    border-radius: 3px;

    background-color: @theme_active_color;
    background-clip: border-box;
}

GtkSwitch.slider:insensitive {
    background-color: @theme_button_insensitive_active_bg;
}

GtkSwitch.slider:active {
    background-color: @theme_base_color;
}

GtkSwitch.trough {
    background-color: @theme_button_bg;

    border-color: @theme_fg_color;
    border-radius: 3px;
}

GtkSwitch.trough:active {
    color: @theme_base_color;
    background-color: @theme_highlight_color;
    border-color: @theme_highlight_alt;
}

GtkSwitch.trough:insensitive {
    background-color: @theme_button_insensitive_bg;
    color: @theme_button_insensitive_active_bg;
}

GtkSwitch.trough:active:insensitive {
    background-color: alpha(@theme_highlight_color, 0.30);
    border-color: alpha(@theme_highlight_alt, 0.30);
    color: @theme_base_color;
}

.notebook {
    border-width: 1px;
    border-color: @theme_active_color;
    border-style: solid;
    background-clip: border-box;
}

.notebook tab {
    padding: 3px;
}

.notebook tab.top {
    border-image: linear-gradient(to bottom,
                                  alpha(@theme_active_color, 0.00),
                                  @theme_active_color) 1 / 0 1px;
}

.notebook tab.top:active {
    border-width: 1px 1px 0 1px;
    border-radius: 4px 4px 0 0;

    border-image: none;
}

.notebook tab.bottom {
    border-width: 0 1px 1px 1px;
}

.notebook tab.left {
    border-width: 1px 0 1px 1px;
}

.notebook tab.right {
    border-width: 1px 1px 1px 0;
}

.notebook tab:active {
    background-color: @theme_base_color;
    color: @theme_fg_color;
}

.frame {
    border-width: 1px;
    border-style: solid;
    border-color: @theme_active_color;
}

GtkScrolledWindow.frame {
    border-width: 1px;
    border-style: solid;
    border-color: @theme_active_color;
}

column-header .button,
column-header.button {
    font: bold;

    border-width: 1px;

    border-top-width: 0;
    border-right-width: 0;
    border-radius: 0;
}

column-header .button:hover {
    background-color: @theme_fg_color;
    color: @theme_base_color;
    border-color: @theme_fg_color;
}

column-header:first-child .button {
    border-left-width: 0;
}

.check,
.radio {
    border-width: 1px;
    border-style: solid;
    border-color: @theme_active_color;
    color: @theme_active_color;

    background-color: @theme_button_bg;
}

.check:insensitive,
.radio:insensitive {
    border-color: @theme_button_insensitive_border;
    color: @theme_button_insensitive_fg;
    background-color: @theme_button_insensitive_bg;
}

.menuitem.check,
.menuitem.radio {
    background-color: transparent;
    color: transparent;
    border-color: transparent;
}

.menuitem.radio:active,
.menuitem.check:active,
.menuitem.radio:inconsistent,
.menuitem.check:inconsistent {
    color: @theme_active_color;
}

.menuitem.radio:active:hover,
.menuitem.check:active:hover,
.menuitem.radio:inconsistent:hover,
.menuitem.check:inconsistent:hover {
    color: @theme_base_color;
}

.menuitem.radio:active:insensitive,
.menuitem.check:active:insensitive,
.menuitem.radio:inconsistent:insensitive,
.menuitem.check:inconsistent:insensitive {
    color: @theme_button_insensitive_fg;
}

.expander row:selected:focus {
    color: @theme_base_color;
}

.floating-bar {
    background-color: @theme_insensitive_bg;
}

.info {
    background-color: @theme_active_color;
    color: @theme_base_color;
}

.warning {
    background-color: @warning_bg_color;
    color: @warning_fg_color;
}

.question {
    background-color: @question_bg_color;
    color: @question_fg_color;
}

.error {
    background-color: @error_bg_color;
    color: @error_fg_color;
}

.scrollbar {
    -GtkRange-slider-width: 20;
    -GtkRange-stepper-size: 20;
    -GtkRange-trough-border: 0;
    -GtkScrollbar-has-backward-stepper: false;
    -GtkScrollbar-has-forward-stepper: false;
    -GtkScrollbar-min-slider-length: 64;
}

.scrollbar.trough {
    background-color: @theme_internal_bg;

    border-width: 0;
    border-color: transparent;
    border-radius: 0;
}

.scrollbars-junction {
    background-color: @theme_internal_bg;
}

.scrollbar.trough.vertical {
    box-shadow: inset 1px 0 @theme_internal_border;
}

.scrollbar.trough.horizontal {
    box-shadow: inset 0 1px @theme_internal_border;
}

.scrollbar.slider {
    background-color: @theme_slider_bg;

    border-style: solid;
    border-radius: 12px;
    border-width: 4px;
    border-color: transparent;
}

.scrollbar.slider:hover,
.scrollbar.slider:active:hover {
    background-color: @theme_fg_color;
    border-width: 4px;
    border-color: transparent;
}

.view {
    background-color: @theme_base_color;
}

.view:selected {
    background-color: @theme_active_color;
    color: @theme_base_color;
}

.view:selected:focus {
    background-color: @theme_fg_color;
    color: @theme_base_color;
}

GtkIconView.view.cell {
    border-radius: 4px;
}

GtkColorSwatch {
    border-width: 1px;
    border-style: solid;
    border-color: @theme_fg_color;
}

TerminalScreen {
    background-color: @theme_base_color;
    color: @theme_fg_color;
}

.nautilus-cluebar-label {
    color: @theme_base_color;
    font: bold;
}

NautilusWindow .pane-separator {
    border-style: solid;
    border-width: 1px;
    border-color: @theme_active_color;
}

NautilusWindow .sidebar .frame {
    border-style: solid;
    border-width: 1px 0 0 0;
}

.nautilus-inactive-pane .view {
    background-color: @theme_insensitive_bg;
}

.documents-icon-bg {
    background-color: @theme_internal_bg;
    color: @theme_fg_color;
    border-radius: 3px;
}

.documents-collection-icon {
    background-color: @theme_internal_bg;
    border-radius: 6px;
}

.documents-selection-mode.toolbar {
    background-color: @theme_internal_bg;
}

.osd {
    color: @theme_base_color;
    background-color: @theme_active_color;
}

.osd.toolbar {
    padding: 20px;

    border-style: solid;
    border-color: @theme_internal_bg;
    border-width: 2px;

    -GtkToolbar-button-relief: normal;
}

.osd .button {
    padding: 4px;
    color: @theme_fg_color;
    background-color: @theme_internal_bg;
}

.osd GtkToolButton .button,
.osd .button:only-child {
    border-width: 2px;
    border-radius: 3px;
    border-style: solid;
}

.osd .button:hover {
    color: @theme_base_color;
}

.osd .button:active {
    color: @theme_fg_color;
    background-color: @theme_base_color;
}
