/*********
 * Tilix *
 *********/
overlay > revealer {
  &.left > scrolledwindow.frame,
  &.right > scrolledwindow.frame {
    border-style: none;
    box-shadow: $shadow_4;
  }

  &.left > scrolledwindow.frame { margin-right: 32px; }

  &.right > scrolledwindow.frame { margin-left: 32px; }
}

.terminix-session-sidebar, // for backward compatibility
.tilix-session-sidebar { background-image: image($popup_bg_color); }

.terminal-titlebar button { border-radius: 0; }

button.image-button.session-new-button { min-width: $medium_size - 4px; }


/**************
 * Terminator *
 **************/
.terminator-terminal-window {
  paned > separator { background-color: $bg_color; }

  // this should be fixed by the upstream
  notebook.frame { border-style: none; }
}


/***********
 * Eclipse *
 ***********/
window.background > box.vertical > scrolledwindow > widget toolbar {
  padding: 2px;

  separator,
  button { margin: 2px; }

  button { border-radius: $material_radius; }
}


/************
 * Chromium *
 ************/
window.background.chromium {
  background-color: if($variant == 'light', $bg_color, $popup_bg_color);

  // FIXME: no way to change the toolbar button colors only
  // toolbar button { color: $secondary_fg_color; }

  // toolbar's border-bottom refers to button's border
  entry,
  > button:not(.suggested-action):not(.destructive-action) { border: 1px solid $alt_border_color; }

  > button {
    box-shadow: none;
    background-size: auto;

    &:hover { background-image: image($row_fill_color); }

    &:active { background-image: image($semi_fill_color); }
  }

  // workaround for headerbar's non-animatable buttons
  headerbar button:active { background-size: 1000% 1000%; }

  spinner { color: $primary_color; }

  // entry uses this as well
  textview { background-color: $popup_bg_color; }
}

tooltip.background.chromium { background-color: rgba($tooltip_bg_color, 1); }


/***********
 * Firefox *
 ***********/
window.background:not(.csd) {
  > widget {
    // for the bookmark toolbar's separators
    > separator { color: $alt_border_color; }

    // avoid black border
    > scrollbar { background-clip: border-box; }

    // emphasize borders color
    > scrollbar,
    > frame > border { border-color: $alt_border_color; }

    > entry,
    > button > button {
      border: 1px solid $alt_border_color;
      border-radius: $material_radius + 1px;
      box-shadow: none;
    }

    > entry {
      min-height: 32px - 2px;

      &:focus { border-color: $primary_color; }
    }

    > button > button {
      padding: 4px 8px;
      background-size: auto;
      // color: $fg_color;

      &:hover { background-image: image($row_fill_color); }

      &:active { background-image: image($semi_fill_color); }
    }

    // use 16px assets for hard-coded sizing
    > checkbutton > check { @extend %small_check; }

    > radiobutton > radio { @extend %small_radio; }

    // make check/radio visible regardless of whether the background is bright or dark
    > checkbutton > check:not(:checked),
    > radiobutton > radio:not(:checked) {
      color: $grey_600;

      &:hover, &:active { color: $grey_900; }

      &:disabled { color: rgba($grey_600, 0.5); }
    }
  }

  // remove ugly border around the menus
  > window > menu,
  > menu > menu { border: none; }
}

// Firefox now uses this for selected items
text:selected { @extend %selected_items; }

// for backward compatibility
window.background:not(.csd) {
  > widget {
    > menubar {
      color: $titlebar_secondary_fg_color;

      &:hover { color: $titlebar_fg_color; }

      &:disabled { color: $titlebar_disabled_secondary_fg_color; }
    }

    > frame { color: $alt_border_color; }

    > checkbutton > check,
    > radiobutton > radio {
      margin: 0;
      padding: 0;
    }
  }

  > window.background > menu > separator { color: $border_color; }
}


/************
 * Inkscape *
 ************/
#ToolboxCommon {
  > #AuxToolbox {
    #StyleSwatch { font-size: smaller; }

    #Kludge { padding: 0; }

    spinbutton,
    entry { min-height: 32px; }

    button:not(.up):not(.down) {
      min-height: 24px;
      min-width: 16px;
      padding: 4px 8px;
      border-radius: $material_radius;
      -gtk-outline-radius: $material_radius;
    }

    spinbutton button { border-width: 4px; }
  }

  > toolbar.vertical {
    margin-top: -4px;

    button {
      min-height: 24px;
      min-width: 24px;
      padding: 4px;
      border-radius: $material_radius;
      -gtk-outline-radius: $material_radius;
    }
  }
}

#CanvasTable {
  button {
    min-height: 16px;
    min-width: 16px;
    padding: 0;
  }

  #HorizontalScrollbar { border-top: 1px solid $border_color; }

  #VerticalScrollbar {
    &:dir(ltr) { border-left: 1px solid $border_color; }

    &:dir(rtl) { border-right: 1px solid $border_color; }
  }
}

#Canvas_and_Dock {
  frame > border { border: none; }

  // each canvases' titlebar
  widget > widget {
    > button.flat {
      min-height: 16px;
      min-width: 16px;
      padding: 4px;
    }

    > box.horizontal image { padding: 4px; }
  }

  // vertical dock buttons
  box.horizontal > box.vertical > button.flat {
    min-height: 16px;
    min-width: 24px;
    padding: 8px 4px;
  }
}


/***********
 * Synapse *
 ***********/
box.vertical > widget > widget:selected { background-color: $primary_color; }
