/* ==========================================================================
   MHENT STUDY - INTERACTIVE VOCAB NOTEBOOK & EXCEL-INSPIRED SMART SHEET
   Tái hiện trọn vẹn tính năng từ Video TikTok với phong cách MHEnt Universe hiện đại
   ========================================================================== */

.vocab-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Stats Dashboard Card (Phỏng theo bảng tổng quan của video) */
.vocab-stats-board {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1.5rem;
    align-items: center;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.vocab-stats-board::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ec4899, #0ea5e9, #10b981);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.25rem;
}

.stat-box {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
}

.stat-value.highlight-blue { color: var(--accent-edu); }
.stat-value.highlight-green { color: var(--success); }
.stat-value.highlight-pink { color: var(--accent-korea); }

.stat-progress-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 240px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 0.88rem;
}

.progress-track {
    width: 100%;
    height: 10px;
    background: var(--bg-subtle);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #0ea5e9, #10b981);
    border-radius: var(--radius-full);
    transition: width 0.4s ease;
}

/* Mascot badge */
.stats-mascot {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-align: right;
}

.mascot-emoji {
    font-size: 2.2rem;
    animation: mascotBob 2s infinite ease-in-out;
}

@keyframes mascotBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.mascot-message {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
}

/* Action Toolbar */
.vocab-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    max-width: 480px;
}

.search-input-wrap {
    position: relative;
    width: 100%;
}

.search-input-wrap input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.4rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.88rem;
    outline: none;
    transition: all var(--transition-fast);
}

.search-input-wrap input:focus {
    border-color: var(--accent-edu);
    box-shadow: 0 0 0 3px var(--accent-edu-glow);
}

.search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

/* Smart Table Styles */
.sheet-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.sheet-scroll-wrap {
    overflow-x: auto;
    width: 100%;
}

.smart-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.88rem;
    text-align: left;
}

.smart-table th {
    background: var(--bg-subtle);
    padding: 0.85rem 1rem;
    font-weight: 700;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

.smart-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    transition: background-color var(--transition-fast);
}

.smart-table tbody tr:hover td {
    background-color: rgba(14, 165, 233, 0.04);
}

/* Specific Columns */
.col-word {
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-speaker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-full);
    background: var(--bg-subtle);
    color: var(--accent-edu);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-speaker:hover {
    background: var(--accent-edu);
    color: #fff;
    transform: scale(1.1);
}

.tag-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.tag-noun { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }
.tag-verb { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.tag-adj { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.tag-other { background: var(--bg-subtle); color: var(--text-muted); }

/* Writing Test Input (Trọng tâm của video) */
.input-test-word {
    width: 100%;
    min-width: 110px;
    max-width: 150px;
    padding: 0.45rem 0.65rem;
    border: 1.5px dashed var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.92rem;
    font-weight: 600;
    outline: none;
    transition: all var(--transition-fast);
}

.input-test-word:focus {
    border-style: solid;
    border-color: var(--accent-edu);
    box-shadow: 0 0 0 2px var(--accent-edu-glow);
}

/* Status Badges: Đúng / Sai */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

.status-pill.correct {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
    animation: popGreen 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.status-pill.wrong {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.3);
    animation: shakeRed 0.3s ease-in-out;
}

.status-pill.idle {
    background: var(--bg-subtle);
    color: var(--text-muted);
}

@keyframes popGreen {
    0% { transform: scale(0.8); }
    100% { transform: scale(1); }
}

@keyframes shakeRed {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* 4 Checkbox Reviews (Spaced Repetition) */
.review-checks {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.review-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-surface);
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
}

.review-checkbox:checked {
    background: var(--accent-edu);
    border-color: var(--accent-edu);
}

.review-checkbox:checked::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 900;
}

.review-percent-badge {
    display: inline-block;
    min-width: 44px;
    text-align: center;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    background: var(--bg-subtle);
}

.review-percent-badge.pct-100 {
    background: var(--success-bg);
    color: var(--success);
    font-weight: 800;
}
