#vocab-learning-container,
.vocab-learning-shell {
    width: 100%;
}

.vocab-learning-back-link {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    position: relative;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(74, 112, 65, 0.12);
    box-shadow: 0 10px 18px rgba(42, 61, 32, 0.05);
    text-decoration: none;
    color: #33431e;
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
}

.vocab-learning-back-link:hover {
    background: rgba(237, 247, 232, 0.95);
    transform: translateY(-1px);
}

.vocab-learning-back-link:hover::after {
    content: "Trở về danh sách chủ đề";
    position: absolute;
    left: 50%;
    top: calc(100% + 10px);
    transform: translateX(-50%);
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(50, 62, 38, 0.96);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 10px 18px rgba(42, 61, 32, 0.14);
    pointer-events: none;
}

#vocab-learning-container {
    max-width: 1120px;
    margin: 18px auto 0;
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
    display: grid;
    gap: 18px;
}

.topic-lesson-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr) auto;
    gap: 16px;
    align-items: stretch;
    padding: 18px 20px;
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(34, 197, 94, 0.10), transparent 34%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(247, 251, 243, 0.96));
    border: 1px solid rgba(74, 112, 65, 0.10);
    box-shadow: 0 16px 32px rgba(42, 61, 32, 0.08);
}

.topic-lesson-eyebrow {
    display: grid;
    gap: 8px;
    align-content: start;
}

.topic-lesson-eyebrow .topic-intro {
    margin: 0 !important;
    font-size: 14px;
    color: #6d695f;
    letter-spacing: 0.02em;
}

.topic-lesson-eyebrow .topic-title {
    margin: 0;
    color: #22c55e;
    font-size: clamp(1.3rem, 2vw, 1.8rem);
    line-height: 1.15;
    font-weight: 700;
}

.topic-lesson-progress {
    display: grid;
    gap: 10px;
    align-content: center;
    justify-items: stretch;
    padding: 8px 0;
    position: relative;
}

#vocab-statistics {
    width: 100%;
    margin: 0;
    text-align: right;
    font-size: 1em;
    color: #33431e;
}

.topic-progress-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.topic-progress-label {
    margin: 0;
    font-size: 15px;
    color: #4d5867;
    font-weight: 400;
}

#progress-bar {
    width: 100%;
    height: 10px;
    border: 0;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(74, 112, 65, 0.09);
    box-shadow: inset 0 1px 2px rgba(42, 61, 32, 0.08);
    appearance: none;
}

#progress-bar::-webkit-progress-bar {
    background: rgba(74, 112, 65, 0.09);
    border-radius: 999px;
}

#progress-bar::-webkit-progress-value {
    background: linear-gradient(90deg, #62b35d, #22c55e);
    border-radius: 999px;
}

#progress-bar::-moz-progress-bar {
    background: linear-gradient(90deg, #62b35d, #22c55e);
    border-radius: 999px;
}

.vocab-layout {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    min-height: 0;
    width: 100%;
}

.vocab-left {
    flex: 0 0 35%;
    border: 1px solid rgba(74, 112, 65, 0.12);
    padding: 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.94);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    box-shadow: 0 14px 28px rgba(42, 61, 32, 0.06);
    align-self: flex-start;
}

.vocab-right {
    flex: 1 1 0;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    border: 1px solid rgba(74, 112, 65, 0.12);
    padding: 18px;
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 243, 0.96));
    box-shadow: 0 14px 28px rgba(42, 61, 32, 0.06);
    min-height: 500px;
    width: auto;
    min-width: 0;
    align-self: flex-start;
    height: auto;
}

.vocab-right > * {
    width: 100%;
    min-width: 0;
}

.vocab-complete-note {
    margin: 12px 0 0;
    text-align: center;
    font-weight: 300;
    font-style: italic;
    color: #555;
}


#sentence-list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    max-height: 100%;
}

