@define-color documents_emblem_bg #3465a4;
@define-color documents_collection_bg #d3d7cf;

/****************
 * Applications *
 ****************/
/* gnome-terminal */
TerminalScreen {
    background-color: @theme_base_color;
    color: @theme_fg_color;
    -TerminalScreen-background-darkness: 0.95;
}

TerminalWindow GtkNotebook.notebook {
    border-bottom-width: 0;
    border-right-width: 0;
    border-left-width: 0;
}

#terminal-palette-table GtkColorButton.button {
    padding: 1px 4px;
}

/* nautilus */
.nautilus-canvas-item {
    border-radius: 5px;
}

.nautilus-desktop.nautilus-canvas-item {
    color: @theme_selected_fg_color;
    text-shadow: 1px 1px black;
}

.nautilus-desktop.nautilus-canvas-item:active {
    color: @theme_text_color;
}

.nautilus-desktop.nautilus-canvas-item:selected {
    color: @theme_selected_fg_color;
}

.nautilus-desktop.nautilus-canvas-item:active,
.nautilus-desktop.nautilus-canvas-item:prelight,
.nautilus-desktop.nautilus-canvas-item:selected {
    text-shadow: none;
}

.nautilus-desktop.nautilus-canvas-item:selected:backdrop {
    color: @theme_unfocused_selected_fg_color;
}

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

NautilusWindow .sidebar .frame:backdrop {
    border-color: @unfocused_borders;
}

NautilusWindow > GtkGrid > .pane-separator {
    border-width: 1px 1px 0 0;
    border-style: solid;
    border-color: @borders;
}

NautilusWindow > GtkGrid > .pane-separator,
NautilusWindow > GtkGrid > .pane-separator:hover {
    border-width: 1px 1px 0 0;
    border-style: solid;
    border-color: @borders;
    background-color: @sidebar_bg;
    color: shade (@theme_bg_color, 0.9);
}

NautilusWindow > GtkGrid > .pane-separator:backdrop,
NautilusWindow > GtkGrid > .pane-separator:hover:backdrop {
    border-width: 1px 1px 0 0;
    border-style: solid;
    border-color: @unfocused_borders;
    background-color: @sidebar_bg_unfocused;
    color: shade (@theme_bg_color, 0.9);
}

NautilusView.frame,
NautilusNotebook.notebook {
    border-right-width: 0;
    border-left-width: 0;
    border-bottom-width: 0;
}

NautilusNotebook .frame {
    border-width: 1px 0 0 0;
}

NautilusToolbar .button {
    icon-shadow: 0 1px @button_text_shadow;
}

NautilusToolbar .button *:active {
    icon-shadow: 0 1px @button_active_text_shadow;
}

NautilusToolbar .button *:insensitive,
NautilusToolbar .button *:active:insensitive {
    text-shadow: none;
}

NautilusQueryEditor .primary-toolbar.toolbar {
    border-bottom-width: 0;
    padding: 3px;
}

NautilusQueryEditor .toolbar {
    padding: 4px 4px 3px 4px;

    border-width: 1px 0 0 0;
    border-style: solid;
    border-color: @theme_bg_color;
    
    background-color: mix(@theme_bg_color, @theme_base_color, 0.5);
}

NautilusQueryEditor .toolbar:nth-child(2) {
    border-color: @borders;
}

NautilusQueryEditor .toolbar:backdrop {
    background-color: @theme_unfocused_base_color;
    border-color: @theme_unfocused_base_color;
}

NautilusQueryEditor .toolbar:backdrop:nth-child(2) {
    border-color: @unfocused_borders;
}


NautilusNotebook.notebook NautilusQueryEditor .primary-toolbar.toolbar {
    border-top-width: 0;
}

NautilusNotebook.notebook NautilusQueryEditor .toolbar:last-child,
NautilusNotebook.notebook NautilusQueryEditor .primary-toolbar.toolbar:only-child {
    border-bottom-width: 1px;
    border-bottom-color: @borders;
}

