.virtual-keyboard {
    position: fixed;
    bottom: -350px;
    /* Hidden by default, slides up */
    left: 0;
    width: 100%;
    background-color: #e0e0e0;
    /* Light gray background */
    padding: 15px 10px;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.15);
    transition: bottom 0.3s ease-out;
    /* Smooth slide animation */
    z-index: 1002;
    /* Ensure it's above other content */
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-sizing: border-box;
    user-select: none;
    /* Prevent text selection on keys */
}

.virtual-keyboard.is-visible {
    bottom: 0;
    /* Slide up to visible position */
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.key {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 48px;
    background-color: #ffffff;
    /* White key background */
    border-radius: 8px;
    cursor: pointer;
    font-size: 2rem;
    font-weight: 500;
    color: #333;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background-color 0.15s ease-in-out, transform 0.1s ease-in-out;
    touch-action: manipulation;
    font-family: Hanzala;
    /* Improves touch responsiveness */
}

.key:active {
    background-color: #d0d0d0;
    /* Slightly darker on press */
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.key.space {
    flex-grow: 6;
    /* Wider spacebar */
    max-width: 40%;
}

.key.backspace,
.key.shift,
.key.enter,
.key.layout,
.key.hide-keyboard {
    background-color: #c0c0c0;
    /* Special keys have a slightly darker background */
    font-size: 1rem;
    font-weight: 600;
    display:flex;
    justify-content: center;
    align-items: center;
}

.key.shift.active {
    background-color: #6366f1;
    /* Highlight shift when active */
    color: #fff;
}

.key.backspace i,
.key.shift i,
.key.enter i {
    font-size: 1.2rem;
}

/* Media queries for responsiveness */
@media (max-width: 768px) {
    .container {
        margin-top: 20px;
        width: 95%;
    }

    .key {
        height: 44px;
        font-size: 1rem;
    }

    .virtual-keyboard {
        padding: 10px 5px;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .key {
        height: 40px;
        font-size: 0.9rem;
    }

    .key.backspace,
    .key.shift,
    .key.enter,
    .key.hide-keyboard {
        font-size: 0.85rem;
    }
}