/* Tổng quan */
body {
    font-family: 'Roboto', sans-serif;
    background-color: #f7f9fc; /* Màu nền nhẹ nhàng */
    margin: 0;
    padding: 0;
    color: #333; /* Màu chữ dễ đọc */
    line-height: 1.6;
}

header {
    background-color: #2d89ef; /* Màu xanh chuyên nghiệp */
    color: white;
    padding: 20px;
    text-align: center;
    text-transform: uppercase;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

h2 {
    color: #2d89ef;
    font-size: 24px;
    text-align: center;
    margin-top: 20px;
    text-transform: uppercase;
}

/* Container chính */
main {
    margin: 20px auto;
    padding: 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    max-width: 1200px;
}

/* Countdown Timer */
#countdownTimer {
    font-size: 36px;
    font-weight: bold;
    color: #ff3333;
    background-color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    text-align: center;
    margin: 20px auto;
    width: 200px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Bài tập */
.exercise-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.exercise-item {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 20px;
    width: calc(100% - 20px); /* 3 bài mỗi hàng */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
}

.exercise-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.exercise-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #2d89ef;
}

.exercise-item img {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease; /* Hiệu ứng chuyển động */
    filter: grayscale(100%); /* Hiển thị trắng đen */
}

.exercise-item img:hover {
    transform: scale(1.05); /* Phóng to khi hover */
    filter: grayscale(100%); /* Hiển thị đầy đủ màu sắc khi hover */
}


/* Đáp án */
.solution {
    display: none;
    padding: 10px;
    margin-top: 15px;
    background-color: #f1f8ff;
    border-radius: 8px;
    text-align: center;
}

.solution-text {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    background-color: #2d89ef;
    padding: 5px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    display: block;
}

/* Nút */
button {
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
}

button:hover {
    transform: translateY(-3px);
}


.button-container {
    display: flex; /* Sử dụng flexbox để căn hàng ngang */
    justify-content: center; /* Căn giữa các nút */
    gap: 10px; /* Khoảng cách giữa các nút */
    margin-top: 10px; /* Khoảng cách phía trên container */
}

.button-correct,
.button-wrong {
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 8px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
}

/* Nút "Làm đúng" */
.button-correct {
    background-color: #28a745; /* Màu xanh lá */
    color: white;
}

.button-correct:hover {
    background-color: #218838;
}

/* Nút "Làm sai" */
.button-wrong {
    background-color: #dc3545; /* Màu đỏ */
    color: white;
}

.button-wrong:hover {
    background-color: #c82333;
}

/* Nút bị vô hiệu hóa */
button.disabled {
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
}

.retry-button {
    background-color: #ffc107; /* Màu vàng */
    color: black;
    padding: 8px 16px;
    font-size: 14px;
	display: block;
	    float: right;

}

.retry-button:hover {
    background-color: #e0a800;
}

button.disabled {
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
}

/* Bảng thống kê */
#statsTable {
    width: 100%;
    margin: 20px auto;
    border-collapse: collapse;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#statsTable th {
    background-color: #2d89ef;
    color: white;
    padding: 15px;
    font-size: 16px;
    text-transform: uppercase;
}

#statsTable td {
    padding: 12px;
    text-align: center;
    border: 1px solid #ddd;
}

#statsTable tr:nth-child(even) {
    background-color: #f9f9f9;
}

#statsTable tr:hover {
    background-color: #f1f1f1;
}

/* Biểu đồ */
canvas {
    margin-top: 30px;
    max-width: 100%;
}

/* Nút refresh */
#refreshButton {
    background-color: #17a2b8;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 16px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin: 20px 0;
}

#refreshButton:hover {
    background-color: #138496;
}
.exercise-title h4 {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
}

.exercise-title a {
    color: #007bff;
    text-decoration: none;
}

.exercise-title a:hover {
    text-decoration: underline;
}
/* CSS styles for the stats area */
.stats-area {
    flex: 1; /* Chia sẻ không gian với exercise-area */
    margin-left: 20px; /* Khoảng cách với exercise-area */
}

.stats-area h2 {
    margin-bottom: 10px; /* Khoảng cách với bảng */
}

#statsTable {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px; /* Khoảng cách với biểu đồ */
}

#statsTable th, #statsTable td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

#practiceChart {
    width: 100%;
    height: 300px; /* Điều chỉnh chiều cao biểu đồ */
    margin-bottom: 20px; /* Khoảng cách với danh sách đã luyện */
}

.viewed-list {
    margin-top: 20px;
}

#resultsTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px; /* Khoảng cách với tiêu đề */
}

#resultsTable th, #resultsTable td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}
#resultsTable a { /* Áp dụng cho tất cả các thẻ <a> trong bảng resultsTable */
    color: #007bff; /* Màu xanh dương mặc định cho liên kết */
    text-decoration: none; /* Loại bỏ gạch chân */
}

#resultsTable a:hover { /* Hiệu ứng khi di chuột qua liên kết */
    text-decoration: none;
}
#spiderChart {
    margin: 20px auto;
    display: block;
    max-width: 100%;
    height: auto;
}

.progress-bar-container {
    width: 100%;
    background-color: #9d9494;
    border: 1px solid #ccc;
    border-radius: 4px;
    height: 20px;
    position: relative;
}

.progress-bar {
    height: 100%;
    border-radius: 4px;
    text-align: center;
    line-height: 20px;
    color: white;
}
