/* Copyright 2015 Sam Hewitt.
*
* This file is part of the Paper GTK theme.
*
* The Paper GTK theme is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* The Paper GTK theme is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with the Paper GTK theme. If not, see http://www.gnu.org/licenses/.
*/

@define-color toolbar @header;
@define-color backdrop_toolbar @backdrop_header;
@define-color toolbar_text @header_text;
@define-color backdrop_toolbar_text alpha(@toolbar_text, 0.7);
@define-color insensitive_toolbar_text alpha(@toolbar_text, 0.5);



/***********
 * Toolbar *
 ***********/

/* Main Colors*/
.toolbar {
    padding: 0px;
    color: @toolbar_text;
    background-color: @toolbar;
    box-shadow: inset 0 -1px 2px -1px alpha(#000, 0.4);
}

.toolbar:insensitive {
    color: @insensitive_toolbar_text;
    background-color: @background;
    box-shadow: none;
}

.toolbar:backdrop {
    color: @backdrop_toolbar_text;
    background-color: @backdrop_toolbar;
    box-shadow: none;
    -gtk-image-effect: dim;
}

/* Menubar */
.toolbar .menubar {
    padding: 0px;
}

/* Buttons */
.toolbar .button,
.toolbar .text-button,
.toolbar .image-button {
    border: none;
    background: none;
    color: @toolbar_text;
    border-radius: 0px;
    padding: 13px;
}

.toolbar .button:active
.toolbar .text-button:active,
.toolbar .image-button:active {
    border: none;
    color: @toolbar_text;
    box-shadow: inset 0 -2px 0 0 @toolbar_text;
    padding: 13px;
}

.toolbar .button .raised
.toolbar .text-button .raised,
.toolbar .image-button .raised {
    border: none;
    color: @toolbar_text;
    box-shadow: inset 0 -2px 0 0 @toolbar_text;
    padding: 13px;
}

/* Hover */
.toolbar .button:hover,
.toolbar .button:active:hover
.toolbar .text-button:hover,
.toolbar .text-button:active:hover,
.toolbar .image-button:hover,
.toolbar .image-button:active:hover,
.toolbar .button:focus,
.toolbar .button:active:focus
.toolbar .text-button:focus,
.toolbar .text-button:active:focus,
.toolbar .image-button:focus,
.toolbar .image-button:active:focus {
    padding: 13px;
    border: none;
    background-color: alpha(#000, 0.1);
    color: @toolbar_text;
    box-shadow: inset 0 -2px 0 0 @toolbar_text;
}

/* Insensitive */
.toolbar .button:insensitive,
.toolbar .text-button:insensitive,
.toolbar .image-button:insensitive {
    background: none;
    color: @insensitive_header_text;
    -gtk-image-effect: dim;
}


/* Backdrop */
.toolbar .button:backdrop,
.toolbar .button:active:backdrop
.toolbar .text-button:backdrop,
.toolbar .text-button:active:backdrop,
.toolbar .image-button:backdrop,
.toolbar .image-button:active:backdrop {
    background: none;
    color: @backdrop_toolbar_text;
    border: none;
    padding: 13px;
}

/* Insensitive:Backdrop; */
.toolbar .button:insensitive:backdrop,
.toolbar .text-button:insensitive:backdrop,
.toolbar .image-button:insensitive:backdrop {
    padding: 13px;
    border: none;
    color: mix(@backdrop_toolbar_text, @insensitive_toolbar_text, 0.5);
}


/* Entry */
.toolbar .entry {
    border: none;
    border-radius: 0px;
    background-color:@toolbar;
    color: @toolbar_text
}

.toolbar .entry GtkImage,
.toolbar .entry GtkImage:focus {
    color: @toolbar_text
}

.toolbar .entry:focus {
    color: @toolbar_text;
    border: solid @insensitive_toolbar_text;
    border-bottom-width: 1px;
}

.toolbar .entry:insensitive {
    border: none;
    background-color:@insensitive_base;
    color: @insensitive_toolbar_text;
    border: solid @insensitive_toolbar_text;
    border-bottom-width: 1px;
}

.toolbar .entry:backdrop {
    border: none;
    background-color:@backdrop_base;
    color: @backdrop_toolbar_text;
    border: solid @backdrop_toolbar_text;
    border-bottom-width: 1px;
}

/* Images */
.toolbar GtkImage,
.toolbar .button GtkImage {
    color: @toolbar_text;
}

.toolbar .button:active GtkImage,
.toolbar .button:focus GtkImage,
.toolbar .button:hover GtkImage {
    color: @toolbar_text;
}

.toolbar .button:backdrop GtkImage,
.toolbar .button:backdrop:hover GtkImage,
.toolbar .button:active:backdrop GtkImage {
    color: @backdrop_toolbar_text;
    -gtk-image-effect: dim;
}

.toolbar .button:insensitive GtkImage {
    color: @insensitive_toolbar_text;
    -gtk-image-effect: dim;
}

.toolbar .button:insensitive:backdrop GtkImage {
    color: mix(@backdrop_toolbar_text, @insensitive_toolbar_text, 0.5);
    -gtk-image-effect: dim;
}

/* Labels */
.toolbar GtkLabel,
.toolbar .button GtkLabel {
    color: @toolbar_text;
}

.toolbar .button:active GtkLabel,
.toolbar .button:focus GtkLabel,
.toolbar .button:hover GtkLabel {
    color: @toolbar_text;
}

.toolbar .button:backdrop GtkLabel,
.toolbar .button:backdrop:hover GtkLabel,
.toolbar .button:active:backdrop GtkLabel {
    color: @backdrop_toolbar_text;
}

.toolbar .button:insensitive GtkLabel {
    color: @insensitive_toolbar_text;
}

.toolbar .button:insensitive:backdrop GtkLabel {
    color: mix(@backdrop_toolbar_text, @insensitive_toolbar_text, 0.5);
}

/*******************
 * Primary Toolbar *
 *******************/

/* Normal */
.primary-toolbar .toolbar {
    padding: 0px;
    background-color: @toolbar;
    box-shadow: inset 0 -3px 3px -4px alpha(#000, 0.7);
}

/* Backdrop */
.primary-toolbar .toolbar:backdrop {
    padding-top: 0px;
    padding-bottom: 0px;
    padding-left: 4px;
    padding-right: 4px;
    background-color: @backdrop_toolbar;
    border: none;
    box-shadow: none;
    -gtk-image-effect: dim;
}


/* Buttons */

.primary-toolbar GtkComboBox,
.primary-toolbar .button,
.primary-toolbar .button.text-button,
.primary-toolbar .button.image-button, 
.primary-toolbar .button.image-button GtkImage {
    border: none;
    color: @toolbar_text;
    box-shadow: none;
}

/* Buttons Active */
.primary-toolbar GtkComboBox:active,
.primary-toolbar GtkComboBox:focus,
.primary-toolbar .button:active,
.primary-toolbar .button.image-button:active {
}

/* Button separator */
.primary-toolbar .separator,
.primary-toolbar .button .separator,
.primary-toolbar .button.separator {
    color: @insensitive_separator;
}

/* Hover buttons */
.primary-toolbar .button:hover,
.primary-toolbar .button:active:hover {
    background-color: alpha(#000, 0.1);
    box-shadow: none;
}

/* Insensitive buttons */
.primary-toolbar .button:insensitive,
.primary-toolbar .button:active:insensitive {
}

.primary-toolbar .separator:insensitive,
.primary-toolbar .button .separator:insensitive,
.primary-toolbar .button.separator:insensitive {
    color: @insensitive_separator;
}

/* backdrop buttons */
.primary-toolbar .button:backdrop,
.primary-toolbar .button:active:backdrop {
}

.primary-toolbar .separator:backdrop,
.primary-toolbar .button .separator:backdrop,
.primary-toolbar .button.separator:backdrop {
    color: @backdrop_separator;
}
/* Images */
.primary-toolbar GtkImage,
.primary-toolbar .button GtkImage,
.primary-toolbar .button GtkImage:active,
.primary-toolbar .button GtkImage:focus,
.primary-toolbar .button GtkImage:hover {
    color: @toolbar_text;
}

.primary-toolbar .button GtkImage:active:backdrop,
.primary-toolbar GtkImage:backdrop,
.primary-toolbar .button GtkImage:backdrop,
.primary-toolbar .button GtkImage:backdrop:hover {
    color: @backdrop_toolbar_text;
    -gtk-image-effect: dim;
}

.primary-toolbar GtkImage:insensitive,
.primary-toolbar .button GtkImage:insensitive {
    color: @insensitive_toolbar_text;
    -gtk-image-effect: dim;
}

/*********************
* Secondary Toolbars *
*********************/

.secondary-toolbar.toolbar {
    padding: 2px;
    background-color: @background;
    box-shadow: none;
}

.secondary-toolbar.toolbar:backdrop {
    background-color: @backdrop_background;
    border-color: @backdrop_border;
    color: @backdrop_text;
    -gtk-image-effect: dim;
}

.secondary-toolbar.toolbar .linked-button,
.secondary-toolbar.toolbar .button {
    padding: 2px;
}

/********************
 * Menubar Toolbars *
 ********************/
.toolbar.menubar {
    -GtkToolbar-button-relief: normal;
}


/******************
* Bottom Toolbars *
******************/

.bottom-toolbar.toolbar {
    padding: 0px;
    border: solid @border;
    background-image: linear-gradient(to bottom,
                                  shade(@gradient_a, 0.96),
                                  shade(@gradient_b, 0.96)
                                  );
}

.bottom-toolbar.toolbar .button {
    padding: 2px 3px 2px 3px;
}