
/* ==========================================
   VINASEN V7 - VOCABULARY PRACTICE
========================================== */

.practice-page {
    --green: #174c45;
    --gold: #d5a85b;
    --light: #f5f8f7;
    --border: #dce7e3;

    min-height: 85vh;
    padding: 40px 20px;
    background: var(--light);
    color: var(--green);
    font-family: "Times New Roman", serif;
}

.practice-page *,
.practice-page *::before,
.practice-page *::after {
    box-sizing: border-box;
}

.practice-page [hidden] {
    display: none !important;
}

.practice-container {
    max-width: 950px;
    margin: 0 auto;
}

.practice-page [lang="zh-Hant"] {
    font-family: "SimSun", "Microsoft JhengHei", serif;
}

.practice-page h2 {
    margin: 15px 0 20px;
}

.practice-page button,
.practice-page input,
.practice-page select {
    font-family: inherit;
}

.practice-page button {
    padding: 13px 18px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: white;
    color: var(--green);
    font-size: 17px;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.practice-page button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.practice-page button:not(:disabled):active {
    transform: scale(0.98);
}

.practice-page button:focus-visible,
.practice-page input:focus-visible,
.practice-page select:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 3px;
}

.practice-page .practice-primary {
    background: var(--green);
    border-color: var(--green);
    color: white;
    font-weight: bold;
}

.practice-page .practice-primary:hover:not(:disabled) {
    background: #24665d;
}

/* TIÊU ĐỀ */

.practice-heading {
    text-align: center;
    margin-bottom: 30px;
}

.practice-eyebrow {
    color: #a47b36;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 2px;
}

.practice-heading h1 {
    font-size: 40px;
    margin: 12px 0;
}

.practice-heading p {
    font-size: 18px;
    color: #64746e;
}

.practice-chinese {
    margin-top: 12px;
    font-size: 25px !important;
}

/* THỐNG KÊ */

.practice-overview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.overview-box {
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px 10px;
    text-align: center;
}

.overview-box strong {
    display: block;
    font-size: 32px;
    margin-bottom: 8px;
}

.overview-box span {
    color: #64746e;
}

#loadingStatus {
    padding: 20px;
    text-align: center;
}

/* DẠNG BÀI TẬP */

.practice-type-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.practice-page .practice-type {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    min-height: 155px;
    padding: 20px;
    text-align: left;
    border: 1px solid var(--border);
    border-radius: 15px;
}

.practice-type:hover {
    box-shadow: 0 8px 20px rgba(23,76,69,0.1);
}

.practice-type .type-icon {
    font-size: 30px;
}

.practice-type strong {
    font-size: 20px;
}

.practice-type small {
    font-size: 15px;
    color: #64746e;
    line-height: 1.5;
}

.practice-page .practice-type.active {
    background: var(--green);
    border-color: var(--green);
    color: white;
}

.practice-type.active small {
    color: #e8f1ee;
}

/* CÀI ĐẶT */

.practice-settings,
.practice-history,
.review-section {
    padding: 25px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    margin-bottom: 25px;
}

.practice-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.practice-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.practice-field label {
    font-size: 17px;
    font-weight: bold;
}

.practice-field select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccd9d4;
    border-radius: 8px;
    background: white;
    color: var(--green);
    font-size: 17px;
}

.practice-options {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin: 22px 0;
}

.practice-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.practice-options input {
    width: 18px;
    height: 18px;
    accent-color: var(--green);
}

#availableWords {
    color: #64746e;
    margin-bottom: 18px;
    line-height: 1.6;
}

#startBtn {
    width: 100%;
    padding: 16px;
    font-size: 19px;
}

/* LỊCH SỬ */

.history-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.history-summary > div {
    background: var(--light);
    border-radius: 10px;
    padding: 15px 8px;
    text-align: center;
}

.history-summary strong {
    display: block;
    font-size: 25px;
    margin-bottom: 5px;
}

.history-summary span {
    font-size: 14px;
    color: #64746e;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
}

.history-item p {
    color: #64746e;
    font-size: 14px;
    margin-top: 5px;
}

#clearHistory {
    margin-top: 18px;
    color: #777;
}

/* MÀN HÌNH CÂU HỎI */

.quiz-toolbar,
.quiz-progress-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 15px;
}

#quizTimer {
    font-size: 20px;
    font-variant-numeric: tabular-nums;
}

.quiz-progress-track {
    height: 8px;
    background: var(--border);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 20px;
}

#quizProgress {
    height: 100%;
    width: 0;
    background: var(--green);
    transition: width 0.3s ease;
}

.question-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;

    min-height: 260px;
    padding: 35px 25px;
    border-radius: 22px;

    background: var(--green);
    color: white;
    text-align: center;

    box-shadow: 0 12px 30px rgba(23,76,69,0.12);
}

#questionType {
    color: var(--gold);
    font-size: 14px;
    letter-spacing: 1px;
}

#questionInstruction {
    font-size: 18px;
}

#questionText {
    font-size: clamp(26px, 5vw, 48px);
    line-height: 1.5;
    margin: 0;
    overflow-wrap: anywhere;
}

#questionPinyin {
    font-size: 24px;
    color: var(--gold);
}

#questionZhuyin {
    font-size: 23px;
}

