html, body {
    margin: 0;
    font-family: Arial, sans-serif;
}
* {
    box-sizing: border-box;
}

h1 {
    color: #1a3c6e;
    font-size: 1.5em;
    margin: 10px 0px;
}
.container {
    display: flex;
    justify-content: space-between;
}

.main-container{
    display: flex;
    flex-grow:1;
    gap:10px;
    padding: 9px;
}
.main {
    display:flex;
    flex-direction: column-reverse;
    padding: 11px;
    background-color: white;
    border: 2px solid #0066cc;
    border-radius: 5px;
    margin: 0 auto;
    max-height: 97vh;
    min-height: 97vh;
    width:72%;
}
.question-section{
    flex-grow:1;
}

.question {
    font-size: 15.5px;
    margin-bottom: 2px;
    font-weight:600;
    color:#e00e0e;
}
.question img {
    display:block;
    margin-top:10px;
    max-height:200px;
}
.options label {
    display: block;
    margin: 10px 0;
    font-size: 16px;
}
.sidebar {
    padding: 0 10px;
    background-color: white;
    border: 2px solid #0066cc;
    border-radius: 5px;
    text-align: center;
    display:flex;
    flex-direction:column;
    max-height: 97vh;
    min-height: 97vh;
    flex-grow:1;
}
.exam-time {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
    padding: 2px;
    background-color: #fff22329;
    border-radius:5px;
    gap:10px;
}
.timer-label {
    font-size: 17px;
    font-weight:600;
}
.timer {
    font-size: 22px;
    font-weight: bold;
    color: #0066cc;
}
.question-grid {
    margin-top: 5px;
    display: flex;
    gap: 1px;
    overflow-y: unset;
    flex-wrap: wrap;
    flex-direction: column;
    height: 85vh;
}
.question-box {
    border: 1px solid #ccc;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 14px;
    padding: 2px;
    box-sizing: border-box;
}

.question-box .question-number {
    font-size: 18px;
    font-weight: bold;
    margin-right: 2px;
    flex-grow: 1;
}
.question-box .options-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.question-box .answer-numbers {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    width: 100%;
    justify-items: center;
}
.question-box .answer-number {
    font-size: 14px;
    text-align: center;
}
.question-box .options-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    width: 100%;
    justify-items: center;
}
.question-box .option-label {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.question-box input[type="radio"] {
    margin: 0;
    width: 12px;
    height: 12px;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid #666;
    background-color: white;
    position: relative;
}
.question-box input[type="radio"]:checked::after {
    content: '✓';
    color: #0066cc;
    font-size: 12px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.unanswered {
    background-color: #ffd3d35c;
}
.current {
    background-color: #ff6666;
}
.answered {
    background-color: #99ff99;
}
.incorrect {
    background-color: #ff6666;
}
.critical-correct {
    background-color: #006400;
}
.critical-incorrect {
    background-color: #8B0000;
}
.current-review {
    background-color: #fff3cd !important;
}
.info-section {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding: 10px;
    background-color: #fff5e6;
    border: 2px solid #ff3333;
    border-radius: 4px;
    align-items: center;
    gap: 10px;
}
.avatar {
    width: 100px;
}
.avatar img {
    width: 100px;
}
.candidate-info {
    flex: 1;
}
.candidate-info p{
    padding:3px 5px;
    margin:0;
}
.inline-row {
    display: flex;
    gap: 2px;
}
/*.a-chon-loai-bang {
    margin: 10px 0;
    padding: 10px 20px;
    background-color: #0066cc;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    font-weight:600;
}*/
.newtest-btn, .submit-btn {
    margin: 7px 0;
    padding: 10px 20px;
    background-color: #0066cc;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    font-size: 18px;
    font-weight:600;
}
.newtest-btn{
    display:none;
}

/* Buttons */
.modal button {
    padding: 10px 20px;
    background-color: #0066cc;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.modal button:hover {
    background-color: #0055aa;
}

.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;
    display: grid;
    place-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-algin:left;
}

.modal-content label{
    margin: 10px 0;
}

.modal-content img{
    max-width: 100%;
    margin-top: 10px;
}

.modal-content h2{
    margin-top: 0;
    color: #0066cc;
}
.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    cursor: pointer;
}

.critical-question label {
    display: block;
    margin: 10px 0;
}

@media (max-width: 768px) {
    /* Layout */
    .main-container {
        display:flex;
        padding: 5px;
        flex-direction: column;
        gap: 10px;
    }

    .container {
        flex-direction: column;
        gap: 10px;
    }

    .main {
        min-width: 100%;
        padding: 10px;
        max-height: 65vh;
        min-height: 65vh;
    }
    
    .sidebar {
        min-width: 100%;
        overflow-y: auto;
        max-height: 23vh;
        min-height: 23vh;
    }

    .question-section{
        overflow-y: auto;
    }

    .question-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2px;
        overflow-y: auto;
        min-height: 0;
        display: grid
    }

    .question-box {
        padding: 5px;
    }

    .question-box .question-number {
        font-size: 18px;
        width: 20px;
    }

    .question-box input[type="radio"]:checked::after {
        font-size: 12px;
    }

    .info-section {
        margin-top: 10px;
    }

    .avatar, .logo {
        width: 100px;
    }a

    .submit-btn {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .question img {
        display: block;
        margin-top: 10px;
        max-width: 100%;
        max-height: 170px;
    }
    
    .avatar, .avatar img, .logo {
        width: 50px;
    }
    
        .timer {
        font-size: 20px;
    }
    
    .info-section{
        padding:5px;
    }
    h1{
        font-size: 1.1em;
    }
    
}