@keyframes circleAnimation {
    0% {
        stroke-dasharray: 0 100;
    }
    100% {
        stroke-dasharray: 100 100;
    }
}

.answer-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-right: 10px;
    position: relative;
}

.answer-letter span {
    z-index: 1;
}

.answer-letter svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.answer-letter circle {
    fill: none;
    stroke: #007bff;
    stroke-width: 2;
    stroke-linecap: round;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.body_exercise input[type='radio'] {
    display: none;
}

input[type='radio']:checked + label .answer-letter circle {
    opacity: 1;
    animation: circleAnimation 0.3s ease-in-out forwards;
}

.form-option label {
    cursor: pointer;
}

.form-option label:hover {
    color: #007bff;
}

.form-option label,
.exe-question {
    font-size: 18px;
}

.practice-header {
    background-color: #043555;
    display: flex;
    justify-content: space-between;
    padding-inline: 15px;
}

.practice-header .header-right {
    display: flex;
    align-items: center;
    gap: 30px;
}

.practice-header .header-right .button {
    background-color: #f97630;
    padding: 10px 30px;
    border-radius: 5px;
    cursor: pointer;
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    margin: 0;
}

.practice-header .header-right .username {
    color: #fff;
    font-size: 32px;
}

.practice-header .item-wrapper {
    box-sizing: border-box;
    width: 50px;
    height: 50px;
    padding: 13px;
    border-radius: 5px;
    background: #63acf5;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    cursor: pointer;
}

.practice-header .item-wrapper span {
    width: 6px;
    height: 6px;
    margin: 0 1px;
    border-radius: 50%;
    background: #FFFFFF;
}

.body_exercise {
    background-color: #f9f9f9;
    border: 1px solid #ccc;
    padding: 15px;
    user-select: none;
}

.body_exercise .page_exercise {
    background-color: #f9f9f9;
    border: 1px solid #ccc;
    padding: 15px;
}

.body_exercise .title-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    margin-bottom: 15px;
}

.body_exercise h1 {
    margin: 0;
}

.body_exercise .click-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 30px;
}

.body_exercise .click-btn .button {
    background-color: #015086;
    color: #fff;
    width: 140px;
    height: 50px;
    display: flex;
    gap: 10px;
    align-items: center;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 700;
    justify-content: center;
    margin: 0;
    padding: 0;
}

.body_exercise .title-top .btn-test .result {
    background: #f97630;
    width: 100px;
    height: 50px;
    line-height: 50px;
    text-align: center;
    border-radius: 5px;
    color: #fff;
    font-weight: 700;
}

.body_exercise .exe-pro {
    display: flex;
    gap: 15px;
}

.body_exercise .exe-pro .exe-question,
.body_exercise .exe-pro .exe-answers {
    background-color: #fff;
    padding: 15px;
    height: 500px;
    flex-basis: 50%;
    max-width: 50%;
    overflow-y: auto;
}

.body_exercise .explanation {
    display: inline-block;
}

.button.disable {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.popup {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.popup-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 0px;
    right: 10px;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

#question-index-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.question-index {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ccc;
    cursor: pointer;
}

.question-index.answered {
    background-color: #007bff;
    color: white;
}

#result-popup .popup-content {
    text-align: center;
}

#view-answers-btn,
#back-btn {
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#view-answers-btn:hover {
    background-color: #0056b3;
}

.choice.correct {
    background-color: #4CAF50;
    color: white;
}

.choice.incorrect {
    background-color: #F44336;
    color: white;
}

.explanation {
    margin-top: 20px;
    padding: 10px;
    background-color: #f0f0f0;
    border-left: 5px solid #4CAF50;
}

.explanation p {
    margin-bottom: 0;
}

.question-index.correct {
    background-color: #4CAF50;
    color: white;
}

.question-index.incorrect {
    background-color: #F44336;
    color: white;
}

.custom-radio {
    display: none;
}

.choice {
    margin-bottom: 10px;
}

.choice label {
    display: flex !important;
    align-items: center;
    cursor: pointer;
}

.radio-button {
    width: 20px;
    height: 20px;
    border: 2px solid #007bff;
    border-radius: 50%;
    margin-right: 10px;
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}

.radio-button::after {
    content: '';
    width: 12px;
    height: 12px;
    background-color: #007bff;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.2s ease-in-out;
}

.custom-radio:checked + label .radio-button::after {
    transform: translate(-50%, -50%) scale(1);
}

.answer-text {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.answer-letter {
    font-weight: bold;
    margin-right: 10px;
    width: 25px;
    height: 25px;
    background-color: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

@media screen and (max-width: 768px) {
    .practice-header {
        flex-wrap: wrap;
    }

    .practice-header .header-right {
        justify-content: space-between;
        width: 100%;
    }

    .practice-header .header-right {
        margin-bottom: 10px;
    }

    .practice-header .header-right .button,
    .practice-header .header-right .username {
        font-size: 14px;
    }

    .practice-header .header-right .button {
        padding: 0 10px;
    }

    .practice-header .item-wrapper {
        width: 36px;
        height: 36px;
        padding: 9px;
    }

    .practice-header .item-wrapper span {
        width: 4px;
        height: 4px;
    }

    .practice-header .username {
        position: absolute;
        top: 25px;
        right: 15px;
    }

    .exe-pro {
        flex-wrap: wrap;
    }

    .exe-pro > div {
        flex-basis: 100% !important;
        max-width: 100% !important;
        background-color: transparent !important;
        padding: 0 !important;
    }

    .body_exercise .exe-pro .exe-question, .body_exercise .exe-pro .exe-answers {
        height: auto;
    }

    .body_exercise .click-btn .button,
    .body_exercise .title-top .btn-test .result {
        width: 60px !important;
    }

    .body_exercise .click-btn .button span {
        display: none;
    }

    .body_exercise .title-top {
        flex-wrap: wrap;
    }

    .body_exercise .click-btn {
        position: relative;
        top: 0;
        left: 0;
        transform: none;
    }

    .exe-pro {
        background-color: transparent !important;
    }
}