/* Core quiz container styling */
.quiz-container {
    font-family: Arial, sans-serif;
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
}

/* Header section */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.quiz-title {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
}
.timer {
    font-size: 18px;
    font-weight: bold;
    color: #ff0000;
}

/* Question navigation section */
.question-navigation-container {
    margin-bottom: 20px;
}
.question-navigation-legend {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
    gap: 10px;
    font-size: 14px;
}
.legend-item.correct::before {
    content: '';
    display: inline-block;
    width: 15px;
    height: 15px;
    background-color: #a5d6a7;
    border: 1px solid #7cb342;
    margin-right: 5px;
    vertical-align: middle;
}
.legend-item.review::before {
    content: '';
    display: inline-block;
    width: 15px;
    height: 15px;
    background-color: #fff3e0;
    border: 1px solid #ffb300;
    margin-right: 5px;
    vertical-align: middle;
}
.legend-item.incorrect::before {
    content: '';
    display: inline-block;
    width: 15px;
    height: 15px;
    background-color: #ef9a9a;
    border: 1px solid #e53935;
    margin-right: 5px;
    vertical-align: middle;
}

.question-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.question-number-btn {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    background-color: #fff;
    border: 1px solid #ccc;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

.question-number-btn.active.correct,
.question-number-btn.correct {
    background-color: #a5d6a7;
    border-color: #7cb342;
}

.question-number-btn.active.incorrect,
.question-number-btn.incorrect {
    background-color: #ef9a9a;
    border-color: #e53935;
}

.question-number-btn.review-flag {
    background-color: #fff3e0;
    border-color: #ffb300;
}

.question-number-btn.active {
    border-color: #3f51b5;
    box-shadow: 0 0 0 2px #3f51b5;
}

/* Question and answers section */
.question-block {
    border-top: 1px solid #ccc;
    padding-top: 20px;
}
.question-header {
    margin-bottom: 15px;
}
.question-title-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}
.question-title-wrapper h4 {
    margin: 0;
    font-size: 20px;
}







.audio-btn {
    background-color: #fff;
    border: 2px solid #3f51b5;
    border-radius: 50%;
    padding: 8px;
    width: 38px;
    height: 38px;
    font-size: 18px;
    color: #3f51b5;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.audio-btn:hover {
    background-color: #e8eaf6; /* subtle blue background */
    transform: scale(1.1);
}

.audio-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(63, 81, 181, 0.4);
}

.audio-btn.playing {
    background-color: #3f51b5;
    color: #fff;
}








.quiz-options {
    list-style: none;
    padding: 0;
    margin: 0;
}
/* This is the key section to update */
.quiz-option {
    background-color: #fff;
    border: 1px solid #dcdcdc; /* Lighter border color */
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    border-radius: 4px;
}
.quiz-option:hover {
    background-color: #f0f0f0;
}
.quiz-option.selected {
    border-color: #3f51b5; /* Blue border for selected state */
    background-color: #e8eaf6;
    font-weight: bold;
}
.quiz-option.correct {
    background-color: #a5d6a7; /* Green for correct answer */
    border-color: #7cb342;
}
.quiz-option.incorrect {
    background-color: #ef9a9a; /* Red for incorrect answer */
    border-color: #e53935;
}
/* This is the new section to handle the radio/checkbox images */
.quiz-option input[type="radio"],
.quiz-option input[type="checkbox"] {
    display: none; /* Hide default radio/checkbox */
}
.quiz-option label {
    display: block;
    cursor: pointer;
    padding-left: 25px;
    position: relative;
}
.quiz-option label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 1px solid #ccc;
    background-color: #fff;
    border-radius: 50%;
}
.quiz-option input[type="checkbox"] + label::before {
    border-radius: 2px; /* Square for checkbox */
}
.quiz-option input[type="radio"]:checked + label::before,
.quiz-option input[type="checkbox"]:checked + label::before {
    background-color: #3f51b5; /* Filled color when checked */
    border-color: #3f51b5;
}
.quiz-option input:checked + label {
    border-color: #3f51b5;
    background-color: #e8eaf6;
    font-weight: bold;
}

/* Result explanation box */
.result-box {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1.5;
}
.result-box.correct {
    background-color: #a5d6a7;
    border: 1px solid #7cb342;
    color: #1b5e20;
}
.result-box.incorrect {
    background-color: #ef9a9a;
    border: 1px solid #e53935;
    color: #b71c1c;
}

/* Navigation buttons */
.quiz-navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}
.quiz-navigation-buttons .button {
    padding: 10px 20px;
    border-radius: 4px;
    border: 1px solid #ccc;
    cursor: pointer;
    font-size: 16px;
}
#prev-btn {
    background-color: #fff;
}
#review-btn {
    background-color: #ffb300;
    color: #fff;
    border-color: #ffb300;
}
#next-btn {
    background-color: #3f51b5;
    color: #fff;
    border-color: #3f51b5;
}
#finish-btn {
    background-color: #d32f2f;
    color: #fff;
    border-color: #d32f2f;
}

/* Results Page Styles */
.quiziz-results-container {
    padding: 20px;
    text-align: center;
}
.quiziz-results-container h2 {
    font-size: 32px;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.result-summary {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}
.result-time {
    font-size: 18px;
    margin-top: 10px;
}
.result-status {
    font-size: 28px;
    font-weight: bold;
    margin: 20px 0;
}
.result-status.pass {
    color: #4caf50;
}
.result-status.fail {
    color: #f44336;
}
.result-message {
    font-size: 16px;
    color: #555;
    margin-bottom: 20px;
}
.continue-practice a {
    color: #3f51b5;
    font-weight: bold;
    text-decoration: none;
}
.score-comparison {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 30px;
}
.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.score-label {
    font-size: 14px;
    color: #777;
}
.score-value {
    font-size: 36px;
    font-weight: bold;
    color: #333;
}
.your-score .score-value {
    color: #3f51b5;
}


/* 1. Define a simple keyframe animation that just sets the color */
@keyframes force-active-color {
  from { background-color: #3f51b5; }
  to { background-color: #3f51b5; }
}

/* 2. Apply the animation to the active button with a high-specificity selector */
.quiz-container .question-number-btn.active {
    /* * This animation property FORCES the background-color 
     * to the desired color and overrides the conflicting default. 
     */
    animation: force-active-color 1ms forwards !important; 
    
    /* Ensure the text color is also correct */
    color: #ffffff !important; 
    
    /* Keep other essential styles */
    border-color: #3f51b5 !important;
    box-shadow: 0 0 0 2px #3f51b5;
}

/* 3. Also fix the hover effect using the new animation property, since the animation overrides the standard background property */
.quiz-container .question-number-btn.active:hover {
    animation: none !important; /* Stop the animation on hover */
    background-color: #314299 !important; /* Apply the darker hover color */
}