
/* CSS bổ sung cho trang Phát Âm, vẫn dùng biến từ quiz_game.css */

/* Đồng bộ container style */
#pronunciation-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
    background: var(--white);
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.pron-header {
    text-align: center;
    margin-bottom: 20px;
}

.pron-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary);
    /* Dùng màu Vàng cho tiêu đề chính */
    margin-bottom: 10px;
}

/* Vùng nhập liệu và nút bấm */
.input-area {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

#text-to-speak {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border-radius: 15px;
    border: 3px solid #ccc;
    font-size: 1.1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
}

#text-to-speak:focus {
    outline: none;
    border-color: var(--secondary);
}

.pron-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.btn-listen,
.btn-save {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-listen {
    background: var(--secondary);
    color: var(--white);
    box-shadow: 0 4px 0 #0084b4;
}

.btn-listen:active {
    transform: translateY(4px);
    box-shadow: none;
}

.btn-save {
    background: var(--accent);
    color: var(--white);
    box-shadow: 0 4px 0 #c7860e;
}

.btn-save:active {
    transform: translateY(4px);
    box-shadow: none;
}

.btn-listen:disabled,
.btn-save:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Vùng Status & Result */
.status-area,
.result-area {
    padding: 15px 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    font-weight: bold;
    min-height: 60px;
    display: flex;
    align-items: center;
}

.status-area {
    background-color: #ffe0b2;
    /* Màu cam nhạt */
    color: #e65100;
    /* Màu cam đậm */
    border: 2px solid var(--accent);
}

.result-area {
    background-color: #e1f5fe;
    /* Màu xanh nhạt (giống question-card) */
    border: 3px solid var(--secondary);
    font-size: 1.3rem;
    line-height: 1.6;
    display: block;
    /* Cho phép wrap từ */
    text-align: left;
}

/* Màu sắc đánh giá phát âm */
.word-correct {
    color: var(--success);
    /* Xanh lá */
    font-weight: 800;
}

.word-near {
    color: var(--accent);
    /* Cam/Vàng */
    font-weight: 700;
}

.word-wrong {
    color: var(--danger);
    /* Đỏ */
    font-weight: 700;
    text-decoration: underline;
}

.word-spacing {
    margin-right: 0.3em;
    white-space: pre;
    /* Giữ khoảng trắng giữa các từ */
}

/* Bảng Câu Mẫu */
.sample-sentences-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed #ccc;
}

.section-title {
    font-size: 1.5rem;
    color: var(--text);
    margin-bottom: 15px;
    font-weight: 800;
}

.sample-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
    /* Khoảng cách giữa các hàng */
}

.sample-table th,
.sample-table td {
    padding: 12px 15px;
    text-align: left;
}

.sample-table th {
    background-color: var(--f0f8ff);
    color: var(--secondary);
    font-size: 1rem;
    font-weight: 800;
    border-bottom: 2px solid var(--secondary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.sample-table td {
    background-color: #f8f8f8;
    border: 1px solid #eee;
    border-radius: 8px;
    vertical-align: top;
}

.sample-table tr:hover td {
    background-color: #fff8e1;
    /* Giống hover của option-btn */
}

.sample-table .action-col {
    width: 100px;
    text-align: center;
}

.btn-use {
    background: var(--primary);
    color: var(--text);
    padding: 6px 12px;
    border: none;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-use:hover {
    opacity: 0.8;
}

@media (max-width: 600px) {
    #pronunciation-container {
        margin: 20px auto;
        padding: 15px;
    }

    .pron-title {
        font-size: 1.8rem;
    }

    .pron-actions {
        flex-direction: column;
    }

    /* Tối ưu hiển thị bảng trên mobile, KHÔNG ẨN cột nữa */
    .sample-table th,
    .sample-table td {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
}

/* Modal yêu cầu đăng nhập */
.ek-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.ek-hidden {
    display: none !important;
}

.ek-modal-content {
    background: #fff;
    border-radius: 20px;
    padding: 20px 24px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.ek-modal-content h3 {
    margin-bottom: 10px;
    font-size: 1.4rem;
    color: var(--secondary);
}

.ek-modal-content p {
    font-size: 1rem;
    margin-bottom: 18px;
}

.ek-modal-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.ek-btn-primary,
.ek-btn-secondary {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.ek-btn-primary {
    background: var(--primary);
    color: var(--text);
}

.ek-btn-secondary {
    background: #eee;
    color: var(--text);
}

/* Hiển thị chi tiết điểm + câu */
.pron-score {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.pron-detail {
    margin-top: 5px;
}

.pron-detail .word-spacing {
    white-space: pre-wrap;
}

.sample-table td.sample-text-cell {
    cursor: pointer;
}

.sample-table td.sample-text-cell:hover {
    background-color: #fff8e1;
    /* cùng màu hover cho dễ thấy */
}