.toolbar NautilusPathBar .button {
    padding: 1px 4px;
}

/* gedit */

GeditWindow .pane-separator, 
GeditWindow .pane-separator:hover {
    border-width: 0 1px 1px 1px;
    border-style: solid;
    border-color: @borders;
    background-color: shade(@theme_bg_color, 0.95);
    color: @borders;
}

GeditPanel.title GtkLabel {
    padding: 7px 0 6px 0;
}

GeditPanel .toolbar {
    border-style: none;
    background-color: transparent;
}

GeditDocumentsPanel .view {
    background-color: @sidebar_bg;
}

GeditDocumentsPanel .view:backdrop {
    background-color: @sidebar_bg_unfocused;
}

GeditPanel .notebook {
    padding: 0px;
    border-width: 1px 0;
}

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

GeditPanel .notebook tab,
GeditWindow .notebook tab {
    border-width: 0;
}

GeditFloatingSlider .not-found {
    color: @error_fg_color;
    background-image: none;
    background-color: @error_bg_color;
}

GeditStatusComboBox .button {
    text-shadow: none;
}

GeditStatusComboBox .button:backdrop,
GeditStatusComboBox .button:backdrop:hover,
GeditStatusComboBox .button,
GeditStatusComboBox .button:hover,
GeditStatusComboBox .button:active,
GeditStatusComboBox .button:active:hover {
    border-image: none;
    border-style: solid;
    border-width: 0 1px;
    border-radius: 0;
    padding: 1px 8px 2px 4px;
}

GeditStatusComboBox .button:hover,
GeditStatusComboBox .button:active,
GeditStatusComboBox .button:active:hover {
    border-color: @borders;
}

GeditStatusComboBox .button:backdrop,
GeditStatusComboBox .button:backdrop:hover {
    border-color: @unfocused_borders;
}

/* gnome-documents */
.documents-dropdown,
.documents-dropdown .view {
    background-color: shade (@theme_bg_color, 1.02);
}

.documents-dropdown .frame {
    border-width: 0 1px 1px 1px;
    border-style: solid;
    border-radius: 0 0 5px 5px;
}

.documents-dropdown .radio,
.documents-dropdown .radio:focused,
.documents-dropdown .radio:selected {
    background-image: none;
    background-color: alpha(@theme_base_color, 0.0);
}

.documents-dropdown .radio:active,
.documents-dropdown .radio:active:focused,
.documents-dropdown .radio:active:prelight {
    background-image: url("assets/sidebar-radio-checked.svg");
}

.documents-dropdown .radio:prelight {
    background-image: url("assets/sidebar-radio-prelight.svg");
}

.documents-dropdown .radio:active:selected,
.documents-dropdown .radio:active:selected:focused {
    background-image: url("assets/sidebar-radio-selected.svg");
}

.documents-dropdown .radio:selected:prelight,
.documents-dropdown .radio:selected:focused {
    background-image: url("assets/sidebar-radio-selected-prelight.svg");
}

.documents-load-more.button {
    border-image-width: 0;
    border-width: 0;
    border-radius: 0;
}

.documents-scrolledwin.frame {
    border-width: 1px 0;
    border-radius: 0;
}

.documents-icon-bg {
    background-color: @documents_emblem_bg;
    border-radius: 4px;

    color: @theme_base_color;
}

.documents-collection-icon {
    background-color: @documents_collection_bg;
    border-radius: 8px;
}

.documents-counter {
    background-image: url('assets/dnd-counter.svg');
    background-size: contain;
    background-color: transparent;
    color: @theme_base_color;
    font: bold;
}

.documents-favorite.button *:active,
.documents-favorite.button *:active:hover {
    color: shade(@theme_selected_bg_color, 1.20);
}