#listenBtn {
    background: white;
    color: var(--green);
    font-size: 19px;
}

/* ĐÁP ÁN TRẮC NGHIỆM */

.answer-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 25px 0;
}

.practice-page .answer-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px;
    text-align: left;
    font-size: 20px;
}

.answer-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    flex-shrink: 0;
    border-radius: 8px;
    background: #e8f1ee;
    font-size: 16px;
    font-weight: bold;
}

.answer-value {
    overflow-wrap: anywhere;
}

.answer-option:hover:not(:disabled) {
    background: #e8f1ee;
    border-color: var(--green);
}

.practice-page .answer-option.correct {
    background: #e6f5eb;
    border-color: #27865b;
    color: #17653e;
    opacity: 1;
}

.practice-page .answer-option.wrong {
    background: #fff0ed;
    border-color: #c85b4c;
    color: #a83c2f;
    opacity: 1;
}

/* NHẬP CHỮ HÁN */

#typingArea {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 25px 0;
}

#typingAnswer {
    width: 100%;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: white;
    color: var(--green);
    text-align: center;
    font-size: 28px;
}

/* NỐI TỪ */

.matching-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin: 25px 0;
}

#matchingChinese,
#matchingVietnamese {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.practice-page .matching-button {
    min-height: 85px;
    font-size: 21px;
    overflow-wrap: anywhere;
}

.practice-page .matching-button.selected {
    background: var(--green);
    color: white;
}

.practice-page .matching-button.matched {
    background: #e6f5eb;
    color: #27865b;
    border-color: #27865b;
    opacity: 0.75;
}

.practice-page .matching-button.mismatch {
    background: #fff0ed;
    border-color: #c85b4c;
}

/* PHẢN HỒI */

.feedback-area {
    padding: 22px;
    margin: 20px 0;
    background: white;
    border: 1px solid var(--border);
    border-left: 5px solid var(--green);
    border-radius: 12px;
}

.feedback-area.incorrect {
    border-left-color: #c85b4c;
}

.feedback-area h3 {
    margin-bottom: 15px;
    font-size: 22px;
}

.feedback-detail {
    padding: 12px 0;
    line-height: 1.8;
    border-bottom: 1px solid var(--border);
}

.feedback-detail strong[lang="zh-Hant"] {
    font-size: 26px;
}

.feedback-detail p {
    font-size: 18px;
    overflow-wrap: anywhere;
}

.feedback-detail button {
    margin-top: 10px;
}

.quiz-actions {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin: 20px 0;
}

#nextBtn {
    margin-left: auto;
}

/* KẾT QUẢ */

.result-card {
    padding: 35px 25px;
    text-align: center;
    background: white;
    border: 1px solid var(--border);
    border-radius: 20px;
    margin-bottom: 25px;
}

.result-card h2 {
    font-size: 30px;
}

.score-circle {
    width: 165px;
    height: 165px;
    border: 10px solid #e8f1ee;
    border-top-color: var(--green);
    border-right-color: var(--green);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 25px auto;
}

.score-circle strong {
    font-size: 42px;
}

.score-circle span {
    color: #64746e;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 25px 0;
}

.result-stats > div {
    padding: 20px 10px;
    border-radius: 12px;
    background: var(--light);
}

.result-stats strong {
    display: block;
    font-size: 32px;
    margin-bottom: 8px;
}

#resultCorrect {
    color: #27865b;
}

#resultWrong {
    color: #b34b3c;
}

#resultSkipped {
    color: #a47b36;
}

.result-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 25px;
}

.review-item {
    padding: 18px 0;
    border-bottom: 1px solid var(--border);
}

.review-item h3 {
    margin-bottom: 8px;
}

.review-item p {
    line-height: 1.7;
    overflow-wrap: anywhere;
}

/* CUỐI TRANG */

.practice-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
}

.practice-bottom a {
    color: var(--green);
    text-decoration: none;
    font-weight: bold;
}

.practice-footer {
    padding: 30px 15px;
    text-align: center;
    background: #174c45;
    color: white;
    line-height: 1.8;
    font-family: "Times New Roman", serif;
}

/* ĐIỆN THOẠI */

@media (max-width: 650px) {

    .practice-page {
        padding: 25px 12px;
    }

    .practice-heading h1 {
        font-size: 29px;
    }

    .practice-type-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .practice-page .practice-type {
        padding: 15px;
        min-height: 145px;
    }

    .practice-type strong {
        font-size: 18px;
    }

    .practice-filter-grid {
        grid-template-columns: 1fr;
    }

    .practice-settings,
    .practice-history,
    .review-section {
        padding: 18px;
    }

    .practice-overview {
        gap: 8px;
    }

    .overview-box strong {
        font-size: 25px;
    }

    .question-card {
        min-height: 220px;
        padding: 25px 15px;
    }

    .matching-grid {
        gap: 10px;
    }

    .practice-page .matching-button {
        font-size: 17px;
        padding: 12px;
    }

    .practice-page .answer-option {
        font-size: 18px;
        padding: 14px;
    }

}

@media (prefers-reduced-motion: reduce) {

    .practice-page *,
    .practice-page *::before,
    .practice-page *::after {
        transition: none !important;
        animation: none !important;
    }

}
