/* Import font chữ từ Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap');

body {
    font-family: 'Open Sans', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f4f4f4; /* Màu nền nhạt, trung tính */
    flex-direction: column; /* Bố trí các phần tử theo chiều dọc */
    gap: 20px; /* Khoảng cách giữa các phần tử */
}

.container {
    background-color: white;
    padding: 30px;
    border-radius: 12px; /* Bo tròn góc nhiều hơn */
    text-align: center;
    width: 85%;
  
}

h1 {
    font-size: 2.5rem;
    color: #343a40; /* Màu xám đậm */
    text-align: center;
    margin-bottom: 2rem;
}

.question-area {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 1.4em;
    border: 1px solid #ddd; /* Thêm viền */
}

.input-area {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.input-area input {
    width: 150px;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px; /* Bo tròn góc input */
    font-size: 1em;
    transition: border-color 0.3s ease; /* Hiệu ứng chuyển đổi mượt mà */
}

.input-area input:focus {
    outline: none;
    border-color: #2196F3; /* Màu xanh khi focus */
}

.input-area button {
    padding: 12px 20px;
    background-color: #2196F3; /* Màu xanh chủ đạo */
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    font-size: 1em;
    transition: background-color 0.3s ease; /* Hiệu ứng chuyển đổi mượt mà */
}

.input-area button:hover {
    background-color: #1976D2; /* Màu xanh đậm hơn khi hover */
}

#result {
    margin-top: 15px;
    font-weight: 600;
    color: #4CAF50; /* Màu xanh lá cây khi đúng */
}

/* CSS cho bảng lịch sử */
#historyTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 1em;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Hiệu ứng đổ bóng */
}

#historyTable th, #historyTable td {
    padding: 12px;
    text-align: center;
    border: 1px solid #ddd;
}

#historyTable th {
    background-color: #2196F3; /* Màu xanh chủ đạo */
    color: white;
    font-weight: 600;
}

#historyTable tr:nth-child(even) {
    background-color: #f9f9f9;
}

#historyTable tr:hover {
    background-color: #e0e0e0; /* Màu xám nhạt khi hover */
}

/* CSS cho bảng thống kê */
#statsContainer {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 1em;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Hiệu ứng đổ bóng */
}

#statsContainer th, #statsContainer td {
    padding: 12px;
    text-align: center;
    border: 1px solid #ddd;
}

#statsContainer th {
    background-color: #FFC107; /* Màu vàng */
    color: black;
    font-weight: 600;
}

#statsContainer tr:nth-child(even) {
    background-color: #f9f9f9;
}

#statsContainer tr:hover {
    background-color: #e0e0e0; /* Màu xám nhạt khi hover */
}

/* Dòng trung bình tổng */
#statsContainer tr:last-child {
    background-color: #FFECB3; /* Màu vàng nhạt */
    font-weight: 600;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        width: 95%;
        padding: 20px;
    }

    .input-area {
        flex-direction: column; /* Xếp chồng input và button */
        gap: 10px;
    }

    .input-area input {
        width: 100%;
    }

    #historyTable, #statsContainer {
        font-size: 0.9em;
    }
}
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 16px;
    text-align: left;
}

table th, table td {
    padding: 12px 15px;
    border: 1px solid #ddd;
}

table th {
    background-color: #f2f2f2;
    color: #333;
}

table tr:nth-child(even) {
    background-color: #f9f9f9;
}

table tr:hover {
    background-color: #f1f1f1;
}

table td {
    vertical-align: top;
}