/* Định dạng chung cho trang */
body {
    font-family: sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f4f4f4;
    flex-direction: column;
    margin: 0;
}

/* Định dạng container chính */
.container {
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    text-align: center;   
    width: 90%;
}

/* Định dạng phần câu */
#sentence {
    font-size: 24px;
    margin-bottom: 20px;
    display: none;
}

/* Định dạng khu vực input */
#input-area {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

/* Định dạng các từ và input box */
.word-container {
    display: flex;
    align-items: center;
    flex-direction: column;
    background-color: #f9f9f9;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.input-box {
    font-size: 18px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    width: 120px;
    text-align: center;
    transition: border-color 0.3s ease;
}

.input-box:focus {
    border-color: #4CAF50;
    outline: none;
}

.speaker-icon {
    font-size: 20px;
    color: #555;
    cursor: pointer;
    margin-top: 5px;
}

/* Định dạng phần kết quả */
#result {
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: bold;
}

/* Định dạng cho các nút và hiệu ứng */
.controls button {
    background-color: #4CAF50;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin: 0 10px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.controls button:hover {
    background-color: #45a049;
    transform: scale(1.05);
}

.controls button:disabled {
    background-color: #c1c1c1;
    cursor: not-allowed;
}

/* Định dạng hiển thị phần thống kê */
#correctCount, #totalCount, #correctPercentage {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

/* Thêm hiệu ứng và định dạng cho phần lịch sử */
.history-entry {
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.history-entry h5 {
    margin: 5px 0;
}

/* Định dạng bảng so sánh đúng/sai */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.comparison-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
    transition: background-color 0.3s ease;
}

/* Màu nền cho từ đúng */
.comparison-table .correct {
    background-color: #d4edda;
    color: #155724;
}

/* Màu nền cho từ sai */
.comparison-table .incorrect {
    background-color: #f8d7da;
    color: #721c24;
}
@keyframes highlightCorrect {
    from { background-color: #d4edda; }
    to { background-color: lightgreen; }
}

@keyframes highlightIncorrect {
    from { background-color: #f8d7da; }
    to { background-color: lightcoral; }
}

/* Định dạng bảng thống kê */
#sessionStatsTable {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 16px;
    text-align: left;
}

#sessionStatsTable th {
    background-color: #4CAF50;
    color: white;
    padding: 12px;
    border: 1px solid #ddd;
}

#sessionStatsTable td, #sessionStatsTable th {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
}

#sessionStatsTable tr:nth-child(even) {
    background-color: #f2f2f2;
}

#sessionStatsTable tr:hover {
    background-color: #ddd;
}

/* Định dạng cho các ô có phần trăm đúng */
#sessionStatsTable td.percent-correct {
    font-weight: bold;
    color: #4CAF50;
}

/* Định dạng phần thông tin thống kê */
.statistics-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.statistics-row span {
    font-weight: bold;
    color: #555;
    text-align: center;
    white-space: nowrap;
}

/* Định dạng điểm phần trăm */
#correctPercentage {
    font-size: 20px;
    font-weight: bold;
    color: #4CAF50;
    margin-top: 10px;
}
/* Style the history list table */
#history-list table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-family: Arial, sans-serif;
}

#history-list th,
#history-list td {
    padding: 10px;
    text-align: center;
    border: 1px solid #ddd;
}

#history-list th {
    background-color: #4CAF50; /* Header background */
    color: white;
    font-weight: bold;
}

#history-list td {
    background-color: #f9f9f9; /* Table cell background */
}

#history-list tr:nth-child(even) td {
    background-color: #f2f2f2; /* Alternating row color */
}

#history-list td span {
    padding: 3px;
    border-radius: 5px;
}

#history-list td span[style*="color: red"] {
    background-color: #ffe6e6; /* Background for incorrect words */
    color: red;
}

#history-list td span[style*="color: green"] {
    background-color: #e6ffe6; /* Background for correct words */
    color: green;
}
/* Định dạng biểu đồ */
#chart {
    margin-top: 20px;
    background-color: white;
    border-radius: 10px;
    padding: 15px;
}

/* Điểm phần trăm nổi bật */
#correctPercentage {
    font-size: 20px;
    font-weight: bold;
    color: #4CAF50;
    margin-top: 10px;
}
#spiderChart {
    margin: 20px auto;
    max-width: 400px;
}