/* Shared Variables & Container */
.typa-main-container { 
    --primary: #2271b1; 
    --danger: #d63638; 
    --success: #2e7d32;
    font-family: sans-serif; 
    max-width: 800px; 
    margin: 20px auto; 
    scroll-margin-top: 50px; /* Khoảng cách khi scroll lên đầu trang */
}

/* Global Card & Screens */
.typa-card { 
    background: #fff; 
    border: 1px solid #ccd0d4; 
    padding: 30px; 
    border-radius: 8px; 
    text-align: center; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.05); 
}
.typa-hidden { display: none !important; }

/* Start Screen */
.typa-title { margin-top: 0; color: var(--primary); }
.typa-word-hints { 
    background: #f9f9f9; 
    padding: 15px; 
    border-radius: 5px; 
    margin-bottom: 20px; 
    border: 1px dashed #ccc; 
    text-align: center; 
}
.typa-word-hints p { margin: 5px 0 0; color: #555; line-height: 1.6; }

.typa-setup-row { 
    margin: 20px 0; 
    display: flex; 
    justify-content: center; 
    gap: 20px; 
}
.typa-setup-row input { 
    width: 60px; 
    padding: 5px; 
    border: 1px solid #ddd; 
    border-radius: 4px;
}

.typa-options-row { 
    margin-bottom: 20px; 
    font-weight: bold; 
    display: flex; 
    justify-content: center; 
    gap: 20px; 
}
.typa-options-row label { cursor: pointer; }

/* Play Screen Controls */
.typa-top-bar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 30px; 
}
.typa-progress-counter { 
    font-weight: bold; 
    color: #555; 
    background: #eee; 
    padding: 5px 12px; 
    border-radius: 20px; 
}
.typa-timer-display { 
    font-size: 24px; 
    font-weight: bold; 
    color: var(--danger); 
}

/* Word Display Area */
.typa-word-area { margin-bottom: 20px; }
.typa-word-area > div { margin-bottom: 15px; }

.typa-display-word { 
    font-size: 3.5rem; 
    font-weight: bold; 
    color: var(--primary); 
    display: block;
    line-height: 3.5rem;
}

.typa-display-syllable { font-size: 1.8rem; color: #888; }
.typa-display-ipa { font-size: 1.5rem; color: #666; font-style: italic; }
.typa-display-vi { font-size: 1.8rem; color: #888;     line-height: 2.2rem;}

/* Audio Button */
.typa-btn-audio {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--primary);
    margin-top: 20px;
    vertical-align: middle;
    transition: transform 0.2s;
    padding: 5px;
    line-height: 1;
}
.typa-btn-audio:hover {
    transform: scale(1.2);
    color: #1a5a8e;
}

/* Input Area */
.typa-field-input { 
    width: 100% !important; 
    font-size: 1.5rem !important; 
    line-height: normal !important;
    height: auto !important;
    padding: 12px !important; 
    border: 2px solid #ddd !important; 
    border-radius: 8px !important; 
    text-align: center !important; 
    box-sizing: border-box !important; 
    transition: border-color 0.2s;
    font-weight: normal !important; /* Ngăn chặn font-weight: bold tự phát */
}
/* Chống lại các thuộc tính tự động của Chrome khi autofill */
.typa-field-input:-webkit-autofill,
.typa-field-input:-webkit-autofill:hover, 
.typa-field-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #333 !important;
    -webkit-box-shadow: 0 0 0px 1000px white inset !important;
    transition: background-color 5000s ease-in-out 0s !important;
    font-size: 1.5rem !important;
}

.typa-field-input:focus { border-color: var(--primary); outline: none; }

.typa-error-msg { font-weight: bold; margin-top: 10px; }

/* Buttons & Actions */
.typa-btn-primary { 
    margin-top: 20px; 
    background: var(--primary); 
    color: #fff; 
    border: none; 
    padding: 12px 30px; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 16px; 
    transition: opacity 0.2s;
}
.typa-btn-primary:hover { opacity: 0.9; }

.typa-btn-danger { 
    background: var(--danger); 
    color: #fff; 
    border: none; 
    padding: 10px 20px; 
    border-radius: 4px; 
    cursor: pointer; 
}

.typa-btn-skip { 
    background: #ed8936; 
    color: white; 
    border: none; 
    padding: 10px 20px; 
    border-radius: 4px; 
    cursor: pointer; 
    margin-left: 10px; 
}

.typa-actions { margin-top: 20px; }

/* Result Screen Table */
.typa-result-score { font-size: 2.5rem; font-weight: bold; margin: 15px 0; }
.typa-missed-list { 
    text-align: left; 
    background: #fff5f5; 
    padding: 15px; 
    border-radius: 8px; 
    margin-top: 20px; 
    border: 1px solid #feb2b2; 
}
.typa-missed-list h3 { 
    color: #c53030; 
    margin-top: 0; 
    font-size: 1.1rem; 
    border-bottom: 1px solid #fed7d7; 
    padding-bottom: 5px; 
}

.typa-missed-item-grid { 
    display: grid; 
    grid-template-columns: 1.2fr 1fr 1fr 1.2fr; 
    gap: 10px; 
    border-bottom: 1px solid #fed7d7; 
    padding: 8px 0; 
    align-items: center; 
    font-size: 0.95rem; 
}
.typa-missed-item-grid:last-child { border-bottom: none; }
.typa-missed-item-grid b { color: #333; }
.typa-missed-item-grid small { color: #666; }
.typa-missed-item-grid span.ipa { font-style: italic; color: #4a5568; }
.typa-missed-item-grid span.vi { text-align: right; color: #2d3748; }

/* Admin UI */
.typa-admin-card { padding: 20px; max-width: 500px; margin-top: 20px; background: #fff; border: 1px solid #ccd0d4; }
.typa-admin-submit-wrapper { margin-top: 20px; }
.typa-admin-shortcode-box { background: #f0f0f1; padding: 15px; border-left: 4px solid #2271b1; margin-bottom: 15px; }
.typa-copyable-code { cursor: pointer; background: #fff; padding: 3px 8px; border: 1px solid #ccc; font-family: monospace; }
#typa-copy-status { margin-left: 10px; color: green; display: none; font-weight: bold; }
.typa-admin-textarea { width: 100%; height: 150px; font-family: monospace; padding: 10px; }

/* Admin Menu Icon Fix */
#adminmenu .menu-icon-typa_voca div.wp-menu-image:before {
    font-family: dashicons !important;
    content: "\f118" !important;
}

/* Animations */
.shake { animation: shake 0.2s ease-in-out 0s 2; }
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
}