/* Keyboard Tester Specific Styles */
:root {
    --key-width: 40px;
    --key-height: 40px;
    --key-gap: 4px;
}

.keyboard-layout {
    display: flex;
    flex-direction: column;
    gap: var(--key-gap);
    padding: 2rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin: 2rem 0;
    overflow-x: auto;
    min-height: 300px;
}

.keyboard-row {
    display: flex;
    gap: var(--key-gap);
    justify-content: center;
}

.key {
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--key-height);
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.1s ease;
    user-select: none;
    min-width: var(--key-width);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.key:hover {
    background: #e9ecef;
    border-color: #007bff;
    transform: translateY(-1px);
}

.key.pressed {
    background: #007bff;
    color: white;
    border-color: #0056b3;
    transform: scale(0.95);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.metric-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.metric-label {
    display: block;
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: #007bff;
}

.performance-analysis {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.performance-analysis h3 {
    margin-bottom: 1.5rem;
    color: #495057;
    font-size: 1.25rem;
}

.key-history-list {
    max-height: 300px;
    overflow-y: auto;
}

.history-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.history-entry:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.key-name {
    font-weight: 600;
    color: white;
    background: rgba(0, 123, 255, 0.8);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: monospace;
}

.key-time {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
}

.test-controls {
    text-align: center;
    margin: 2rem 0;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #007bff;
    color: white;
}

.btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: #007bff;
    border-color: #007bff;
}

.btn-outline:hover {
    background: #007bff;
    color: white;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.text-muted {
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    :root {
        --key-width: 30px;
        --key-height: 30px;
        --key-gap: 2px;
    }

    .keyboard-layout {
        padding: 1rem;
    }

    .key {
        font-size: 0.7rem;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .metric-value {
        font-size: 1.5rem;
    }

    .performance-analysis {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    :root {
        --key-width: 25px;
        --key-height: 25px;
        --key-gap: 1px;
    }

    .key {
        font-size: 0.6rem;
    }

    .metric-card {
        padding: 1rem;
    }

    .metric-value {
        font-size: 1.2rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .btn-large {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .key {
        background: #343a40;
        border-color: #495057;
        color: #f8f9fa;
    }

    .key:hover {
        background: #495057;
        border-color: #007bff;
    }

    .metric-card,
    .performance-analysis,
    .keyboard-layout {
        background: #343a40;
        border-color: #495057;
    }

    .metric-label,
    .performance-analysis h3 {
        color: #f8f9fa;
    }

    .history-entry {
        background: #495057;
        border-color: #6c757d;
    }

    .key-name {
        background: #6c757d;
        color: #f8f9fa;
    }

    .text-muted {
        color: #adb5bd;
    }
}

