/* ── Fix: app.css sets min-height: 48px on all inputs ─────────────────────── */
/* Scoped to answer options so other parts of site are not affected */
.answer-options .form-check-input {
    min-height: unset;
}

/* ── Question display ──────────────────────────────────────────────────────── */

.question-surface {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.question-surface input,
.question-surface textarea,
.question-surface select {
    -webkit-user-select: auto;
    user-select: auto;
}

.question-text {
    line-height: 1.6;
}

.question-text-inline {
    line-height: 2.4;
}

/* Answer options */
.answer-option {
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.answer-option:hover {
    background-color: var(--bs-light);
    border-color: var(--bs-primary) !important;
    box-shadow: 0 2px 8px rgba(36,87,197,0.15);
}

.answer-option:has(.form-check-input:checked) {
    background-color: #e8f0fe;
    border-color: var(--bs-primary) !important;
}

.matching-option {
    min-width: 0;
}

.matching-select {
    max-width: 100%;
    width: 100%;
}

/* ── Practice layout ──────────────────────────────────────────────────────── */

.attempt-header {
    margin: -1rem calc(50% - 50vw) 1rem;
    width: 100vw;
}

.attempt-header-inner {
    align-items: center;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(2rem, 1fr) auto minmax(2rem, 1fr);
    margin-inline: auto;
    max-width: var(--site-content-width, 1000px);
    padding: 0.75rem 0;
    width: 100%;
}

.attempt-header-brand {
    color: var(--bs-body-color);
    justify-self: start;
}

.attempt-header-status {
    display: flex;
    gap: 0.35rem;
    justify-content: center;
    min-width: 0;
}

.attempt-header-status [data-exam-timer] {
    margin-bottom: 0 !important;
}

.attempt-header-action {
    justify-self: end;
}

.practice-shell {
    margin-inline: auto;
    max-width: var(--site-content-width, 1000px);
    width: 100%;
}

.practice-toolbar {
    align-items: center;
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
}

.practice-question-count {
    flex: 0 0 auto;
}

.practice-progress {
    flex: 1 1 auto;
}

.practice-progress .progress-bar {
    width: var(--practice-progress);
}

.practice-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 0.5rem;
}

/* ── Check result ─────────────────────────────────────────────────────────── */

.check-result-shell {
    margin-inline: auto;
    max-width: var(--site-content-width, 1000px);
    width: 100%;
}

.check-score-progress {
    position: relative;
}

.check-score-track {
    background-color: var(--bs-light);
    height: 2.75rem;
}

.check-score-track .progress-bar {
    width: var(--check-score-percent);
}

.check-score-marks {
    align-items: center;
    display: flex;
    font-size: 1.5rem;
    font-weight: 700;
    inset: 0 0 auto;
    justify-content: space-between;
    line-height: 2.75rem;
    padding-inline: 1rem;
    pointer-events: none;
    position: absolute;
}

.check-breakdown-badge {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    line-height: 1;
}

.check-time-stat {
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    padding: 0.75rem;
}

.check-time-stat span {
    color: var(--bs-secondary-color);
    display: block;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.check-time-stat strong {
    display: block;
    font-size: 1.15rem;
    line-height: 1.2;
}

.check-time-vertical-chart {
    display: grid;
    gap: 0.55rem;
}

.result-time-scroll {
    max-height: 32rem;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.check-time-row {
    align-items: center;
    display: grid;
    gap: 0.65rem;
    grid-template-columns: 2.25rem minmax(0, 1fr) 3.75rem;
}

.check-time-question {
    color: var(--bs-secondary-color);
    font-size: 0.875rem;
    line-height: 1;
}

.check-time-row-track {
    background: var(--bs-secondary-bg);
    border-radius: 999px;
    height: 0.9rem;
    overflow: hidden;
}

.check-time-row-bar {
    border-radius: 999px;
    height: 100%;
    min-width: 0.35rem;
    width: var(--check-time-width);
}

.check-time-row strong {
    font-size: 0.875rem;
    line-height: 1;
    text-align: end;
}

@media (max-width: 767.98px) {
    .attempt-header {
        margin-top: -1rem;
    }

    .attempt-header-inner {
        gap: 0.5rem;
        grid-template-columns: auto minmax(0, 1fr) auto;
        padding: 0.75rem;
    }

    .attempt-header-status {
        font-size: 0.95rem;
    }

    .practice-shell {
        padding-bottom: 4.75rem;
    }

    .practice-toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: 0.5rem;
    }

    .practice-actions {
        background: var(--bs-body-bg);
        border-top: var(--bs-border-width) solid var(--bs-border-color);
        bottom: 0;
        box-shadow: 0 -0.25rem 0.75rem rgba(0, 0, 0, 0.08);
        justify-content: space-between;
        left: 0;
        padding: 0.75rem;
        position: fixed;
        right: 0;
        z-index: 1030;
    }

    .practice-actions .btn {
        --bs-btn-font-size: 1rem;
        --bs-btn-padding-x: 1rem;
        --bs-btn-padding-y: 0.75rem;
        flex: 1 1 0;
        min-height: 3rem;
        min-width: 0;
    }

    .practice-actions > .d-flex {
        display: contents !important;
    }
}

@media (min-width: 992px) {
    .check-time-column-wrap > .d-flex {
        height: 100%;
    }

    .check-time-profile-card {
        flex: 1 1 auto;
    }

    .check-time-profile-card .card-body {
        display: flex;
        flex-direction: column;
    }

    .check-time-profile-card .check-time-vertical-chart {
        align-content: space-between;
        flex: 1 1 auto;
    }
}

/* ── Drag & Drop ───────────────────────────────────────────────────────────── */

.drag-item {
    cursor: grab;
    user-select: none;
    transition: opacity 0.15s, box-shadow 0.15s;
}

.drag-item:active,
.drag-item.is-dragging {
    cursor: grabbing;
    opacity: 0.6;
}

.drop-zone {
    min-height: 3rem;
    transition: background-color 0.15s, border-color 0.15s;
}

.drop-zone.drag-over {
    background-color: #e8f0fe !important;
    border-color: var(--bs-primary) !important;
    border-style: dashed !important;
}

.drop-placeholder {
    font-size: 0.8rem;
}

.drop-zone-items:not(:empty) .drop-placeholder {
    display: none;
}

/* ── Hotspot ───────────────────────────────────────────────────────────────── */

.hotspot-wrapper {
    position: relative;
}

.hotspot-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

.hotspot-marker {
    background: #dc3545;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(220, 53, 69, 0.45);
    display: none;
    height: 1rem;
    left: var(--hotspot-x);
    pointer-events: none;
    position: absolute;
    top: var(--hotspot-y);
    transform: translate(-50%, -50%);
    width: 1rem;
}

.hotspot-marker.is-visible {
    display: block;
}

.hotspot-correct-region {
    fill: rgba(25, 135, 84, 0.2);
    stroke: #198754;
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

.hotspot-markup-region {
    fill: rgba(13, 110, 253, 0.18);
    stroke: #0d6efd;
    stroke-dasharray: 4 2;
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

.hotspot-markup-panel {
    position: relative;
}

.hotspot-markup-panel .btn {
    margin-block: 0;
}

.hotspot-marker::after {
    animation: hotspot-ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
    background: #dc3545;
    border-radius: 50%;
    content: "";
    inset: -0.35rem;
    opacity: 0.65;
    position: absolute;
    z-index: -1;
}

@keyframes hotspot-ping {
    75%,
    100% {
        opacity: 0;
        transform: scale(1.8);
    }
}

/* ── Visual block ──────────────────────────────────────────────────────────── */

.question-visual {
    font-size: 0.9rem;
    width: 50%;
    margin-inline: auto;
}

.question-visual--wide {
    width: 100%;
}

.question-visual-frame {
    width: 100%;
}

[data-question-image] {
    width: 100%;
}

.question-visual-image {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 360px;
    height: auto;
    margin-inline: auto;
}

.question-chart {
    display: block;
    width: 100%;
    min-height: 8rem;
}

.hotspot-wrapper {
    width: 50%;
}

.hotspot-wrapper .question-visual {
    width: 100%;
}

.hotspot-image-wrapper {
    width: 100%;
}

.hotspot-json-wrapper {
    width: 50%;
    margin-inline: auto;
}

.hotspot-wrapper .question-visual-image {
    width: 100%;
    max-height: none;
}

.question-dashboard {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.question-dashboard-metric {
    min-width: 7rem;
}

.question-heatmap-cell {
    background-color: rgba(37, 99, 235, var(--heatmap-opacity));
}

.chart-axis,
.chart-grid,
.chart-connection {
    stroke: #94a3b8;
    stroke-width: 0.7;
    vector-effect: non-scaling-stroke;
}

.chart-grid {
    stroke-dasharray: 2 2;
}

.chart-label,
.chart-legend,
.chart-node-label {
    fill: #475569;
    font-size: 3px;
}

.chart-node {
    fill: #e2e8f0;
    stroke: #64748b;
    stroke-width: 0.7;
    vector-effect: non-scaling-stroke;
}

.chart-radar {
    fill: rgba(37, 99, 235, 0.2);
    stroke: #2563eb;
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}
