/* Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

body {
    font-family: 'Roboto', sans-serif;
    background-color: #f8f9fa; /* Màu nền nhạt, dịu mắt */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0; /* Loại bỏ margin mặc định */
}

.container {
    width: 85%;
    background-color: #ffffff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

h1 {
    font-size: 2.5rem;
    color: #343a40; /* Màu xám đậm */
    text-align: center;
    margin-bottom: 2rem;
}

/* Kiểu dáng cho phép tính */
#problem {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Kiểu dáng cho hỗn số */
.mixed-number {
    display: inline-flex;
    align-items: center;
    margin: 0 0.5rem; /* Khoảng cách giữa các hỗn số */
}

.whole-part {
    font-size: 1.8rem;
}

.fraction {
    display: inline-block;
    vertical-align: middle;
    text-align: center;
    font-size: 1.2rem;
    margin-left: 0.3rem;
}

.numerator {
    display: block;
    border-bottom: 1px solid #343a40; /* Gạch chân phân số */
    line-height: 1;
}

.denominator {
    display: block;
    line-height: 1;
}

/* Kiểu dáng cho input */
#answer {
    padding: 0.8rem;
    font-size: 1.2rem;
    border: 2px solid #ced4da; /* Màu xám nhạt */
    border-radius: 5px;
    width: 100%;
    max-width: 300px;
    box-sizing: border-box; /* Bao gồm padding vào chiều rộng */
    text-align: center;
}

#answer:focus {
    outline: none;
    border-color: #007bff; /* Màu xanh khi focus */
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25); /* Hiệu ứng shadow khi focus */
}

/* Kiểu dáng cho nút button */
button {
    padding: 0.8rem 1.5rem;
    font-size: 1.2rem;
    background-color: #28a745; /* Màu xanh lá cây */
    color: #ffffff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease; /* Hiệu ứng chuyển màu mượt mà */
}

button:hover {
    background-color: #218838; /* Màu xanh lá cây đậm hơn khi hover */
}

/* Kiểu dáng cho kết quả */
#result {
    font-size: 1.4rem;
    margin-top: 1.5rem;
    font-weight: 500;
}

/* Màu sắc cho kết quả đúng/sai */
.correct {
    color: #28a745;
}

.incorrect {
    color: #dc3545;
}

/* Bảng lịch sử */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2rem;
    font-size: 1rem;
}

th, td {
    border: 1px solid #dee2e6; /* Màu xám nhạt */
    padding: 0.8rem;
    text-align: center;
}

th {
    background-color: #e9ecef; /* Màu xám nhạt hơn */
    font-weight: bold;
}

/* Thống kê */
#statsDisplay {
    margin-top: 2rem;
    font-size: 1rem;
    text-align: right;
}

/* Responsive */
@media (max-width: 576px) {
    .container {
        width: 95%;
        padding: 20px;
    }

    h1 {
        font-size: 2rem;
    }

    #problem {
        font-size: 1.5rem;
    }

    .whole-part {
        font-size: 1.5rem;
    }

    .fraction {
        font-size: 1rem;
    }

    #answer {
        font-size: 1rem;
    }

    button {
        font-size: 1rem;
    }

    #result {
        font-size: 1.2rem;
    }

    th, td {
        font-size: 0.9rem;
        padding: 0.6rem;
    }
}