.sentence-item {
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.sentence-left {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1 1 auto;
    text-align: left;
}

.sentence-text {
    min-width: 0;
    text-align: left;
    word-break: break-word;
}

.sentence-item:hover {
    background: #f5f7fa;
}

.sentence-item.selected {
    background: #e3f2fd;
}

.sentence-item.learned {
    font-weight: normal;
}

#learning-card {
    text-align: center;
    display: grid;
    gap: 14px;
}

.placeholder-msg {
    margin: 0;
    padding: 22px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    color: #4d5867;
    border: 1px dashed rgba(74, 112, 65, 0.18);
}

.exercise-block {
    margin-top: 16px;
    padding: 16px;
    background: linear-gradient(180deg, #fbfcf8, #f7f9f2);
    border-radius: 16px;
    border: 1px solid rgba(74, 112, 65, 0.08);
    text-align: center;

}

.exercise-title {
    color:#000000;
		font-style: italic;
    margin-bottom: 0px!important;
}

.sentence-block {
    margin-top: 8px;
    text-align: center;
}
.korean-sentence {
	margin-top:10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    font-size: 19px;
	color: #02a231;
    margin-bottom: 5px!important;
    font-weight: bold;
}

.sentence-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.speech-rate-toggle {
    flex: 0 0 auto;
    border: 1px solid rgba(74, 112, 65, 0.18);
    background: #fff;
    color: #4a703c;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, border-color 0.2s;
}

.speech-rate-toggle:hover {
    background: #edf7e8;
    border-color: rgba(74, 112, 65, 0.28);
    transform: translateY(-1px);
}

.speech-rate-toggle:active {
    transform: translateY(0);
}

.speech-rate-toggle:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    transform: none;
}

.vietnamese-meaning {

    margin-bottom: 5px !important;
    color: #555;
}

#vocab-explanations {
    margin-bottom: 18px;
    text-align: center;
}

.vocab-word-explain {
    margin: 12px 0;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(74, 112, 65, 0.08);
}

.lesson-sentence-text {
    display: inline;
}

.lesson-sentence-audio,
.vocab-word-audio {
    margin-left: 0;
    flex: 0 0 auto;
    vertical-align: middle;
}

.vocab-line {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
}

.vocab-word {
    display: inline-block;
    background: #fff8d1;
    border: 1px solid #f0ad4e;
    padding: 4px 8px;
    margin-right: 8px;
    border-radius: 4px;
    font-weight: bold;
    color: #d35400;
}

.vocab-meaning {
    font-weight: normal;
    color: #333;
}

.vocab-explain {
    margin-top: 6px;
	margin-bottom: 20px
    color: #555;
    font-size: 16px;
}


.vocab-navigation {
    display: none;
    margin-top: auto;
    display: flex;
    justify-content: space-between;;
    gap: 12px;
    padding-top: 18px;
}

.nav-btn {
    position: relative;
    width: 42px;
    height: 42px;
    padding: 0;
    background: #fff;
    color: transparent;
    border-radius: 999px;
    border: 1px solid rgba(74, 112, 65, 0.14);
    cursor: pointer;
    font-weight: normal;
    transition: background 0.3s, transform 0.2s, border-color 0.2s;
    overflow: hidden;
    flex: 0 0 auto;
}

.nav-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px 18px;
}

#prev-sentence::before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%2333431e" stroke-width="2.3" stroke-linecap="round" stroke-linejoin="round"><path d="M15 18l-6-6 6-6"/><path d="M9 12h10"/></svg>');
}

#next-sentence::before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%2333431e" stroke-width="2.3" stroke-linecap="round" stroke-linejoin="round"><path d="M9 6l6 6-6 6"/><path d="M5 12h10"/></svg>');
}

.nav-btn:hover {
    background: #edf7e8;
    border-color: rgba(74, 112, 65, 0.24);
    transform: translateY(-1px);
}

.nav-btn:active {
    transform: translateY(0);
}


#play-audio, #record-speech {
    margin: 6px;
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    background: #4caf50;
    color: #fff;
    border: none;
    border-radius: 4px;
    transition: background 0.2s;
}

