/* Virtual Keyboard Styles */

.virtual-keyboard-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.virtual-keyboard-overlay.virtual-keyboard-visible {
    opacity: 1;
}

.virtual-keyboard-container {
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.virtual-keyboard-overlay.virtual-keyboard-visible .virtual-keyboard-container {
    transform: scale(1);
}


/* Header */

.virtual-keyboard-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.virtual-keyboard-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.virtual-keyboard-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: background-color 0.2s;
}

.virtual-keyboard-close:hover {
    background: rgba(255, 255, 255, 0.2);
}


/* Display Section */

.virtual-keyboard-display {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.virtual-keyboard-input-display {
    text-align: center;
    margin-bottom: 15px;
}

.virtual-keyboard-label {
    display: block;
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 10px;
    font-weight: 500;
}

.virtual-keyboard-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.virtual-keyboard-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #007bff;
    background: transparent;
    transition: all 0.2s ease;
}

.virtual-keyboard-dot-filled {
    background: #007bff;
    transform: scale(1.1);
}

.virtual-keyboard-input-value {
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    color: #007bff;
    font-weight: bold;
    min-height: 20px;
}


/* Keyboard Keys */

.virtual-keyboard-keys {
    padding: 20px;
    background: #ffffff;
}

.virtual-keyboard-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.virtual-keyboard-row:last-child {
    margin-bottom: 0;
}

.virtual-key {
    width: 50px;
    height: 50px;
    border: 2px solid #e9ecef;
    background: #ffffff;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.virtual-key:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.virtual-key:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.3);
}


/* Special Keys */

.virtual-key-clear {
    background: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

.virtual-key-clear:hover {
    background: #e0a800;
    border-color: #e0a800;
    color: #212529;
}

.virtual-key-backspace {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

.virtual-key-backspace:hover {
    background: #c82333;
    border-color: #c82333;
    color: white;
}

.virtual-key-enter {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

.virtual-key-enter:hover {
    background: #218838;
    border-color: #218838;
    color: white;
}


/* Footer */

.virtual-keyboard-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.virtual-keyboard-security-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    color: #6c757d;
}

.virtual-keyboard-security-notice i {
    color: #28a745;
}


/* Input Icons */

.virtual-keyboard-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #007bff;
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s;
}

.virtual-keyboard-icon:hover {
    color: #0056b3;
}


/* Responsive Design */

@media (max-width: 768px) {
    .virtual-keyboard-container {
        width: 95%;
        max-height: 90vh;
    }
    .virtual-key {
        width: 45px;
        height: 45px;
        font-size: 14px;
    }
    .virtual-keyboard-row {
        gap: 6px;
    }
    .virtual-keyboard-header {
        padding: 15px;
    }
    .virtual-keyboard-title {
        font-size: 16px;
    }
    .virtual-keyboard-display {
        padding: 15px;
    }
    .virtual-keyboard-keys {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .virtual-key {
        width: 40px;
        height: 40px;
        font-size: 12px;
    }
    .virtual-keyboard-row {
        gap: 4px;
    }
    .virtual-keyboard-dot {
        width: 16px;
        height: 16px;
    }
}


/* Dark Mode Support */

@media (prefers-color-scheme: dark) {
    .virtual-keyboard-container {
        background: #2d3748;
        color: #e2e8f0;
    }
    .virtual-keyboard-display {
        background: #4a5568;
        border-bottom-color: #718096;
    }
    .virtual-keyboard-keys {
        background: #2d3748;
    }
    .virtual-key {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    .virtual-key:hover {
        background: #007bff;
        color: white;
        border-color: #007bff;
    }
    .virtual-keyboard-footer {
        background: #4a5568;
        border-top-color: #718096;
    }
    .virtual-keyboard-input-value {
        color: #007bff;
    }
}


/* Animation Keyframes */

@keyframes keyboardSlideIn {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes keyPress {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

.virtual-key:active {
    animation: keyPress 0.1s ease;
}


/* Focus States */

.virtual-key:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}


/* Accessibility */

.virtual-keyboard-overlay:focus-within {
    outline: none;
}

.virtual-key:focus-visible {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}


/* High Contrast Mode */

@media (prefers-contrast: high) {
    .virtual-keyboard-container {
        border: 2px solid #000000;
    }
    .virtual-key {
        border-width: 2px;
    }
    .virtual-keyboard-dot {
        border-width: 2px;
    }
}


/* Reduced Motion */

@media (prefers-reduced-motion: reduce) {
    .virtual-keyboard-overlay,
    .virtual-keyboard-container,
    .virtual-key {
        transition: none;
    }
    .virtual-key:hover {
        transform: none;
    }
    .virtual-keyboard-dot {
        transition: none;
    }
}