/**
 * NjordViam Virtual Keyboard Styles
 * Clean marine theme matching battery/power dashboard
 */

/* Keyboard container */
.virtual-keyboard {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    padding: 12px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Hidden state */
.virtual-keyboard.hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

/* Visible state */
.virtual-keyboard.visible {
    transform: translateY(0);
    opacity: 1;
}

/* Header with preview */
.vk-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    margin-bottom: 10px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.vk-input-preview {
    color: #1f2937;
    font-size: 18px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 12px;
}

.vk-close {
    width: 48px;
    height: 48px;
    border: none;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    font-size: 24px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.vk-close:active {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: scale(0.95);
}

/* Key rows */
.vk-keys {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

/* Individual keys - clean white style */
.vk-key {
    flex: 1;
    min-width: 38px;
    height: 58px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    color: #1f2937;
    font-size: 22px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.1s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.vk-key:active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

/* Special keys - subtle gray */
.vk-key.key-shift,
.vk-key.key-caps,
.vk-key.key-backspace,
.vk-key.key-mode {
    background: #f1f5f9;
    color: #475569;
    font-size: 18px;
}

.vk-key.key-shift.active,
.vk-key.key-caps.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.vk-key.key-space {
    background: white;
}

/* Done button - success green */
.vk-key.key-done {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-size: 18px;
    font-weight: 600;
    border: none;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.vk-key.key-done:active {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

/* Backspace - subtle red on press */
.vk-key.key-backspace:active {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-color: transparent;
}

/* Pi Display 2 specific - larger keys */
@media (max-width: 800px) {
    .virtual-keyboard {
        padding: 10px;
    }

    .vk-key {
        height: 62px;
        font-size: 24px;
        border-radius: 14px;
        min-width: 42px;
    }

    .vk-row {
        gap: 5px;
    }

    .vk-keys {
        gap: 6px;
    }

    .vk-header {
        padding: 10px 14px;
    }

    .vk-input-preview {
        font-size: 16px;
    }

    .vk-close {
        width: 52px;
        height: 52px;
    }
}

/* Landscape mode - more compact */
@media (max-height: 500px) {
    .virtual-keyboard {
        padding: 6px;
    }

    .vk-key {
        height: 48px;
        font-size: 18px;
    }

    .vk-header {
        padding: 4px 10px;
        margin-bottom: 6px;
    }

    .vk-keys {
        gap: 4px;
    }

    .vk-row {
        gap: 4px;
    }
}

/* Prevent body scroll when keyboard is visible */
body.vk-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}
