:root {
    --bg-color: #1e1e2e;
    --key-bg: #313244;
    --key-text: #cdd6f4;
    --highlight-active: #89b4fa; /* Blue/Purple for active press */
    --highlight-pressed: #f38ba8; /* Red for current press logic */
    --accent-color: #a6e3a1; /* Green */
    --space-width: 250px;
}

.basic-keyboard-tester-body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--key-text);
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding: 36px 20px 36px 20px;
}

.basic-keyboard-tester-h1 {
    margin-bottom: 10px;
    color: var(--accent-color);
}

/* Stats Dashboard */
.dashboard {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    width: 90%;
    max-width: 900px;
    margin-bottom: 30px;
    text-align: center;
}

.stat-box {
    background-color: var(--key-bg);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-color);
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Keyboard Container */
.keyboard-container {
    background-color: #262736;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    user-select: none; /* Prevents highlighting text while mashing keys */
    position: relative;
    height: 700px;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
    min-height: 50px;
}

.key {
    width: 45px;
    height: 45px;
    background-color: var(--key-bg);
    color: var(--key-text);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.1s ease;
    box-shadow: 0 3px 0 rgba(0,0,0,0.4);
    position: relative;
}

/* Key Sizes */
.key.space { width: var(--space-width); }
.key.shift { width: 90px; }
.key.caps { width: 75px; }
.key.ctrl { width: 65px; }
.key.alt { width: 55px; }
.key.meta { width: 55px; } /* Win/Cmd */
.key.enter { width: 100px; }
.key.tab { width: 80px; }
.key.arrow { width: 35px; }
.key.backspace { width: 120px; }
.key.num-pad_decimal { width: 45px; }
.key.num-pad_zero { width: 45px; }
.key.num-pad_enter { width: 80px; }
.key.num-pad_minus { width: 80px; }
.key.num-pad_plus { width: 80px; }
.key.num-pad_backspace { width: 80px; }
7/
/* Numpad specific sizing */
.numpad-col {
    display: flex;
    flex-direction: column;
}
.numpad-row {
    display: flex;
    justify-content: left;
    margin-bottom: 8px;
    height: 50px;
}

/* Active States (Visual Feedback) */

/* When key is physically pressed down */
.key.pressed {
    background-color: var(--highlight-pressed);
    color: white;
    transform: translateY(3px); /* Simulates pressing down */
    box-shadow: none;
    border-bottom: 3px solid #745862;
}

/* When key has been pressed and we want to remember it (sticky mode) */
.key.sticky {
    background-color: var(--highlight-active);
    color: #1e1e2e;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

/* Control Keys styling */
.key.f-key { width: 40px; font-size: 0.8rem; }

/* Reset Button */
.controls {
    margin-top: 30px;
}

button.reset-btn {
    background-color: var(--highlight-pressed);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 4px 0 #a74d5b;
}

button.reset-btn:active {
    transform: translateY(4px);
    box-shadow: none;
}

.sticky-toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    font-size: 1rem;
}

/* Toggle Switch CSS */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider { background-color: var(--accent-color); }
input:checked + .slider:before { transform: translateX(20px); }