.documents-entry-tag {
    background-color: @entry_tag_bg;
    color: @entry_tag_fg;

    border-radius: 4px;
    border-width: 0;

    margin: 2px;
    padding: 4px;
}

.documents-entry-tag:hover {
    background-color: shade(@entry_tag_bg, 1.10);
    color: @entry_tag_fg;
}

.documents-entry-tag.button,
.documents-entry-tag.button:hover,
.documents-entry-tag.button:active,
.documents-entry-tag.button:active:hover {
    background-color: transparent;
    background-image: none;
    border-image: none;
    border-width: 0;
}

.documents-entry-tag.button:hover {
    color: shade(@entry_tag_bg, 2.10);
}

/* baobab */

.baobab-toolbar.toolbar {
    border-style: solid;
    border-width: 0 0 1px 0;
    border-radius: 0;
}

.cell.baobab-level-cell,
.cell.baobab-level-cell:hover,
.cell.baobab-level-cell:selected,
.cell.baobab-level-cell:selected:hover {
    border-color: darker(@borders);
    border-width: 1px;
    border-radius: 3px;
    border-style: solid;
    background-color: white;
}

.cell.baobab-cell-error {
    color: @error_color;
}

.cell.baobab-cell-warning {
    color: @warning_color;
}

.cell.baobab-cell-warning:selected,
.cell.baobab-cell-error:selected {
    color: @theme_selected_fg_color;
}

.cell.baobab-cell-warning:backdrop,
.cell.baobab-cell-error:backdrop,
.cell.baobab-cell-warning:selected:backdrop,
.cell.baobab-cell-error:selected:backdrop {
    color: @theme_unfocused_text_color;
}

BaobabWindow.background GtkNotebook > GtkGrid > GtkScrolledWindow.frame {
    border-radius: 0;
    border-width: 0 1px 0 0;
}

BaobabWindow GtkInfoBar.warning,
BaobabWindow GtkInfoBar.error { 
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: @borders;
}

/* epiphany */

EphyToolbar .entry:first-child,
EphyToolbar .entry:focus:first-child,
EphyToolbar .entry:backdrop:first-child {
    border-image-width: 3px 0 4px 3px;
    border-right-width: 0;
    border-bottom-right-radius: 0;
    border-top-right-radius: 0;
    padding-left: 4px;
    padding-right: 4px;
}

EphyToolbar .entry:last-child,
EphyToolbar .entry:focus:last-child,
EphyToolbar .entry:backdrop:last-child {
    border-image-width: 3px 3px 4px 0;
    border-left-width: 0;
    border-bottom-left-radius: 0;
    border-top-left-radius: 0;
    padding-left: 4px;
    padding-right: 4px;
}

EphyToolbar .entry:focus {
    box-shadow: inset 1px 2px alpha(@theme_selected_bg_color, 0.1),
                inset 1px 1px alpha(@theme_selected_bg_color, 0.1),
                inset 0 -1px alpha(@theme_selected_bg_color, 0.2);
}

EphyToolbar .entry:focus:last-child {
    box-shadow: inset 0 2px alpha(@theme_selected_bg_color, 0.1),
                inset 0 1px alpha(@theme_selected_bg_color, 0.1),
                inset -1px -1px alpha(@theme_selected_bg_color, 0.2);
}

EphyToolbar .location-entry .button {
    color: @internal_element_color;
    -GtkButton-child-displacement-y: 0;
    border-image-source: url("borders/generic-border.png");
    border-image-slice: 3 3 4 3;
    border-image-repeat: stretch;
    border-width: 1px 1px 2px 1px;
    border-radius: 3px;
    padding-left: 4px;
    padding-right: 4px;
    box-shadow: inset 1px 0 @inset_dark_color,
                inset 0 1px @entry_inset,
                inset 0 2px alpha(@entry_inset, 0.4);
}

