/* Global Styles */
html, body {
    margin: 0;
    height: 100%;
    font-family: Arial, sans-serif;
}

h1, h2, h3, h4, h5, h6{
    color: #1a3c6e;
}

h1 {
    font-size: 2.8em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    flex-grow: 1;
}

h2 {
    font-size: 1.7em;
    margin: 15px 0;
}

p {
    font-size: 1.2em;
    margin-bottom: 25px;
    max-width: 800px;
}

/* Layout */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.section {
    margin-bottom: 40px;
    text-align: center;
}

.section p{
    color: #4a5568;
    min-width: 100%;
}

.latest-test span, .question-table span{
    color: #004da0;
    text-decoration: none;
    transition: color 0.2s;
    display:inline;
}

.latest-test span:hover, .question-table span:hover{
    color: #0056b3;
    cursor: pointer;
}

/* Home Section */
.advantages-section {
    background: #f8f9fa;
    padding: 40px 20px;
    border-radius: 10px;
    margin-bottom: 40px;
    text-align: center;
}

.advantages-section h2 {
    font-size: 2em;
    color: #1a3c6e;
    margin-bottom: 15px;
}

.advantages-section p {
    font-size: 1.2em;
    color: #4a5568;
    margin-bottom: 30px;
}

.advantages-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    justify-content: center;
}

.advantage-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

.advantage-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 123, 255, 0.2);
}

.advantage-icon {
    margin-bottom: 10px;
    max-width: 100%;
}

.advantage-item h3 {
    font-size: 1.3em;
    color: #1a3c6e;
    margin-bottom: 10px;
}

.advantage-item p {
    font-size: 1em;
    color: #4a5568;
    margin: 0;
}

/* License List */
.license-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(225px, 1fr));
    gap: 15px;
    justify-content: center;
    margin-bottom: 50px;
}

.license-list a {
    text-decoration: none;
}

.license-button {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #007bff, #00c4ff);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
    min-height: 160px;
}

.license-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 123, 255, 0.5);
    background: linear-gradient(135deg, #0056b3, #0099cc);
}

.license-description {
    margin-top: 10px;
    max-width: 90%;
    text-align: center;
    color: #e6f0ff;
}

.license-description h2 {
    font-weight: 600;
    color: #fff;
}

.license-description p {
    font-size: 1.1em;
    margin: 4px 0;
    line-height: 1.3;
    color: #fff;
    font-weight: 500 !important;
}

/* Most Incorrect Section */
.most-incorrect-section {
    margin-top: 30px;
}

/*Review questions*/

.review-section {
    margin: 20px 0;
}
.review-header {
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.load-more-wrapper {
    text-align: center;
    margin-top: 20px;
}
.load-more-btn {
    padding: 10px 20px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}
.load-more-btn:hover {
    background-color: #0056b3;
}

.question-table ul{
    list-style:none;
    padding: 0;
}

.question-table img{
    display:block;
    max-width: 401px;
    margin-top:10px;
}

.question-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.question-table th,
.question-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

.question-table th {
    background-color: #0066cc;
    color: white;
}

.question-table tr:nth-child(even), table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.question-table tr:hover, table tr:hover  {
    background-color: #e6f3ff;
}

.question-table .correct-answer{
    font-weight:600;
    text-decoration:underline;
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd;
    gap: 5px;
}

.tab-nav button {
    padding: 10px 20px;
    font-size: 16px;
    background-color: #f4f7fa;
    color: #333;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    margin: 0 5px;
    border-radius: 5px 5px 0 0;
}

.tab-nav button.active {
    background-color: #007bff;
    color: white;
    font-weight: 600;
}

.tab-nav button:hover:not(.active) {
    background-color: #e0e7ff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overscroll-behavior: contain;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    width: 80%;
    min-width: 300px;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-sizing: border-box;
    will-change: transform;
    text-align: left;
}

.modal-content label {
    margin: 10px 0;
}

.modal-content img {
    max-width: 100%;
    margin-top: 10px;
    display:block;
}

.modal-content h2 {
    margin-top: 0;
    color: #0066cc;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    cursor: pointer;
}

/* Question */
.question {
    font-size: 15.5px;
    margin-bottom: 2px;
    font-weight: 600;
    color: #e00e0e;
}

.critical-question h2 {
    margin-top: 0;
    color: #0066cc;
}

.critical-question label {
    display: block;
    margin: 10px 0;
}


/* Forms */
textarea,
input[type="text"],
input[type="number"],
input[type="password"],
select {
    width: 100%;
    padding: 8px;
    margin: 5px 0;
}

.btn-primary {
    display: inline-block;
    padding: 10px 20px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1em;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #0056b3;
}

.back-btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #0066cc;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 16px;
}

