/* Keyboard Test CSS - New Perfect Implementation */
/* Dynamically scalable full keyboard for testing */

:root {
    /* Color palette */
    --primary-blue: #1e3c72;
    --secondary-blue: #2a5298;
    --white: #ffffff;
    --light-gray: #e0e0e0;
    --medium-gray: #cccccc;
}

.keyboard-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.keyboard {
    display: grid;
    grid-template-rows: repeat(6, 1fr) auto;
    gap: 1px; 
    width: 100%;
    aspect-ratio: 19/7;
    font-size: clamp(8px, 1.2vw, 16px);
    padding: 0.5em;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.keyboard-row {
    display: grid;
    gap: 4px;
    align-items: stretch;
}

.key {
    background: linear-gradient(145deg, #ffffff, #f5f5f5);
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    color: #333333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    transition: all 0.1s ease;
    user-select: none;
    min-height: 0;
    max-height: 75%;

    overflow: hidden;
    text-align: center;
    font-size: inherit;
}

.key:hover {
    background: linear-gradient(145deg, #f8f8f8, #eeeeee);
    border-color: #d0d0d0;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.key:active {
    background: linear-gradient(145deg, #eeeeee, #e0e0e0);
    transform: translateY(0);
}

/* Function Keys Row */
.function-row {
    grid-template-columns: repeat(12, 1fr) 1.5fr;
}

/* Number Row */
.number-row {
    grid-template-columns: repeat(13, 1fr) 2fr;
}

/* QWERTY Row */
.qwerty-row {
    grid-template-columns: 1.5fr repeat(12, 1fr) 1.5fr;
}

/* ASDF Row */
.asdf-row {
    grid-template-columns: 1.75fr repeat(11, 1fr) 2.25fr;
}

/* ZXCV Row */
.zxcv-row {
    grid-template-columns: 2.25fr repeat(10, 1fr) 2.75fr;
}

/* Space Row */
.space-row {
    grid-template-columns: 1.25fr 1.25fr 1.25fr 6.25fr 1.25fr 1.25fr 1.25fr 1.25fr 1fr 1fr 1fr;
}

.space-arrow-cluster {
    grid-column: 9 / 12;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 6px;
}

.arrow-up {
    grid-column: 2;
    grid-row: 1;
}

.arrow-left {
    grid-column: 1;
    grid-row: 2;
}

.arrow-down {
    grid-column: 2;
    grid-row: 2;
}

.arrow-right {
    grid-column: 3;
    grid-row: 2;
}

/* Special key styles */
.key.function {
    background: linear-gradient(145deg, #ffffff, #f5f5f5);
    color: #666666;
    font-size: 0.8em;
}

.key.modifier {
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    color: #555555;
    font-weight: 600;
    font-size: 0.85em;
}

.key.space {
    background: linear-gradient(145deg, #ffffff, #f5f5f5);
    color: #555555;
    font-weight: 600;
}

.key.arrow {
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    color: #555555;
    font-weight: 600;
    font-size: 0.7em;
}

/* Key testing states */
.key.pressed {
    background: linear-gradient(145deg, #1e3c72, #0d2142) !important;
    color: #ffffff !important;
    transform: translateY(1px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.key.tested {
    background: linear-gradient(145deg, #64b5f6, #42a5f5) !important;
    color: #ffffff !important;
    box-shadow: 0 0 8px rgba(100, 181, 246, 0.3);
}

.key.tested:hover {
    background: linear-gradient(145deg, #90caf9, #64b5f6) !important;
}

/* Responsive text sizing */
@media (max-width: 800px) {
    .keyboard {
        font-size: clamp(6px, 2vw, 12px);
    }
    
    .key {
        height: 32px;
        max-height: 32px;
    }
}

@media (max-width: 500px) {
    .keyboard {
        font-size: clamp(4px, 2.5vw, 10px);
    }
    
    .keyboard-container {
        padding: 10px;
    }
    
    .key {
        height: 28px;
        max-height: 28px;
    }
}