EphyToolbar .location-entry .button:backdrop,
EphyToolbar .location-entry .button:backdrop:first-child,
EphyToolbar .location-entry .button:backdrop:hover,
EphyToolbar .location-entry .button:backdrop:hover:first-child {
    border-image-source: url("borders/generic-border-backdrop.png");
    box-shadow: none;
    background-image: none;
    background-color: @theme_unfocused_base_color;
}

EphyToolbar .location-entry .button:last-child {
    border-image-width: 3px 3px 4px 0;
    border-left-width: 0;
    border-bottom-left-radius: 0;
    border-top-left-radius: 0;
}

EphyToolbar .location-entry .button:first-child {
    border-image-width: 3px 0 4px 3px;
    border-right-width: 0;
    border-bottom-right-radius: 0;
    border-top-right-radius: 0;
    /* flip the box-shadow division*/
    box-shadow: inset -1px 0 @inset_dark_color,
                inset 0 1px @entry_inset,
                inset 0 2px alpha(@entry_inset, 0.4);
}

EphyToolbar .location-entry .button,
EphyToolbar .location-entry .button:hover {
    icon-shadow: none;
    background-image: -gtk-gradient(linear,
                                    left top, left bottom,
                                    from(@entry_background_a),
                                    to(@entry_background_b));
}

EphyToolbar .location-entry .button:active,
EphyToolbar .location-entry .button:active:hover {
    background-image: -gtk-gradient(linear,
                                    left top, left bottom,
                                    from(shade(@entry_background_a, 0.9)),
                                    to(@entry_background_b));
}

EphyToolbar .location-entry .button:hover,
EphyToolbar .location-entry .button:active,
EphyToolbar .location-entry .button *:active {
    color: @theme_text_color;
}

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

EphyNotebook.notebook tab {
    border-width: 0;
}

EphyToolbar.toolbar .button {
    padding-left: 4px;
    padding-right: 4px;
}

#ephy-page-menu-button.active-menu {
    background-image: none;
    background-color: @menu_bg_color;

    border-image: none;
    border-color: @menu_bg_color;
    border-radius: 4px 4px 0 0;
}

EphyOverview GtkScrolledWindow {
    background-color: @theme_base_color;
}

EphyOverview GtkScrolledWindow:backdrop {
    background-color: @theme_unfocused_base_color;
}

    /* sets top and bottom borders on the overview and the main
       scrolled windows for toolbar visual division and search/downloadbar */
EphyWindow.background .documents-scrolledwin,
EphyWindow.background EphyEmbed.vertical .osd GtkScrolledWindow.frame {
    border-color: @borders;
    border-width: 1px 0;
    border-radius: 0;
}
    /* remove top and bottom borders when inside a notebook tab to
       the overview scrolled window and the main scrolled window */
EphyWindow.background EphyNotebook.notebook .documents-scrolledwin,
EphyWindow.background EphyNotebook.notebook EphyEmbed.vertical .osd GtkScrolledWindow {
    border-top-width: 0;
    border-bottom-width: 0;
}

    /* remove bottom borders from overview and main scrolled window
       when no bars at the bottom of the screen are shown */
EphyWindow.background EphyNotebook:last-child EphyEmbed.vertical .osd GtkScrolledWindow,
EphyWindow.background EphyNotebook.notebook:last-child {
    border-bottom-width: 0;
}

/* Gnome Contacts */

/* Line at top in contacts pane, similar to .documents-scrolledwin.frame */
.contacts-content.frame {
 border-width: 1px 0 0 0;
 border-radius: 0;
}

/* Background color in contacts pane, similar to .documents-main-view.view */
.contacts-main-view.view {
 background-color: #f1f2f1;
}

.contacts-suggestion {
 background-color: #434343;
 color: #ffffff;
 border-radius: 4px;
}

/* Border on the right in the left menu toolbar */
.contacts-left-toolbar.toolbar.menubar {
    border-image: linear-gradient(to bottom, @theme_bg_color, shade(@borders, 1.2));
    border-image-width: 0 1px 0 0;
    border-image-slice: 1;
}

