/*!
 * 
 *   simple-keyboard v2.32.56
 *   https://github.com/hodgef/simple-keyboard
 * 
 *   Copyright (c) Francisco Hodge (https://github.com/hodgef)
 * 
 *   This source code is licensed under the MIT license found in the
 *   LICENSE file in the root directory of this source tree.
 *   
 */
.hg-theme-default {
  width: 100%;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  box-sizing: border-box;
  overflow: hidden;
  touch-action: manipulation;
}

body.resizing-keyboard {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.hg-theme-default .hg-button span {
  pointer-events: none;
}

.hg-theme-default button.hg-button {
  border-width: 0;
  outline: 0;
  font-size: inherit;
}

.hg-theme-default {
  font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue",
    Helvetica, Arial, "Lucida Grande", sans-serif;
  background-color: #ececec;
  padding: 5px;
  border-radius: 5px;
}

.hg-theme-default .hg-button {
  display: inline-block;
  flex-grow: 1;
}

.hg-theme-default .hg-row {
  display: flex;
}

.hg-theme-default .hg-row:not(:last-child) {
  margin-bottom: 5px;
}

.hg-theme-default .hg-row .hg-button-container,
.hg-theme-default .hg-row .hg-button:not(:last-child) {
  margin-right: 5px;
}

.hg-theme-default .hg-row>div:last-child {
  margin-right: 0;
}

.hg-theme-default .hg-row .hg-button-container {
  display: flex;
}

.hg-theme-default .hg-button {
  box-shadow: 0 0 3px -1px rgba(0, 0, 0, 0.3);
  height: 40px;
  border-radius: 5px;
  box-sizing: border-box;
  padding: 5px;
  background: #fff;
  border-bottom: 1px solid #b5b5b5;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

.hg-theme-default .hg-button.hg-activeButton {
  background: #efefef;
}

.hg-theme-default.hg-layout-numeric .hg-button {
  width: 33.3%;
  height: 60px;
  align-items: center;
  display: flex;
  justify-content: center;
}

.hg-theme-default .hg-button.hg-button-numpadadd,
.hg-theme-default .hg-button.hg-button-numpadenter {
  height: 85px;
}

.hg-theme-default .hg-button.hg-button-numpad0 {
  width: 105px;
}

.hg-theme-default .hg-button.hg-button-com {
  max-width: 85px;
}

.hg-theme-default .hg-button.hg-standardBtn.hg-button-at {
  max-width: 45px;
}

.hg-theme-default .hg-button.hg-selectedButton {
  background: rgba(5, 25, 70, 0.53);
  color: #fff;
}

.hg-theme-default .hg-button.hg-standardBtn[data-skbtn=".com"] {
  max-width: 82px;
}

.hg-theme-default .hg-button.hg-standardBtn[data-skbtn="@"] {
  max-width: 60px;
}

/* Dark Mode Styles for Simple Keyboard */
body.dark-mode .hg-theme-default {
  background-color: #2a2a2a;
}

body.dark-mode .hg-theme-default .hg-button {
  background: #404040;
  border-bottom: 1px solid #555;
  color: #f1f1f1;
  box-shadow: 0 0 3px -1px rgba(255, 255, 255, 0.1);
}

body.dark-mode .hg-theme-default .hg-button.hg-activeButton {
  background: #505050;
}

body.dark-mode .hg-theme-default .hg-button.hg-selectedButton {
  background: rgba(129, 199, 132, 0.6);
  color: #fff;
}

body.dark-mode .hg-theme-default .hg-button:hover {
  background: #4a4a4a;
}

/* Custom Keyboard Hiding Styles */
#keyboard-wrapper {
  /* This wrapper contains the keyboard and our custom controls */
  position: relative;
}

.keyboard-hide-button-container {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 1; /* Ensure it's above the keyboard library's elements */
}

.keyboard-hide-button {
  width: 24px;
  height: 24px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23333'%3E%3Cpath d='M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.keyboard-hide-button:hover {
  opacity: 1;
}

body.dark-mode .keyboard-hide-button {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f1f1f1'%3E%3Cpath d='M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z'/%3E%3C/svg%3E");
}

#keyboard-restore-icon {
  position: fixed;
  bottom: 10px;
  right: 10px;
  width: 50px;
  height: 50px;
  background-color: rgba(0, 0, 0, 0.6);
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  z-index: 100003; /* Higher than menu trigger */
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  transition: transform 0.2s;
}

#keyboard-restore-icon:hover {
    transform: scale(1.1);
}

#keyboard-restore-icon::before {
  content: '';
  display: block;
  width: 28px;
  height: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 0 24 24' width='24px' fill='%23FFFFFF'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath d='M20 5H4c-1.1 0-1.99.9-1.99 2L2 17c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm-9 3h2v2h-2V8zm0 3h2v2h-2v-2zM8 8h2v2H8V8zm0 3h2v2H8v-2zm-1 2H5v-2h2v2zm0-3H5V8h2v2zm9 7H8v-2h8v2zm-1-4h-2v-2h2v2zm0-3h-2V8h2v2zm3 3h-2v-2h2v2zm0-3h-2V8h2v2z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

#keyboard-wrapper.keyboard-minimized {
  display: none !important;
}
