/*
 * Custom styling for GPS.
 */

/* You can override the default theme colors. Most gtk+ themes are
 * carefully setup so that they do not hard-code colors, but use a number
 * of predefined named colors and shades of them. For instance:
 */
/*
   @define-color base_color black;
   @define-color bg_color #fff;
   @define-color theme_bg_color green;
*/

@define-color theme_base_color mix(@theme_bg_color, @editor_bg_color, 0.8);

@define-color inactive_items_color mix(@theme_base_color, @theme_fg_color, 0.55);
@define-color inactive_items_selected_color mix(@theme_selected_bg_color, @theme_selected_fg_color, 0.7);

@define-color error-color mix(@theme_base_color, red, 0.5);
@define-color warning-color mix(@theme_base_color, darkorange, 0.9);

@define-color entry_color_two @editor_bg_color;

@define-color button_bg_color @editor_bg_color;

@define-color gutter_color mix(@editor_fg_color, @editor_bg_color, 0.6);


/*********************
 * General
 *********************/

* {
   /* Reduce the size of the scroll arrows in notebooks */
   -GtkWidget-scroll-arrow-hlength: 8;
   -GtkWidget-scroll-arrow-vlength: 8;
   -GtkNotebook-arrow-spacing: 0;
   icon-shadow: none;
   text-shadow: none;
   box-shadow: none;
}

.view, .menu, column-header .button, GtkListBox, GtkFlowBox {
   background-color: @theme_base_color;
}

.mdi, GtkTextView.view {
   background-color: @editor_bg_color;
}

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

.entry, .entry.multiline GtkTextView.view {
   background-image: -gtk-gradient (linear,
                                   0 0, 0 0.5,
                                   from(@entry_color_one),
                                   to(@entry_color_two));
   border-color: @popup_border_color;
}

/*********************
 * Buttons and Combos
 *********************/

.button
{
   background-image: -gtk-gradient (linear,
                                   0 0, 0 0.5,
                                   from(@active_button_bg_color_two),
                                   to(@active_button_bg_color_one));
   border-width: 1px;
   border-color: @popup_border_color;
}

.gps-welcome-dialog .list-row.button, GtkTreeView > .button {
  background: transparent;
}

.button.flat
 {
   background: transparent;
   background-image: none;
   border-radius: 2px;
   border-width: 1px;
   border-color: transparent;
}

.toolbar .button {
  padding: 4px;
}

.button:link:hover {
   color: @theme_selected_bg_color;
}

.button:active, .button:checked {
   background-image: -gtk-gradient (linear,
                                   0 0, 0 0.5,
                                   from(@active_button_bg_color_one),
                                   to(@active_button_bg_color_two));
   border-color: @popup_border_color;
}

/*********************
 * Task Manager
 *********************/

.gps-task-manager GtkProgressBar {
   -GtkProgressBar-min-horizontal-bar-height: 1;
}

/*************
 * Dialogs   *
 *************/

GtkDialog > GtkBox {
   background-color: @theme_base_color;
}

GtkDialog {
   -GtkDialog-content-area-border: 0px;
   -GtkDialog-content-area-spacing: 0px;
   -GtkDialog-action-area-border: 3px;
   border-width: 0px;
}

.dialog-action-box, .dialog .buttonbox {
   background-color: @notebook_background;
   border-width: 0px;
   padding: 3px;
}

/*************
 * Menubar   *
 *************/

.menubar {
   box-shadow: none;
}

/*************
 * GUI Utils *
 *************/

.warning-label {
   color: @warning-color;
   font-style: italic;
}

.help-label {
   color: @inactive_items_color;
   font-size: x-large;
}

/********************
 * GPS dialog views *
 ********************/

.dialog-views {
   background-color: @theme_base_color;
}

/**************************
 * GPS dialog view groups *
 **************************/

.dialog-views-groups {
   box-shadow: none;
   border-width: 0;
}

.dialog-views-groups > GtkLabel {
   /* Set bold font for group titles */
   font-weight: bold;
   padding-top: 12px;
   padding-bottom: 5px;
}

.dialog-views-groups-rows {
   padding-left: 12px;
   padding-right: 12px;
}

.dialog-views-groups-rows.display_error, GtkInfoBar.display_error {
   background-color: @error-color;
}

.dialog-views-groups-rows GtkRadioButton > GtkLabel {
   padding-right: 12px;
}

.dialog-views-doc-labels {
   /* Reduce the font size for the inlined preferences documentation */
   font-size: x-small;
   color: @inactive_items_color;
   padding-top: 4px;
}

