/* Klavye testi özel stilleri */

.keyboard-container {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-radius: 15px;
    padding: 2rem;
    color: white;
    position: relative;
    overflow: hidden;
}

/* Virtual Keyboard */
.virtual-keyboard {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.keyboard-row {
    display: flex;
    justify-content: center;
    margin-bottom: 0.5rem;
    gap: 0.25rem;
}

.key {
    background: linear-gradient(145deg, #3a4a5c, #2c3e50);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
    height: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    text-align: center;
    line-height: 1.2;
}

.key:hover {
    background: linear-gradient(145deg, #4a5a6c, #3c4e60);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.key.active {
    background: linear-gradient(145deg, #e74c3c, #c0392b);
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.key.pressed {
    background: linear-gradient(145deg, #27ae60, #229954);
    animation: key-press 0.3s ease;
}

@keyframes key-press {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* Key Sizes */
.wide-key {
    min-width: 60px;
}

.extra-wide-key {
    min-width: 80px;
}

.space-key {
    min-width: 200px;
}

.function-key {
    background: linear-gradient(145deg, #34495e, #2c3e50);
    font-size: 0.7rem;
    min-width: 35px;
    height: 35px;
}

.arrow-key {
    min-width: 35px;
    height: 35px;
    font-size: 1rem;
}

.key-spacer {
    width: 20px;
}

/* Arrow Keys Layout */
.arrow-keys {
    position: absolute;
    right: 1.5rem;
    bottom: 1.5rem;
}

.arrow-row {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    margin-bottom: 0.25rem;
}

/* Test Area */
.test-area {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.typing-area .form-label {
    color: white;
    font-weight: 600;
    margin-bottom: 1rem;
}

#typing-input {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    line-height: 1.5;
    resize: vertical;
    min-height: 120px;
}

#typing-input:focus {
    background: rgba(255, 255, 255, 0.95);
    border-color: #3498db;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* Keyboard Stats */
.keyboard-stats {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.keyboard-stats h6 {
    color: white;
    margin-bottom: 1rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 0.5rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.stat-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.stat-value {
    color: white;
    font-weight: bold;
    font-size: 1rem;
    background: rgba(52, 152, 219, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    min-width: 40px;
    text-align: center;
}

/* Keyboard Controls */
.keyboard-controls .btn {
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.keyboard-controls .btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

/* Keyboard Info */
.keyboard-info {
    border: 1px solid rgba(13, 110, 253, 0.1);
    transition: all 0.3s ease;
}

.keyboard-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.keyboard-info .badge {
    font-size: 0.8rem;
    margin-right: 0.5rem;
}

/* Special Key Indicators */
.key[data-key="CapsLock"].caps-active {
    background: linear-gradient(145deg, #f39c12, #e67e22);
}

.key[data-key="ShiftLeft"].shift-active,
.key[data-key="ShiftRight"].shift-active {
    background: linear-gradient(145deg, #9b59b6, #8e44ad);
}

.key[data-key="ControlLeft"].ctrl-active,
.key[data-key="ControlRight"].ctrl-active {
    background: linear-gradient(145deg, #e67e22, #d35400);
}

.key[data-key="AltLeft"].alt-active,
.key[data-key="AltRight"].alt-active {
    background: linear-gradient(145deg, #16a085, #1abc9c);
}

/* Typing Speed Indicator */
.wpm-indicator {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    backdrop-filter: blur(10px);
}

.wpm-fast {
    background: rgba(39, 174, 96, 0.8);
}

.wpm-medium {
    background: rgba(241, 196, 15, 0.8);
}

.wpm-slow {
    background: rgba(231, 76, 60, 0.8);
}

/* Key Heat Map */
.key.heat-1 { background: linear-gradient(145deg, #3a4a5c, #2c3e50); }
.key.heat-2 { background: linear-gradient(145deg, #f1c40f, #f39c12); }
.key.heat-3 { background: linear-gradient(145deg, #e67e22, #d35400); }
.key.heat-4 { background: linear-gradient(145deg, #e74c3c, #c0392b); }
.key.heat-5 { background: linear-gradient(145deg, #8e44ad, #9b59b6); }

/* Responsive Design */
@media (max-width: 1200px) {
    .virtual-keyboard {
        padding: 1rem;
    }
    
    .key {
        height: 35px;
        min-width: 35px;
        font-size: 0.7rem;
    }
    
    .wide-key {
        min-width: 50px;
    }
    
    .extra-wide-key {
        min-width: 65px;
    }
    
    .space-key {
        min-width: 150px;
    }
    
    .function-key {
        min-width: 30px;
        height: 30px;
        font-size: 0.6rem;
    }
}

@media (max-width: 992px) {
    .keyboard-container {
        padding: 1rem;
    }
    
    .arrow-keys {
        position: static;
        margin-top: 1rem;
        text-align: center;
    }
    
    .test-area .row {
        --bs-gutter-x: 1rem;
    }
}

@media (max-width: 768px) {
    .virtual-keyboard {
        padding: 0.5rem;
        overflow-x: auto;
    }
    
    .keyboard-row {
        min-width: 600px;
    }
    
    .key {
        height: 30px;
        min-width: 30px;
        font-size: 0.6rem;
    }
    
    .wide-key {
        min-width: 40px;
    }
    
    .extra-wide-key {
        min-width: 50px;
    }
    
    .space-key {
        min-width: 120px;
    }
    
    .function-key {
        min-width: 25px;
        height: 25px;
        font-size: 0.5rem;
    }
    
    .arrow-key {
        min-width: 30px;
        height: 30px;
    }
    
    .test-area {
        padding: 1rem;
    }
    
    #typing-input {
        min-height: 100px;
        font-size: 0.9rem;
    }
    
    .keyboard-stats {
        margin-top: 1rem;
    }
}

@media (max-width: 480px) {
    .keyboard-container {
        padding: 0.5rem;
    }
    
    .virtual-keyboard {
        padding: 0.25rem;
    }
    
    .key {
        height: 25px;
        min-width: 25px;
        font-size: 0.5rem;
    }
    
    .wide-key {
        min-width: 35px;
    }
    
    .extra-wide-key {
        min-width: 40px;
    }
    
    .space-key {
        min-width: 100px;
    }
    
    .function-key {
        min-width: 20px;
        height: 20px;
        font-size: 0.4rem;
    }
    
    .test-area {
        padding: 0.75rem;
    }
    
    .keyboard-stats {
        padding: 0.75rem;
    }
    
    .stat-item {
        margin-bottom: 0.5rem;
        padding: 0.25rem 0;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .stat-value {
        font-size: 0.9rem;
        padding: 0.2rem 0.4rem;
    }
}

/* Accessibility */
.key:focus {
    outline: 2px solid rgba(52, 152, 219, 0.8);
    outline-offset: 2px;
}

#typing-input:focus {
    outline: none;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .keyboard-container {
        background: #000;
        border: 2px solid #fff;
    }
    
    .virtual-keyboard,
    .test-area,
    .keyboard-stats {
        background: #000;
        border: 1px solid #fff;
    }
    
    .key {
        background: #333;
        border: 1px solid #fff;
        color: #fff;
    }
    
    .key:hover {
        background: #555;
    }
    
    .key.active {
        background: #f00;
    }
    
    .key.pressed {
        background: #0f0;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .key,
    .keyboard-controls .btn,
    .keyboard-info {
        transition: none;
        animation: none;
    }
    
    .key:hover,
    .keyboard-controls .btn:hover {
        transform: none;
    }
    
    .key.pressed {
        animation: none;
    }
}

/* Print Styles */
@media print {
    .virtual-keyboard,
    .keyboard-controls {
        display: none;
    }
    
    .keyboard-container {
        background: white;
        color: black;
    }
    
    .test-area {
        background: white;
        border: 1px solid #ccc;
    }
}
