/* Import font chữ từ Google Fonts (tùy chọn) */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

body {
    font-family: 'Roboto', sans-serif; 
    background-color: #f8f8f8; /* Màu nền nhạt, dễ nhìn */
    color: #333; /* Màu chữ dễ đọc */
    line-height: 1.6; /* Khoảng cách dòng thoải mái */
}

.container {
    max-width: 960px; /* Giới hạn chiều rộng nội dung */
    margin: 20px auto; /* Căn giữa nội dung */
    padding: 30px; 
    background-color: #fff; 
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15); /* Hiệu ứng đổ bóng rõ ràng hơn */
    border-radius: 10px; 
}
h1 {
    font-size: 2.5rem;
    color: #343a40; /* Màu xám đậm */
    text-align: center;
    margin-bottom: 2rem;
}

/* Input và button */
.input-area {
    display: flex;
    align-items: center; 
    margin-bottom: 20px; 
}

.input-area input[type="text"] {
    flex: 1; 
    padding: 12px; 
    border: 1px solid #ddd; /* Màu viền nhạt hơn */
    border-radius: 5px 0 0 5px;
    margin-right: 10px; 
    font-size: 1em; /* Kích thước chữ bằng với nội dung khác */
}

.input-area button {
    background-color: #28a745; /* Màu xanh lá cây */
    color: white;
    padding: 12px 15px; 
    border: none; 
    border-radius: 5px; 
    cursor: pointer; 
    transition: background-color 0.3s; 
    font-size: 1em;
}

.input-area button:hover {
    background-color: #218838; /* Màu xanh lá cây đậm hơn */
}

.input-area button#checkBtn {
    margin-right: 10px; 
}

/* Kết quả */
#result {
    font-weight: bold;
    margin-top: 15px; 
    transition: opacity 0.5s ease-in-out;
    font-size: 1.2em;
}

.correct {
    color: #28a745; 
}

.incorrect {
    color: #dc3545; 
}

/* Công thức */
#formula {
    font-style: italic;
    color: #555;
    margin-top: 10px;
    font-size: 1em;
}

/* Điểm số */
#score {
    margin-top: 20px;
    font-size: 1.1em; /*  */
}

/* Lịch sử */
#history {
  margin-top: 30px; 
}

#history table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #ddd; /*  */
}

#history th, #history td {
  border: 1px solid #ddd;
  padding: 10px;
  text-align: left;
}

#history th {
  background-color: #f5f5f5; /* Màu nền nhạt hơn */
  font-weight: bold;
}

#history tr:nth-child(even) {
  background-color: #f9f9f9;
}

#history tr { 
  transition: background-color 0.3s; /* Thêm hiệu ứng chuyển tiếp */
}

#history tr:hover {
    background-color: #f5f5f5; /*  */
}

/* Thống kê */
#statsContainer {
    width: 100%;
    border-collapse: collapse;
    margin-top: 30px; 
    font-family: 'Roboto', sans-serif; /* Sử dụng cùng font chữ với body */
}

#statsContainer th, #statsContainer td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: center; 
}

#statsContainer th {
    background-color: #007bff; /* Màu xanh dương */
    color: white;
    font-weight: bold;
}

#statsContainer tr:nth-child(even) {
    background-color: #f2f2f2; 
}

#statsContainer tr:hover {
    background-color: #ddd; 
}

/* Dòng trung bình */
#statsContainer tr:last-child {
    background-color: #ffc107; /* Màu vàng */
    font-weight: bold; 
}

#statsContainer td {
    font-size: 1em; 
}

#statsContainer tr:last-child td {
    color: #000; 
}

/* Bảng chung */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 1em; 
    text-align: left; 
}

table th, table td {
    padding: 12px 15px;
    border: 1px solid #ddd; 
}

table th {
    background-color: #f5f5f5; 
    color: #333; 
    font-weight: bold;
}

table tr:nth-child(even) {
    background-color: #f9f9f9; 
}

table tr:hover {
    background-color: #f5f5f5; 
}

table td {
    vertical-align: top; 
}