*:selected .dialog-views-doc-labels {
   /* Reduce the font size for the inlined preferences documentation */
   font-size: x-small;
   color: @inactive_items_selected_color;
}

.dialog-views-button-boxes {
   -GtkButtonBox-child-min-width: 0;
   -GtkButtonBox-child-min-height: 0;
   -GtkButtonBox-child-internal-pad-y: 0;
   -GtkButtonBox-child-internal-pad-x: 0;
}

.dialog-views-groups.with-message {
   padding-top: 12px;
   padding-bottom: 12px;
}

/*********************
 * GPS Learn View    *
 *********************/

.learn-groups {
   padding-left: 10px;
   padding-right: 10px;
}

.learn-groups > GtkLabel {
   font-weight: normal;
   color: @inactive_items_color;
   padding-top: 10px;
   padding-bottom: 10px;
}

.learn-provider-labels {
   font-weight: bold;
}

.learn-items {
   background-color: @learn-items-color;
   padding-left: 10px;
}

.learn-help .dialog-views-groups {
  padding-top: 16px;
}

/************************
 * GPS Scenario View    *
 ************************/

.scenario-variables-view .action-box GtkButton {
    padding-left: 24px;
    padding-right: 24px;
}

.scenario-variables-view .dialog-views-groups {
   padding-top: 6px;
}

/**************************
 * GPS Assistant Pages    *
 **************************/

.assistant-page-views > GtkViewport > GtkBox > .dialog-views-groups > GtkLabel {
   /* Set extra large font for assistant pages titles */
   font-weight: normal;
   font-size: x-large;
   padding-bottom: 5px;
}

.assistant-page-views .dialog-views-groups  {
   padding-top: 5px;
}

/**************************
 * GPS Welcome Dialog     *
 **************************/

.gps-welcome-dialog-logo-area {
   box-shadow: none;
   border-width: 0;
   padding-top: 20px;
   padding-left: 20px;
   padding-right: 20px;
   padding-bottom: 60px;
}

.gps-welcome-dialog GtkListBox {
    background-color: @editor_bg_color;
}

.gps-welcome-dialog GtkListBoxRow {
    padding-left: 12px;
}

.gps-welcome-dialog-main-view .button {
    background: transparent;
    border-color: transparent;
}

.gps-welcome-dialog-main-view .button:hover {
    color: @theme_selected_bg_color;
}

.gps-welcome-dialog-title {
   font-size: xx-large;
}

.gps-welcome-dialog-subtitle {
   font-size: x-large;
   color: @inactive_items_color;
}

.gps-welcome-dialog-version {
   font-weight: 100;
   font-style: italic;
   font-size: large;
   color: @tooltip-background-color;
}

/***********************
 * GPS Welcome View    *
 ***********************/

.gps-welcome-view GtkLinkButton {
   padding: 0px;
   border: 0px;
   margin: 0px;
}

.gps-welcome-view-desc {
   font-size: x-large;
   color: @inactive_items_color;
   padding-left: 12px;
   padding-bottom: 40px;
}

#gps-welcome-view-github-link {
   padding-top: 20px;
   margin-top: 20px;
}

/*********************
 * Menus
 *********************/

.window-frame {
   /* gtk+ displays a 4px semi-transparent around menus the first time they
    * are displayed. Perhaps this is a resize handle ? */
   box-shadow: none;
}

.menu .menuitem:hover {
   background: @theme_selected_bg_color;
   color: @theme_selected_fg_color;
}

.menubar {
   background: @notebook_background;
}

.menu {
  border: 2px solid mix(@theme_base_color, @mdi_border_color, 0.5);
}

.separator {
  /* Change the color of the separators to make them more visible in
     dark themes */
  color: @mdi_border_color;
}

/*********************
 * Panes
 *********************/

.pane-separator {
   background-color: @mdi_border_color;
   background-image: none;
}

/*********************
 * MDI Notebooks
 *********************/

.notebook.mdi {
   -GtkNotebook-initial-gap: 0;

   /* No space between tabs */
   -GtkNotebook-tab-overlap: 0;

   background-color: @notebook_background;
}

/***********************
 * MDI Notebook headers
 ***********************/

.notebook.mdi.header {
  border: none;
  box-shadow: none;
}

/*********************
 * MDI Notebook tabs
 *********************/


.notebook.mdi tab {
   border-width: 0px;
   border-color: @mdi_border_color;
}