#play-audio:hover, #record-speech:hover {
    background: #43a047;
}

#speech-result {
    margin-top: 12px;
    font-weight: normal;
}

.item-number {
    margin-right: 6px;
    font-weight: normal;
    color: #777;
}

.highlight-vocab-pending {
    color: #fd6704;
    font-weight: normal;
}

.highlight-vocab-learned {
    color: #00bb2b;
    font-weight: normal;
}

.icon-audio {
    width: 22px;
    height: 22px;
    cursor: pointer;
    vertical-align: middle;
    margin-left: 6px;
    transition: transform 0.2s, opacity 0.2s;
    opacity: 0.8;
}

.icon-audio:hover {
    transform: scale(1.15);
    opacity: 1;
}

.icon-audio:active {
    transform: scale(0.9);
    opacity: 0.7;
}


#play-audio {
    display: none;
}

#record-speech {
    position: relative;
    padding-left: 36px !important; /* Chừa chỗ cho icon */
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 15px;
    font-size: 1em;
    cursor: pointer;
    display: inline-block;
    line-height: 1.4;
}

#record-speech::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
	margin-right: 5px;
    background: url('https://www.tuhoctienghan.vn/wp-content/uploads/2025/07/mic-1.png') center center no-repeat;
    background-size: contain;
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.9;
}

.status-indicator {
    display: inline-block;
    width: 18px;
    height: 18px;
    background-size: contain;
    background-repeat: no-repeat;
    vertical-align: middle;
    margin-left: 6px;
}

/* Trạng thái đã học */
.sentence-item.learned .status-indicator {
    background-image: url('https://www.tuhoctienghan.vn/wp-content/uploads/2025/07/check.png');
}


.record-btn {
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    margin-right: 10px;
}

.record-btn.green {
    background-color: #28a745;
}

.record-btn.green:hover {
    background-color: #218838;
}

.record-btn.red {
    background-color: #dc3545;
}

.record-btn.red:hover {
    background-color: #c82333;
}

#sentence-list .sentence-item {
    position: relative;
    padding-right: 28px;
}

#sentence-list .status-indicator {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
}

.record-section {
    margin-top: 20px;
    text-align: center;
}

#typing-answer {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    font-size: 16px;
}

.mic-container {
    width: 100%;
    min-height: 88px;
    margin: 0 auto;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

#lottie-mic {
    width: 40%;
    height: 76px;
    background: transparent;
    border-radius: 18px;
    overflow: hidden;
}

#lottie-mic svg {
    width: 100% !important;
    height: 100% !important;
    display: block;
}



@media (max-width: 768px) {
    .vocab-layout {
        flex-direction: column;
    }
    .vocab-left, .vocab-right {
        width: 100%;
    }
    .vocab-left {
        max-height: min(34vh, 280px);
        overflow-y: auto;
        margin-bottom: 16px;
    }
    .vocab-right {
        flex: 0 0 auto;
        align-self: stretch;
        height: auto;
        min-height: max-content;
        max-height: none;
        overflow: visible;
        padding: 14px;
    }
    #learning-card {
        gap: 12px;
    }
    .placeholder-msg {
        padding: 16px 14px;
    }
    .exercise-block,
    .typing-section,
    .recording-section {
        padding: 12px;
    }
    .sentence-row {
        gap: 8px;
    }
    .korean-sentence {
        font-size: 17px;
        white-space: normal;
    }
    .vocab-complete-note {
        margin-top: 8px;
        font-size: 0.94rem;
    }
    #sentence-list {
        max-height: none;
    }
    .sentence-item {
        display: block;
        padding: 10px;
        word-break: break-word;
    }
}


#text-input {
    flex: 1;
    padding: 8px 12px;
    font-size: 16px;
	font-weight:400;
    border: 1px solid #fff;
    border-radius: 6px;
}

