/* Virtual Keyboard Styles - Dark Theme for POS */

.virtual-keyboard-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transform: translateY(100%);
    transition: transform 0.25s ease-out, opacity 0.25s ease-out;
}

.virtual-keyboard-wrapper.visible {
    pointer-events: auto;
    opacity: 1;
    transform: translateY(0);
}

.virtual-keyboard-container {
    background: #1e293b;
    border-top: 1px solid #334155;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    padding: 0;
}

.virtual-keyboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    border-bottom: 1px solid #334155;
    background: #0f172a;
}

.virtual-keyboard-input-label {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
}

.virtual-keyboard-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #334155;
    border: none;
    border-radius: 8px;
    color: #94a3b8;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.virtual-keyboard-close:hover {
    background: #475569;
    color: #fff;
}

/* Override simple-keyboard default theme - use !important to override inline and library styles */
.hg-theme-default.simple-keyboard {
    background: #1e293b !important;
    padding: 12px !important;
    border-radius: 0 !important;
    border: none !important;
}

.hg-theme-default .hg-button {
    background: #334155 !important;
    color: #f1f5f9 !important;
    border: none !important;
    border-bottom: none !important;
    border-radius: 8px !important;
    height: 52px !important;
    font-size: 18px !important;
    font-weight: 500 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

.hg-theme-default .hg-button:active,
.hg-theme-default .hg-button:hover {
    background: #475569 !important;
}

.hg-theme-default .hg-button.hg-activeButton {
    background: #475569 !important;
}

.hg-theme-default .hg-button[data-skbtn="{bksp}"],
.hg-theme-default .hg-button[data-skbtn="{shift}"],
.hg-theme-default .hg-button[data-skbtn="{enter}"] {
    background: #635bff !important;
    color: #fff !important;
}

.hg-theme-default .hg-button[data-skbtn="{bksp}"]:active,
.hg-theme-default .hg-button[data-skbtn="{bksp}"]:hover,
.hg-theme-default .hg-button[data-skbtn="{shift}"]:active,
.hg-theme-default .hg-button[data-skbtn="{shift}"]:hover,
.hg-theme-default .hg-button[data-skbtn="{enter}"]:active,
.hg-theme-default .hg-button[data-skbtn="{enter}"]:hover {
    background: #5449d6 !important;
}

.hg-theme-default .hg-button[data-skbtn="{space}"] {
    min-width: 200px !important;
    flex-grow: 2 !important;
}

.hg-theme-default .hg-row {
    gap: 6px !important;
    margin-bottom: 6px !important;
}

.hg-theme-default .hg-row:last-child {
    margin-bottom: 0 !important;
}

/* Numeric layout styling */
.hg-theme-default .hg-button {
    height: 52px !important;
    font-size: 18px !important;
}

/* Adjust body padding when keyboard is visible */
body.virtual-keyboard-open {
    padding-bottom: 280px;
}

body.virtual-keyboard-open.keyboard-numeric {
    padding-bottom: 240px;
}

/* Mobile: hide virtual keyboard (use native) */
@media (max-width: 768px) {
    .virtual-keyboard-wrapper {
        display: none !important;
    }
}

/* Tablet landscape and larger: show virtual keyboard */
@media (min-width: 769px) {
    .simple-keyboard.hg-theme-dark .hg-button {
        height: 56px;
        font-size: 18px;
    }

    .simple-keyboard.hg-theme-dark .hg-row {
        gap: 8px;
        margin-bottom: 8px;
    }
}

/* Large touch screens */
@media (min-width: 1200px) {
    .virtual-keyboard-container {
        max-width: 1150px;
        margin: 0 auto;
        border-radius: 16px 16px 0 0;
        border-left: 1px solid #334155;
        border-right: 1px solid #334155;
    }

    .hg-theme-default .hg-button {
        height: 60px !important;
        font-size: 20px !important;
    }
}
