/*
  TODO:
  Look into compiling resources with glib-compile-resource etc. for 
  inclusion in templates
*/

@define-color dark_bg #333;
@define-color light_editor_bg #EDEDED;

@binding-set window-bindings {
  bind "<ctl>n" { "new-file" () };
  bind "<ctl>o" { "open-file" () };
  bind "<ctl>s" { "save-file" () };
  bind "<ctl><shift>s" { "save-file-as" () };
  bind "<ctl>d" { "toggle-focusmode" () };
  bind "<ctl>p" { "toggle-preview" () };
  bind "<ctl>w" { "close-window" () };
  bind "<ctl>f" { "toggle-search" () };
  bind "<ctl><shift>r" { "toggle-search-replace" () };
  bind "<ctl><shift>f" { "toggle-search-replace" () };
  bind "F11" { "toggle-fullscreen" () };
  bind "F7" { "toggle-spellcheck" () };
}

@binding-set editor-bindings {
  bind "<ctl>i" { "insert-italic" () };
  bind "<ctl>b" { "insert-bold" () };
  bind "<ctl>r" { "insert-hrule" () };
  bind "<ctl>u" { "insert-ulistitem" () };
  bind "<ctl>h" { "insert-heading" () };
  bind "<ctl>z" { "undo" () };
  bind "<ctl>y" { "redo" () };
  bind "<ctl><shift>d" { "insert-strikeout" () };
  /*bind "<ctl>t" { "insert-at-cursor" ('[ ] ') };*/
  bind "<ctl><shift>z" { "redo" () };
}

.uberwriter_window {
  gtk-key-bindings: window-bindings;
  /*border-radius: 7px 7px 3px 3px;*/
  background: @light_editor_bg;
}

.uberwriter_window.small .uberwriter-editor {
  font: Inconsolata 12;
}
.uberwriter_window GtkGrid {
  background-color: @light_editor_bg;
}

.uberwriter_window.dark_mode GtkGrid, 
.uberwriter_window.dark_mode GtkScrolledWindow {
  background-color: @dark_bg;
}

#UberwriterWindow.medium .uberwriter-editor {
  font: Inconsolata 15;
}

#UberwriterWindow.large .uberwriter-editor {
  font: Inconsolata 17;
}

#UberwriterWindow GtkAlignment {
  margin-top: 30px;
  margin-bottom: 60px;
}

.uberwriter_window.dark_mode {
  background: #333;
}

.uberwriter_window.dark_mode .uberwriter-editor {
  color: #CCC;
  background: @dark_bg;

  -GtkWidget-cursor-color: shade(#4D9FCE, 0.9);
}

.scrollbars-junction,
.scrollbar.trough {
  background: transparent;
}

.uberwriter-editor {
  border: none;
  background-color: transparent;
  color: #222;
  -GtkWidget-cursor-color: shade(#4D9FCE, 0.9);
  -GtkWidget-cursor-aspect-ratio: 0.1;
  gtk-key-bindings: editor-bindings;
}

.uberwriter-editor:selected {
  background-color: #4D9FCE;
  color: #FFF;
}

.uberwriter-editor GtkButton {
  margin: 0;
  padding: 0;
  /*background: #CCC;*/
}

.uberwriter-editor GtkToolbar {
  /*background: transparent;*/
  border: none;
  padding: 0;
}


.status_bar_box GtkLabel {
  color: #666;
}

.status_bar_box GtkButton {
  /* finding reset */
  background-color: initial;
  text-shadow: inherit;
  icon-shadow: inherit;
  box-shadow: initial;
  background-clip: initial;
  background-origin: initial;
  background-size: initial;
  background-position: initial;
  background-repeat: initial;
  background-image: initial;
  border-image-source: initial;
  border-image-repeat: initial;
  border-image-slice: initial;
  border-image-width: initial;

  border-style: none;
  -GtkButton-images: true;
  border-radius: 2px;
  color: #666;
  padding: 3px 5px;
  
  -GtkButton-child-displacement-y: 0px;
  -GtkButton-child-displacement-x: 0px; 
  -GtkButton-default-border: 0;
  -GtkButton-image-spacing: 5px;
  -GtkButton-interior-focus: false;
  -GtkButton-inner-border: 0;
  transition: 500ms ease-in;
}

.status_bar_box GtkButton:hover,
.status_bar_box GtkButton:active:hover {
  transition: 0s ease-in;
  color: #333;
  background: #EEE;
}

.status_bar_box GtkButton:active {
  color: #EEE;
  background-color: #EEE;
  background-image: none;
  box-shadow: 0 0 2px rgba(0,0,0,0.4)
}
.dark_mode .status_bar_box GtkButton {

}
.dark_mode .status_bar_box GtkButton:hover,
.dark_mode .status_bar_box GtkButton:active {
  background-color: shade(@dark_bg, 0.8);
}

.status_bar_box GtkSeparator {
  border-color: #999;
  border-right: none;
}

#PreviewMenuItem GtkImage {
  border-radius: 2px;
  color: #666;
  padding: 3px 5px;
  border: none;
  background: #FFF;
}

#UberwriterWindow GtkTreeView {
  color: #333;
  font-size: 10px;
}

#LexikonBubble {
  font: serif 12;
  background: #FFF;
  border-radius: 4px;
  margin: 5px;
  padding: 5px;
}

#QuickPreviewPopup {
  padding: 5px;
  margin: 5px;
  border: 1px solid #333;
  /*background: #FFF;*/
  border-radius: 3px;
}

#LexikonBubble GtkLabel {
  /*padding: 5px;*/
}

#LexikonBubble {
   border: 5px solid #FFF;
}

#LexikonBubble .lexikon_heading {
  font: serif 12;
  padding-bottom: 5px;
  padding-top: 5px;
  font-weight: bold;
  padding-left: 10px;
}

#LexikonBubble .lexikon_num {
  padding-right: 5px;
  padding-left: 20px;
}

#UberwriterWindow #AutoCorrect {
  padding: 10px;
  background: #FFF;
  /*box-shadow: 0 0 5px #000;*/
  border: 1px solid #BCD1EB;
  border-radius: 3px 10px 10px 3px;
  color: #333;
}

#UberwriterWindow #AutoCorrect GtkLabel {
  padding: 3px 5px;
  font: sans-serif;
}

#UberwriterWindow #AutoCorrect GtkImage {
  padding: 3px 5px;
}