.contacts-left-toolbar.toolbar.menubar:backdrop {
    border-image: none;
    border-color: transparent;
}

/* Sidebar with line at top and the left */
ContactsWindow .sidebar.frame {
 border-width: 1px 1px 0 0;
 border-style: solid;
 border-color: @borders;
 border-image: none;
 border-radius: 0;
 padding: 0;
}

.contacts-avatar-frame.frame {
 border-width: 1px 1px 0 1px;
 border-style: solid;
 border-color: @borders;
 border-image: none;
 border-radius: 0;
 padding: 0;
}

/* Primary toolbar with no line at top to avoid conflicts with frame border */
ContactsWindow .primary-toolbar.toolbar {
 border-width: 0 0 1px 0;
}

ContactsWindow .sidebar .view {
 background-color: #ebebeb;
}
ContactsWindow .sidebar .view:selected,
ContactsWindow .sidebar .view:selected:focus {
 background-color: @theme_selected_bg_color;
}

.contacts-button:active {
 border-color: #000000;
 border-image: none;
}

.contacts-entry {
 box-shadow: none;
 border-image: none;
 border-width: 1px;
 border-radius: 4px;
 border-style: solid;
 border-color: #bbbeb7;
 background-image: none;
 background-color: #ffffff;
}

.contacts-entry:selected,
.contacts-entry:selected:focus {
 background-color: @theme_selected_bg_color;
 color: @theme_selected_fg_color;
}

.contacts-entry.contacts-postal-entry {
 border-radius: 0 0 0 0;
 border-width: 1px 1px 0 1px;
}

.contacts-entry.contacts-postal-entry:nth-child(first) {
 border-radius: 4px 4px 0 0;
}

.contacts-entry.contacts-postal-entry:nth-child(last) {
 border-radius: 0 0 4px 4px;
 border-width: 1px;
}

.button.contacts-square {
 padding: 0px;
}

.contacts-combo .button {
 border-image: none;
 border-width: 1px;
 border-style: solid;
 border-color: #bbbeb7;
 background-image: none;
 background-color: #ffffff;
}

/* Gucharmap */
GucharmapChartable:active,
GucharmapChartable:focus,
GucharmapChartable:selected {
 background-color: @theme_selected_bg_color;
 color: @theme_selected_fg_color;
}

/* evince */
EvWindow.background > GtkBox.vertical > GtkPaned.horizontal > GtkBox.vertical > GtkScrolledWindow.frame {
    border-width: 0;
    border-radius: 0;
}

EvWindow.background EvSidebar.vertical .frame {
    border-width: 1px 0 0;
    border-radius: 0;
}

EvWindow.background EvSidebar.vertical .notebook {
    border-width: 1px 0 0;
}

EvWindow.background EvSidebarAnnotations.vertical GtkToolPalette > GtkToolItemGroup > .button { 
    border-image: none;
    border-radius: 0;
    border-style: solid;
    border-width: 0 0 1px;
    border-color: @borders;
}

EvWindow.background EvSidebar.vertical .notebook .frame {
    border-width: 0;
}

EvWindow .pane-separator, 
EvWindow .pane-separator:hover {
    border-width: 0 1px;
    border-style: solid;
    border-color: @borders;
    background-color: shade(@theme_bg_color, 0.95);
    color: @borders;
}

EvWindow.background EggFindBar.toolbar {
    border-width: 1px 0 0;
    border-style: solid;
    border-color: @borders;
}

/* gcalctool */

MathWindow.background > GtkBox.vertical > GtkBox.vertical > GtkScrolledWindow {
    padding: 4px;
    background-color: @theme_base_color;
    border-radius: 3px;
}

MathWindow.background > GtkBox.vertical > GtkBox.vertical > GtkScrolledWindow:backdrop {
    padding: 4px;    
    background-color:  @theme_unfocused_base_color;
    border-radius: 3px;
}