.notebook.mdi tab GtkLabel {
   font-weight: normal;
   color: @inactive_items_color;
}

.notebook.mdi tab.top,
.notebook.mdi tab.bottom {
   padding: 5px 2px 5px 6px;
}

.notebook.mdi tab.left {
   padding: 2px 5px 6px 5px;
}
.notebook.mdi tab.right {
   padding: 6px 5px 2px 5px;
}

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

.notebook.mdi .active-page GtkLabel {
   color: @theme_fg_color;;
}

.notebook.mdi .mdi-highlighted-tab {
   color: @theme_selected_bg_color;
}

.notebook.mdifocused tab:active.top {
   border-top-width: 2px;
   border-top-color: @theme_selected_bg_color;
}

.notebook.mdifocused tab:active.left {
   border-left-width: 2px;
   border-left-color: @theme_selected_bg_color;
}

.notebook.mdifocused tab:active.right {
   border-right-width: 2px;
   border-right-color: @theme_selected_bg_color;
}

.notebook.mdifocused tab:active.bottom {
   border-bottom-width: 2px;
   border-bottom-color: @theme_selected_bg_color;
}

/**********************
 * Scrollbars
 **********************/

.scrollbar {
   border-width: 0px;
   -GtkRange-slider-width: 8px;
   background-color: @theme_base_color;
}

.scrollbar.slider {
   background-color: @scrollbar_slider_color;
}

/***************************
 * Toolbars and Button Boxes
 ***************************/

.toolbar {
   background: @notebook_background;
}

/* Let's condense things in the local toolbars of the views */
.gps-local-toolbar {
   background: @theme_base_color;
   padding: 0px;
}

.gps-local-toolbar * {
   margin: 0px;
   padding: 2px;
}

.gps-editor-status-bar GtkButton {
   padding: 0px 2px;
}
.gps-editor-status-bar > * {
   margin: 0px;
   padding: 0px;
}

.gps-switches-editor GtkScrolledWindow {
   background: @theme_base_color;
}

/**********************************
 * Browsers
 **********************************/

.gps_browser_decoration {
  background-color: @browser_decoration_background;
  color: @browser_decoration_color;
}

/**********************************
 * Tooltips, Completion
 **********************************/

.tooltip, .completion {
   color: @tooltip-text-color;
   text-shadow: none;
   margin: 0;
   border-radius: 0;
   border: 1px solid @popup_border_color;
}

.tooltip.background, .completion {
   background-color: @tooltip-background-color;
}

.tooltip * {
   padding: 12px;
}

.completion.notes > .frame {
   border: 1px solid @popup_border_color;
}

.completion.notes > .frame * {
   padding: 3px;
   border-width: 0px;
}

.completion.search .help-label {
   font-size: xx-large;
}

.completion.search GtkFrame {
   background-color: @theme_base_color;
   box-shadow: none;
   border-width: 0;
}

.completion.search GtkTreeView column:first-child {
   background-color: @notebook_background;
}

.completion.search GtkTreeView column:first-child:selected {
   background-color: @theme_selected_bg_color;
}

.completion.search GtkTreeView column:first-child * {
   color: @inactive_items_color;
}

.completion.search GtkTreeView column:first-child:selected * {
   color: @inactive_items_selected_color;
}

/**********************************
 * Editors
 **********************************/

GtkTextView.view.editor {
  background-color: @editor_bg_color;
  color: @editor_fg_color;
}

GtkTextView.view.editor.readonly {
  background-color: @editor_readonly_bg_color;
}

.gps_gutter {
  background-color: @editor_bg_color;
  color: @gutter_color;
}

/**********************************
 * Selection
 **********************************/

*:selected, GtkTextView.view:selected, GtkTextView.view.editor:selected,
.list-row.button:selected {
  background-color: @theme_selected_bg_color;
  color: @theme_selected_fg_color;
}

/*
 * Editors
 * Control the color of links displayed in the status bar of editors
 */
/*
-GtkWidget-link-color: @link_color;
-GtkWidget-visited-link-color: @link_color;
*/

/**
 * An example on how to redefine left and right keys so that they navigate
 * up and down in the tree views (instead of just left and right between
 * columns). The best here is to use the default up and down keys though.
 * See also the treemove.py plug-in.
 */

/*
@binding-set gtk-gps-tree-view {
   bind "Right" { "move-cursor" (display-lines, 1) };
   bind "Left" { "move-cursor" (display-lines, -1) };
}
GtkTreeView { gtk-key-bindings: gtk-gps-tree-view; }
*/
