/**
 * Stylesheet cho công cụ Kiểm tra tốc độ gõ phím (Typing Speed Test)
 */

.hihi-typing-container {
    --bg-slate-850: #1e293b;
    --primary-indigo: #6366f1;
}

/* Các nút lựa chọn ngôn ngữ */
.lang-select-btn {
    color: #94a3b8;
    background-color: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-select-btn.active {
    background-color: #334155;
    color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.lang-select-btn:hover:not(.active) {
    color: #f1f5f9;
}

/* Input gõ phím */
#typing-input {
    background-color: #1e293b;
    caret-color: var(--primary-indigo);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

/* Words Box styling */
#typing-words-box {
    line-height: 2.2rem;
    height: 6.6rem; /* Hiển thị đúng 3 dòng chữ */
    overflow: hidden;
    position: relative;
}

/* Kiểu dáng từng từ mẫu */
.typing-word {
    display: inline-block;
    margin: 0 6px;
    padding: 0 4px;
    border-radius: 4px;
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
    border-bottom: 2px solid transparent;
}

/* Từ chưa gõ */
.typing-word.pending {
    color: #64748b; /* Slate-500 */
}

/* Từ đang cần gõ */
.typing-word.current {
    color: #ffffff;
    background-color: rgba(99, 102, 241, 0.12);
    border-bottom-color: var(--primary-indigo);
}

/* Từ gõ chính xác */
.typing-word.correct {
    color: #10b981; /* Emerald-500 */
}

/* Từ gõ sai */
.typing-word.wrong {
    color: #f43f5e; /* Rose-500 */
    background-color: rgba(244, 63, 94, 0.08);
}

/* Hoạt ảnh nhấp nháy cho giây đếm ngược cuối */
.timer-low {
    animation: timer-danger 1s ease infinite;
}

@keyframes timer-danger {
    0%, 100% { color: #fbbf24; transform: scale(1); }
    50% { color: #f43f5e; transform: scale(1.05); }
}

/* Khung kết quả hiển thị */
#typing-results-card {
    animation: results-fade-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes results-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
