/* Quiz Container */


.comaxx-quiz-container {
    max-width: 100%;
    margin: 2.5rem auto;
    background: #ffffff;
    font-family: 'AkkuratWebRegular', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    @media (min-width: 520px) {
        border: 1px solid var(--border-color);
        padding: 2.5rem;
    }
}

/* Quiz Header */
.comaxx-quiz-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.875rem;
    border-bottom: 1px solid var(--border-color);
}

.comaxx-quiz-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--comaxx-primary-color, #037DB6);
    margin: 0 0 1rem 0;
}

.comaxx-quiz-description {
    font-size: 1rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.comaxx-quiz-meta {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
}

.comaxx-quiz-question-count {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--comaxx-primary-color, #037DB6);
    font-weight: 600;
    font-size: 14px;
}

/* Start Screen */
.comaxx-quiz-start-screen {
    text-align: center;
    padding: 60px 0;
}

.comaxx-quiz-start-content p {
    font-size: 20px;
    color: #666;
    margin-bottom: 30px;
}

/* Buttons */
.comaxx-quiz-btn {
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 400;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.comaxx-quiz-btn-primary {
    background: var(--comaxx-primary-color);
    color: white;
    transition: all 200ms ease;
}

.comaxx-quiz-btn-primary:hover:not(:disabled) {
    background: var(--comaxx-tertiary-color);
}

.comaxx-quiz-btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.comaxx-quiz-btn-secondary {
    background: white;
    color: var(--comaxx-primary-color, #037DB6);
    border: 2px solid var(--comaxx-primary-color, #037DB6);
}

.comaxx-quiz-btn-secondary:hover {
    background: var(--comaxx-primary-color, #037DB6);
    color: white;
}

/* Progress Bar */
.comaxx-quiz-progress {
    margin-bottom: 2.5rem;
}

.comaxx-quiz-progress-bar {
    height: 8px;
    background: #f0f0f0;
    overflow: hidden;
    margin-bottom: 12px;
}

.comaxx-quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--comaxx-secondary-color, #FAA934) 0%, var(--comaxx-quaternary-color, #EBAB4D) 100%);
    transition: width 0.5s ease;
}

.comaxx-quiz-progress-text {
    text-align: center;
    font-weight: 600;
    color: var(--comaxx-primary-color, #037DB6);
    font-size: 14px;
}

/* Questions */
.comaxx-quiz-question {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.comaxx-quiz-question-number {
    display: inline-block;
    padding: 6px 1rem;
    background: var(--comaxx-tertiary-color, #77B9D9);
    color: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 1rem;
}

.comaxx-quiz-question-text {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0 0 30px 0;
    line-height: 1.4;
}

/* Question image */
.comaxx-quiz-question-image {
    margin-bottom: 20px;
}

.comaxx-quiz-question-image .comaxx-quiz-question-img {
    display: block;
    max-width: 100%;
    width: 100%;
    height: 400px;
    object-fit: cover;
}

@media (max-width: 768px) {
    .comaxx-quiz-question-image .comaxx-quiz-question-img {
        height: 275px;
    }
}

/* Answers */
.comaxx-quiz-answers {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 30px;
}

.comaxx-quiz-answer {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    gap: 0.25rem;
}

.comaxx-quiz-answer:hover {
    background: #f0f7fb;
    border-color: var(--comaxx-tertiary-color, #77B9D9);
    transform: translateX(4px);
}

.comaxx-quiz-answer input[type="radio"],
.comaxx-quiz-answer input[type="checkbox"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    margin: 0;
}

.comaxx-quiz-answer:has(input[type="radio"]:focus),
.comaxx-quiz-answer:has(input[type="checkbox"]:focus) {
    outline: 1px solid var(--comaxx-tertiary-color, #77B9D9);
}

/* Multi-select hint badge */
.comaxx-quiz-multi-hint {
    display: inline-block;
    padding: 4px 12px;
    background: var(--comaxx-secondary-color, #FAA934);
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* Checkbox-style icon for multi-select answers */
.comaxx-quiz-answer-multi .comaxx-quiz-answer-icon {
    border-radius: 0;
}

/* When a multi-select answer is revealed, always show a circle */
.comaxx-quiz-answer-multi.correct .comaxx-quiz-answer-icon,
.comaxx-quiz-answer-multi.incorrect .comaxx-quiz-answer-icon {
    border-radius: 50%;
}

.comaxx-quiz-answer-multi.selected .comaxx-quiz-answer-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 6px;
    height: 11px;
    border: 1px solid white;
    border-top: none;
    border-left: none;
    background: transparent;
    border-radius: 0;
}

.comaxx-quiz-answer-text {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    font-size: 1rem;
    color: #333;
    font-weight: 500;

    @media (max-width: 768px) {
        font-size: .8889rem;
    }
}

.comaxx-quiz-answer-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    background: var(--comaxx-primary-color, #037DB6);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;

    @media (min-width: 768px) {
        width: 2rem;
        height: 2rem;
    }

    @media (max-width: 520px) {
        display: none;
    }
}

.comaxx-quiz-answer-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #b4b4b4;
    flex-shrink: 0;
    transition: all 0.3s ease;
    position: relative;
}

/* Selected Answer */
.comaxx-quiz-answer.selected {
    background: #e3f2fd;
    border-color: var(--comaxx-primary-color, #037DB6);
}

.comaxx-quiz-answer.selected .comaxx-quiz-answer-icon {
    background: var(--comaxx-primary-color, #037DB6);
    border-color: var(--comaxx-primary-color, #037DB6);
    position: relative;
}

.comaxx-quiz-answer.selected .comaxx-quiz-answer-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
}

/* Correct/Incorrect States */
.comaxx-quiz-answer.correct {
    background: #d4edda;
    border-color: #28a745;
}

.comaxx-quiz-answer.correct .comaxx-quiz-answer-icon {
    background: #28a745;
    border-color: #28a745;
    border-radius: 50%;
}

/* Checkmark — overrides selected dot for both single and multi */
.comaxx-quiz-answer.correct .comaxx-quiz-answer-icon::after {
    content: '';
    position: absolute;
    top: 46%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 6px;
    height: 11px;
    border: 1px solid white;
    border-top: none;
    border-left: none;
    background: transparent;
    border-radius: 0;
}

.comaxx-quiz-answer.incorrect {
    background: #f8d7da;
    border-color: #dc3545;
}

.comaxx-quiz-answer.incorrect .comaxx-quiz-answer-icon {
    background: #dc3545;
    border-color: #dc3545;
    border-radius: 50%;
    width: 28px;
    height: 28px;
}

/* Cross — overrides selected dot for both single and multi */
.comaxx-quiz-answer.incorrect .comaxx-quiz-answer-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 2px;
    background: white;
    transform: translate(-50%, -50%) rotate(45deg);
    box-shadow: none;
}

.comaxx-quiz-answer.incorrect .comaxx-quiz-answer-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 2px;
    background: white;
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* When selected + correct/incorrect: the icon must look like correct/incorrect, not selected.
   The correct/incorrect ::after rules already override the selected ::after content.
   But we must also ensure the icon shape stays circular (not oval) for multi-select. */
.comaxx-quiz-answer.selected.correct .comaxx-quiz-answer-icon,
.comaxx-quiz-answer.selected.incorrect .comaxx-quiz-answer-icon {
    border-radius: 50%;
    width: 28px;
    height: 28px;
}

.comaxx-quiz-answer.disabled {
    pointer-events: none;
}

/* Explanation */
.comaxx-quiz-explanation {
    padding: 1rem;
    background: #fff9e6;
    border-left: 4px solid var(--comaxx-secondary-color, #FAA934);
    margin-bottom: 30px;
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 500px; }
}

.comaxx-quiz-explanation-title {
    font-weight: 700;
    color: var(--comaxx-secondary-color, #FAA934);
    margin-bottom: 8px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.comaxx-quiz-explanation-content {
    color: #666;
    line-height: 1.6;
    font-size: 15px;
}

/* Navigation */
.comaxx-quiz-navigation {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 30px;
}

/* Results */
.comaxx-quiz-results {
    text-align: center;
    padding: 2.5rem 0;
}

.comaxx-quiz-results-icon {
    margin-bottom: 1.5rem;
    color: #28a745;
}

.comaxx-quiz-results-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--comaxx-primary-color, #037DB6);
    margin: 0 0 2.5rem 0;
}

.comaxx-quiz-results-score {
    margin-bottom: 2.5rem;
}

.comaxx-quiz-score-circle {
    width: 12.5rem;
    height: 12.5rem;
    margin: 0 auto;
    position: relative;
}

.comaxx-quiz-score-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.comaxx-quiz-score-bg {
    fill: none;
    stroke: #f0f0f0;
    stroke-width: 8;
}

.comaxx-quiz-score-progress {
    fill: none;
    stroke: var(--comaxx-primary-color, #037DB6);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 339.292;
    stroke-dashoffset: 339.292;
    transition: stroke-dashoffset 1s ease;
}

.comaxx-quiz-score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.comaxx-quiz-score-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--comaxx-primary-color, #037DB6);
}

.comaxx-quiz-score-label {
    font-size: 0.875rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.comaxx-quiz-results-stats {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}

.comaxx-quiz-stat {
    text-align: center;
}

.comaxx-quiz-stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.comaxx-quiz-stat-correct {
    color: #28a745;
}

.comaxx-quiz-stat-incorrect {
    color: #dc3545;
}

.comaxx-quiz-stat-total {
    color: var(--comaxx-primary-color, #037DB6);
}

.comaxx-quiz-stat-label {
    font-size: 0.875rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Error */
.comaxx-quiz-error {
    padding: 1rem;
    background: #f8d7da;
    border: 1px solid #dc3545;
    color: #721c24;
    text-align: center;
}

/* Answer stat bar (shown after reveal) */
.comaxx-quiz-answer-stat {
    display: none;
    align-items: center;
    gap: 0.4rem;
    /* Sits inline in the flex row, right-aligned */
    margin-left: auto;
    flex-shrink: 0;
}

.comaxx-quiz-answer-stat.visible {
    display: flex;
}

/* Full-width bar track — absolutely positioned at the bottom of the answer */
.comaxx-quiz-answer-stat-bar {
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 4px;
    border-radius: 0;
    background: var(--comaxx-tertiary-color, #77B9D9);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Pseudo-element track background — full width, at the bottom */
.comaxx-quiz-answer:has(.comaxx-quiz-answer-stat.visible)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(0, 0, 0, 0.08);
    pointer-events: none;
}

/* Percentage label — visible inline next to the icon */
.comaxx-quiz-answer-stat-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #555;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    min-width: 3rem;
    text-align: right;
}

.comaxx-quiz-answer.correct .comaxx-quiz-answer-stat-bar {
    background: #28a745;
}

.comaxx-quiz-answer.incorrect .comaxx-quiz-answer-stat-bar {
    background: #dc3545;
}

/* Add bottom padding so the 4px bar doesn't overlap the answer content */
.comaxx-quiz-answer:has(.comaxx-quiz-answer-stat.visible) {
    padding-bottom: calc(1rem + 4px);
}

/* Question review (results screen) */
.comaxx-quiz-review {
    margin-top: 2.5rem;
    text-align: left;
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

.comaxx-quiz-review-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--comaxx-primary-color, #037DB6);
    margin: 0 0 1.25rem 0;
}

.comaxx-quiz-review-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comaxx-quiz-review-item {
    border-radius: 0;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.comaxx-quiz-review-question {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    font-weight: 600;
    font-size: 0.9375rem;
    color: #333;
}

.comaxx-quiz-review-item--correct .comaxx-quiz-review-question {
    background: #d4edda;
}

.comaxx-quiz-review-item--incorrect .comaxx-quiz-review-question {
    background: #f8d7da;
}

/* Correct / incorrect icon using pseudo-element */
.comaxx-quiz-review-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    position: relative;
    margin-top: 1px;
}

.comaxx-quiz-review-item--correct .comaxx-quiz-review-icon {
    background: #28a745;
}

/* Checkmark */
.comaxx-quiz-review-item--correct .comaxx-quiz-review-icon::after {
    content: '';
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
}

.comaxx-quiz-review-item--incorrect .comaxx-quiz-review-icon {
    background: #dc3545;
}

/* Cross bar 1 */
.comaxx-quiz-review-item--incorrect .comaxx-quiz-review-icon::before,
.comaxx-quiz-review-item--incorrect .comaxx-quiz-review-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 11px;
    height: 2px;
    background: #fff;
    border-radius: 0;
}

.comaxx-quiz-review-item--incorrect .comaxx-quiz-review-icon::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.comaxx-quiz-review-item--incorrect .comaxx-quiz-review-icon::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.comaxx-quiz-review-question-text {
    flex: 1;
    line-height: 1.5;

    p:last-child {
        margin-bottom: 0;
    }
}

/* Answer list inside review item */
.comaxx-quiz-review-answers {
    list-style: none;
    margin: 0;
    /*padding: 0.5rem 1rem 0.75rem calc(1rem + 22px + 0.75rem);*/
    padding: 0.5rem 1rem 0.75rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    background: #fafafa;
}

.comaxx-quiz-review-answer {
    font-size: 0.875rem;
    padding: 0.3rem 0.6rem 0.3rem 1.5rem;
    /*border-radius: 4px;*/
    position: relative;
}

.comaxx-quiz-review-answer::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    font-family: 'Material Icons';
}

.comaxx-quiz-review-answer::after {
    position: absolute;
    left: -1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Material Icons';
    font-size: 1rem;
    line-height: 1;
}

.comaxx-quiz-review-answer--correct::before {
    background: #d4edda;
}

.comaxx-quiz-review-answer--correct::after {
    content: '\e5ca';
    color: #155724;
}

.comaxx-quiz-review-answer--incorrect::before {
    background: #f8d7da;
}

.comaxx-quiz-review-answer--incorrect::after {
    content: '\e5cd';
    color: #721c24;
}

/* Responsive */
@media (max-width: 768px) {

    .comaxx-quiz-title {
        font-size: 1.5rem;
    }

    .comaxx-quiz-question-text {
        font-size: 1.25rem;
    }

    .comaxx-quiz-results-stats {
        flex-direction: column;
        gap: 1.25rem;
    }

    .comaxx-quiz-navigation {
        flex-direction: column-reverse;
    }

    .comaxx-quiz-btn {
        width: 100%;
    }
}
