/* --------------------------------------------------------------------------
   Exam result + answer review
   Shared by /site/result (hashed link) and /show-result (civil-id lookup).
   Loaded by both AppAsset (LTR) and RtlAsset (RTL) — keep it direction
   agnostic: logical properties only, no bare left/right.
   -------------------------------------------------------------------------- */

/* ---------- score ring ---------- */

.score-ring {
    position: relative;
    width: 180px;
    height: 180px;
}

.score-ring--sm {
    width: 128px;
    height: 128px;
}

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

html[dir="rtl"] .score-ring svg {
    transform: rotate(-90deg) scaleY(-1);
}

.score-ring circle {
    fill: none;
    stroke-width: 12;
    stroke-linecap: round;
}

.score-ring__track {
    stroke: rgba(0, 0, 0, .07);
}

.score-ring__value {
    stroke: currentColor;
    transition: stroke-dashoffset 1.1s cubic-bezier(.22, 1, .36, 1);
}

.score-ring__label {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
}

.score-ring__percent {
    font-size: 2.75rem;
    font-weight: 700;
}

.score-ring__percent small {
    font-size: 1.25rem;
    font-weight: 600;
}

.score-ring--sm .score-ring__percent {
    font-size: 2rem;
}

.score-ring--sm .score-ring__percent small {
    font-size: 1rem;
}

.score-ring__score {
    font-size: .875rem;
}

/* ---------- result cards ---------- */

.exam-result__banner {
    height: 6px;
}

.exam-result__banner--success {
    background: linear-gradient(90deg, #198754, #4ade80);
}

.exam-result__banner--danger {
    background: linear-gradient(90deg, #dc3545, #fb923c);
}

.exam-result__bar {
    height: 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .06);
}

/* ---------- answer review ---------- */

.answer-review__card {
    border-inline-start: 4px solid transparent;
}

.answer-review__card--correct {
    border-inline-start-color: #198754;
}

.answer-review__card--wrong {
    border-inline-start-color: #dc3545;
}

.answer-review__card--skipped {
    border-inline-start-color: #ffc107;
}

.answer-review__index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(150, 95, 38, .1);
    color: #965f26;
    font-weight: 700;
    font-size: .9rem;
    flex: 0 0 auto;
}

.answer-review__option {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .625rem .875rem;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: .75rem;
    margin-bottom: .5rem;
    background: #fff;
}

.answer-review__option:last-child {
    margin-bottom: 0;
}

.answer-review__option--correct {
    border-color: rgba(25, 135, 84, .45);
    background: rgba(25, 135, 84, .06);
}

.answer-review__option--wrong {
    border-color: rgba(220, 53, 69, .45);
    background: rgba(220, 53, 69, .06);
}

.answer-review__mark {
    width: 22px;
    text-align: center;
    flex: 0 0 auto;
    line-height: 1.5;
}

.answer-review__filters {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.answer-review__filters .btn .badge {
    font-size: .7em;
    opacity: .85;
}

/* keep the count badge readable once the outline button fills in */
.answer-review__filters .btn.active .badge {
    background: rgba(255, 255, 255, .25) !important;
    color: #fff;
}

/* the standalone legend was folded into the filter row, but the 2022-2024
   themes still ship their own result views that render it */
.answer-review__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    justify-content: center;
    font-size: .9rem;
}

/* ---------- civil-id lookup form ---------- */

.result-lookup .form-control,
.result-lookup .form-select {
    border-radius: .75rem;
    padding: .7rem .9rem;
}

.result-lookup__hint {
    font-size: .85rem;
}

/* ---------- motion / print ---------- */

@media (prefers-reduced-motion: reduce) {
    .score-ring__value {
        transition: none;
    }
}

@media print {
    header,
    footer,
    .breadcrumb,
    .exam-result__actions,
    .answer-review__actions,
    .answer-review__filters {
        display: none !important;
    }

    /* a filtered view must still print in full */
    .answer-review__list [data-review-state][hidden] {
        display: block !important;
    }

    [data-review-empty] {
        display: none !important;
    }

    .exam-result .card,
    .answer-review .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
        break-inside: avoid;
    }
}
