/* Sinhala Keyboard Styles */
.sinhala-keyboard {
    width: 100%;
    max-width: 800px;
    background-color: #1a2433;
    color: #f3f4f6;
    border-radius: 0.5rem;
    margin: -0.5rem auto 1.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: none;
    overflow: hidden;
    padding: 0.5rem;
    border: 1px solid #263344;
    z-index: 40;
    position: relative;
    font-family: 'Malithi Web', 'Noto Sans Sinhala', sans-serif;
    transition: box-shadow 0.2s;
}

.sinhala-keyboard.dragging {
    opacity: 0.9;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
    z-index: 1001;
    cursor: move;
}

.sinhala-keyboard .keyboard-header {
    background-color: #1a2433;
    color: #94a3b8;
    padding: 0.25rem 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #263344;
    margin-bottom: 0.5rem;
    position: relative;
}

.sinhala-keyboard .keyboard-header.drag-handle {
    cursor: move;
    user-select: none;
    padding-left: 0.5rem;
    background-image: linear-gradient(to right, 
        transparent 0.25rem, 
        rgba(100, 116, 139, 0.2) 0.25rem, 
        rgba(100, 116, 139, 0.2) 0.35rem, 
        transparent 0.35rem
    );
}

.sinhala-keyboard .keyboard-header.drag-handle:hover {
    background-color: #263347;
}

.sinhala-keyboard .keyboard-header .drag-icon {
    font-size: 0.7rem;
    color: #94a3b8;
    letter-spacing: -0.1rem;
    margin-right: 0.5rem;
    display: inline-block;
    vertical-align: middle;
}

.sinhala-keyboard .keyboard-header h3 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.25rem 0;
    position: relative;
}

.sinhala-keyboard .keyboard-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sinhala-keyboard .keyboard-header .keyboard-help {
    cursor: pointer;
    font-size: 0.9rem;
    background-color: #334155;
    color: #94a3b8;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.sinhala-keyboard .keyboard-header .keyboard-help:hover {
    background-color: #475569;
    color: #f3f4f6;
}

.sinhala-keyboard .keyboard-header .close-keyboard {
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s;
    line-height: 1;
    font-size: 0.9rem;
}

.sinhala-keyboard .keyboard-header .close-keyboard:hover {
    background-color: #334155;
    color: #f3f4f6;
}

.sinhala-keyboard .keyboard-layout {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.sinhala-keyboard .keyboard-row {
    display: flex;
    justify-content: space-between;
    flex-wrap: nowrap;
    margin: 0.2rem 0;
    width: 100%;
}

.sinhala-keyboard .key {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #263344;
    color: #f3f4f6;
    border-radius: 0.25rem;
    margin: 0.2rem;
    cursor: pointer;
    font-size: 1.1rem;
    user-select: none;
    transition: all 0.15s;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.25rem;
    flex: 1;
    max-width: 2.8rem;
}

.sinhala-keyboard .key:hover {
    background-color: #354658;
}

.sinhala-keyboard .key:active {
    transform: scale(0.95);
    background-color: #2563eb;
}

.sinhala-keyboard .key.special {
    background-color: #263344;
    font-size: 0.8rem;
    color: #94a3b8;
}

.sinhala-keyboard .key.special:hover {
    background-color: #354658;
    color: #f3f4f6;
}

.sinhala-keyboard .key.backspace {
    max-width: none;
    flex: 1.5;
}

.sinhala-keyboard .key.tab {
    max-width: none;
    flex: 1.5;
}

.sinhala-keyboard .key.shift {
    max-width: none;
    flex: 1.5;
}

.sinhala-keyboard .key.space {
    max-width: none;
    width: auto;
    flex: 6;
    background-color: #263344;
}

.sinhala-keyboard .key.ctrl-alt {
    max-width: none;
    width: auto;
    flex: 2.5;
    font-size: 0.75rem;
    background-color: #263344;
    color: #94a3b8;
}

.sinhala-keyboard .home-key {
    background-color: #263344;
    color: #94a3b8;
}

.sinhala-keyboard .key.home-key:hover {
    background-color: #354658;
    color: #f3f4f6;
}

@media (max-width: 768px) {
    .sinhala-keyboard {
        display: none !important;
    }
}