.back-btn:hover {
    background-color: #0055aa;
}

/* Login Container */
.login-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

/* Error */
.error {
    color: red;
    margin-bottom: 10px;
}

.error-section {
    text-align: center;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.error-section h1 {
    font-size: 2.5em;
    color: #d9534f;
    margin-bottom: 20px;
}

.error-section p {
    font-size: 1.1em;
    color: #333;
    margin-bottom: 15px;
}

.history-section .history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #0066cc;
    flex-wrap: wrap; /* Cho phép các phần tử xuống dòng */
    gap: 10px;
}

.history-section h2 {
    flex-grow: 1;
}

.history-section .header a {
    flex-grow: 1;
}
/* Latest Test */
.latest-test {
    background-color: #e6f3ff;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.latest-test p {
    margin: 5px 0;
}

.table-wrapper {
    overflow-x: auto;
}
.progress-info {
    margin: 20px 0;
    padding: 15px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.progress-item {
    margin-bottom: 15px;
}

.progress-item label {
    display: block;
    font-size: 16px;
    margin-bottom: 5px;
}

.progress-item label strong {
    color: #333;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background-color: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.progress {
    height: 100%;
    background-color: #28a745;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    /*justify-content: flex-end;*/
    justify-content: center;
    /*padding-right: 10px;*/
}

.progress-text {
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
}
/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
    /* Global */
    html, body {
        overflow-y: auto;
        height: auto;
    }

    h1 {
        font-size: 2.2em;
    }

    h2 {
        font-size: 1.6em;
    }

    p {
        font-size: 1.1em;
    }
    
    .question-table img{
        max-width: 100%;
    }

    /* Components */
    .advantages-section {
        padding: 30px 15px;
    }

    .advantages-section h2 {
        font-size: 1.8em;
    }

    .advantages-section p {
        font-size: 1.1em;
    }

    .advantages-list {
        grid-template-columns: 1fr;
    }

    .advantage-item {
        padding: 15px;
    }

    .license-list {
        grid-template-columns: repeat(auto-fit, minmax(150px, 2fr));
        gap: 15px;
    }

    .license-button {
        font-size: 1.3em;
        padding: 15px;
        min-height: 140px;
    }

    .license-description p {
        font-size: 0.8em;
    }

    .incorrect-table th,
    .incorrect-table td {
        padding: 8px;
        font-size: 0.9em;
    }

    .tab-nav {
        overflow-y: scroll;
        scrollbar-width: none;
    }

    .modal-content {
        width: 90%;
        max-height: 85vh;
        margin: auto;
    }

    .back-btn {
        text-align: center;
        flex-grow:1;
    }
    
    .history-section .history-header {
        border-bottom:none;
    }

}

@media (max-width: 480px) {
    /* Global */
    h1 {
        font-size: 1.8em;
    }

    h2 {
        font-size: 1.4em;
    }

    p {
        font-size: 1em;
    }

    /* Layout */
    .main-container {
        padding: 20px 15px;
    }

    /* Components */
    .advantages-section {
        padding: 20px 10px;
    }

    .advantages-section h2 {
        font-size: 1.6em;
    }

    .advantages-section p {
        font-size: 1em;
    }

    .advantage-item h3 {
        font-size: 1.2em;
    }

    .advantage-item p {
        font-size: 0.9em;
    }

    .license-button {
        font-size: 1.2em;
        padding: 12px;
        min-height: 130px;
    }

    .license-description p {
        font-size: 0.75em;
        margin: 3px 0;
    }

    .incorrect-table th,
    .incorrect-table td {
        padding: 6px;
        font-size: 0.8em;
    }

    .question-box .question-number {
        font-size: 16px;
        width: 18px;
    }

    .question-box .answer-number {
        font-size: 12px;
    }

    .question-box input[type="radio"]:checked::after {
        font-size: 18px;
    }

    .question img {
        display: block;
        margin-top: 10px;
        max-width: 100%;
        max-height: 170px;
    }

    .latest-test p {
        font-size: 14px;
    }
}