/* On-screen Keyboard */

$keyboard_hover_bg_color: if($variant == 'light', darken($keyboard_bg_color, 10%), lighten($keyboard_bg_color, 10%));
$keyboard_active_bg_color: if($variant == 'light', darken($keyboard_bg_color, 20%), lighten($keyboard_bg_color, 20%));

// draw keys using button function
#keyboard {
  background-color: rgba(black, 0.85);
  border: none;
  border-top-width: 0;
  box-shadow: none;

  .page-indicator {
    padding: $container_padding;

    .page-indicator-icon {
      width: 8px;
      height: 8px;
    }
  }
}

// the container for individual keys
.key-container {
  padding: $container_margin;
  spacing: $container_margin;
}

// the keys
.keyboard-key {
  min-height: 2em;
  min-width: 2em;
  font-size: 14pt;
  font-weight: bold;
  border-radius: $buttons_radius;
  border: none;
  color: inherit;
  background-color: $keyboard_bg_color;
  box-shadow: 0 1px rgba($black, 0.2);

  &:focus, &:hover { color: $fg_color; background-color: $keyboard_hover_bg_color; }
  &:checked, &:active { color: $fg_color; background-color: $keyboard_active_bg_color; }

  &:grayed { //FIXME
    background-color: $alt_dark_bg_color;
    color: $inverse_fg_color;
    border-color: $alt_dark_bg_color;
  }

  &.default-key {
    background-color: $alt_keyboard_bg_color;
    box-shadow: 0 1px rgba($black, 0.2);
    &:focus, &:hover { color: $button_fg_color; background-color: $keyboard_bg_color; }
    &:checked, &:active { color: $button_fg_color; background-color: darken($keyboard_bg_color, 6%); }
  }

  &.enter-key {
    background-color: $primary_color;
    color: $inverse_fg_color;

    &:focus, &:hover { color: $inverse_fg_color; background-color: lighten($primary_color, 5%); }
    &:checked, &:active { color: $inverse_fg_color; background-color: darken($primary_color, 10%); }
  }

  &.shift-key-uppercase { color: $primary_color }

  StIcon { icon-size: 1.125em; }
}

// long press on a key popup
.keyboard-subkeys {
  color: inherit;
  -arrow-border-radius: $buttons_radius;
  -arrow-background-color: rgba(black, 0.45);
  -arrow-border-width: 0;
  -arrow-border-color: transparent;
  -arrow-base: 20px;
  -arrow-rise: 10px;
  -boxpointer-gap: 5px;
  box-shadow: $shadow_2;
}

// emoji
.emoji-page {
  .keyboard-key {
    background-color: transparent;
    border: none;
    color: initial;
  }
}

.emoji-panel {
  .keyboard-key:latched {
    border-color: lighten($primary_color, 5%);
    background-color: $primary_color;
  }
}

// suggestions
.word-suggestions {
  font-size: 14pt;
  spacing: 12px;
  min-height: 20pt;
}