.check-btn {
    background: #fff !important;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.check-btn img,
.check-btn svg {
    width: 20px;
    height: 20px;
}

.check-btn:hover {
    background: #22c55e;
}

.typing-section {
    background: #e3f2fd;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.recording-section {
    background: none !important;
    border-radius: 8px;
}

.record-controls {
    display: flex;
    align-items: center;
    gap: 14px;
    justify-content: space-between;
}

.record-controls .mic-container {
    flex: 1 1 auto;
    margin-top: 0;
}

.typing-area {
    display: flex;
    gap: 8px;
    margin-top: 10px;
	margin-bottom: 10px;
}

.typing-area input {
    flex: 1;
    padding: 8px;
}

.check-btn {
    background: #4caf50;
    color: #fff;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
}

.mic-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 88px;
    margin-top: 12px;
}

#speech-result {
    margin-top: 0;
    flex: 1 1 auto;
    min-width: 0;
}

.speech-feedback-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.voice-replay-btn {
    border: 1px solid rgba(74, 112, 65, 0.16);
    background: #fff;
    color: #4a703c;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, opacity 0.2s;
}

.voice-replay-btn:hover:not(:disabled) {
    background: #edf7e8;
    transform: translateY(-1px);
}

.voice-replay-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.speech-feedback-row .speech-transcript-line,
.speech-feedback-row .speaking-score-line {
    margin-bottom: 0 !important;
}

.speech-feedback-row .speech-transcript-line {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.speaking-score-line {
    display: grid;
    gap: 6px;
    justify-items: center;
    margin: 0;
}

.speaking-score-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 700;
}

.speaking-score-good .speaking-score-badge {
    color: #16a34a;
    background: rgba(34, 197, 94, 0.10);
}

.speaking-score-bad .speaking-score-badge {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.10);
}

.speaking-score-text {
    line-height: 1.45;
}

.speech-transcript-line {
    margin: 0 0 8px;
}

.speech-transcript-text {
    font-weight: 500;
    letter-spacing: 0.01em;
}

.speech-char-match {
    color: #16a34a;
    font-weight: 600;
}

.speech-char-mismatch {
    color: #ef4444;
    font-weight: 600;
}

.speech-char-missing {
    color: rgba(239, 68, 68, 0.55);
    font-weight: 600;
}

#highlight-result {
    display: none;
	margin-bottom: 5px;
}

.topic-intro {
    margin-bottom: 5px !important;
}

.topic-title {
    font-size: 18px;
	font-weight: bold;
	color: #22c55e;   /* Màu xanh lá giống Tailwind text-green-600 */

}

@media (max-width: 900px) {
    .topic-lesson-hero {
        grid-template-columns: 1fr;
    }

    .topic-lesson-progress {
        justify-items: stretch;
    }

    #vocab-statistics {
        text-align: left;
    }

    .topic-progress-row {
        justify-content: space-between;
        align-items: center;
        flex-direction: row;
        gap: 12px;
    }

    .vocab-learning-back-link {
        align-self: center;
        margin-left: auto;
        flex: 0 0 auto;
    }

    .vocab-layout {
        flex-direction: column;
    }

    #lottie-mic {
        width: 55%;
    }

    .vocab-left {
        flex-basis: auto;
        max-height: min(34vh, 280px);
        overflow: hidden;
        display: flex;
        flex-direction: column;
        margin-bottom: 16px;
    }

    .vocab-right {
        flex: 0 0 auto;
        align-self: stretch;
        height: auto;
        min-height: max-content;
        max-height: none;
        overflow: visible;
        padding: 14px;
    }

    #learning-card {
        gap: 12px;
    }

    .placeholder-msg {
        padding: 16px 14px;
    }

    .exercise-block,
    .typing-section,
    .recording-section {
        padding: 12px;
    }

    .sentence-row {
        gap: 8px;
    }

    .korean-sentence {
        font-size: 17px;
        white-space: normal;
    }

    .vocab-complete-note {
        margin-top: 8px;
        font-size: 0.94rem;
    }

    #sentence-list {
        max-height: none;
        overflow-y: auto;
    }
}
