/* On-screen Keyboard */

$key_size: 1.2em;
$key_border_radius: $bt_radius;
$key_bg_color: $bg_color;
$default_key_bg_color: if($variant=='light', darken($bg_color, 8%), lighten($bg_color, 5%));

// draw keys using button function
#keyboard {
  background-color: transparentize(if($variant=='light', darken($bg_color, 5%), darken($bg_color, 8%)), 0.1);
  box-shadow: inset 0 1px 0 0 $borders_color;

  .page-indicator {
    padding: 6px;

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

// the container for individual keys
.key-container {
  padding: 4px;
  spacing: 4px;
}

// the keys
.keyboard-key {
  @include button(normal, $c:$key_bg_color);

  &:focus { @include button(focus); }
  &:hover, &:checked { @include button(hover, $c: $key_bg_color); }
  &:active { @include button(active, $c: $key_bg_color); }

  @include fontsize($font-size + 5);
  min-height: $key_size;
  min-width: $key_size;
  border-width: 1px;
  border-style: solid;
  border-radius: $key_border_radius;

  &:grayed { //FIXMEy
    background-color: darken($bg_color, 3%);
    color: $osd_fg_color;
    border-color: $osd_borders_color;
  }

  // non-character keys
  &.default-key {
    @include button(normal, $c:$default_key_bg_color);
    &:hover, &:checked { @include button(hover, $c: $default_key_bg_color); }
    &:active { @include button(active, $c: $default_key_bg_color); }
  }

  // enter key is suggested-action
  &.enter-key {
    @include button(normal, $c:$selected_bg_color, $tc:$selected_fg_color);
    &:hover, &:checked { @include button(hover, $c: lighten($selected_bg_color, 3%), $tc:$selected_fg_color);}
    &:active {@include button(active, $c: darken($selected_bg_color, 2%), $tc:$selected_fg_color);}
  }

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

  StIcon { icon-size: 1.125em; }
}

// long press on a key popup
.keyboard-subkeys {
  color: $fg_color;
  -arrow-border-radius: 2px;
  -arrow-background-color: $base_color;
  -arrow-border-width: 1px;
  -arrow-border-color: $borders_color;
  -arrow-base: 20px;
  -arrow-rise: 10px;
  -boxpointer-gap: 6px;

  .keyboard-key {
    @include button(normal, $c:$key_bg_color);

    &:focus { @include button(focus);}
    &:hover, &:checked { @include button(hover, $c: $key_bg_color);}
    &:active { @include button(active, $c: $key_bg_color); }

    border-radius: 3px;
  }
}

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

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

// suggestions
.word-suggestions {
  @include fontsize($font-size + 3);
  spacing: 12px;
  min-height: 20pt;
}
