/**
 * LearnDash Compound Questions — Frontend v1.2
 */

/* ── Wrapper ── */
.ldcq-wrap { margin: 15px 0; }

/* ── Sub-question ── */
.ldcq-sub {
    background: #f8f9fb;
    border: 2px solid #e2e6ea;
    border-radius: 10px;
    padding: 20px;
    transition: border-color .3s, background .3s;
}
.ldcq-sub:hover { border-color: #c5cdd5; }

.ldcq-sub-hdr {
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
    margin-bottom: 14px;
    line-height: 1.5;
    padding-bottom: 10px;
    border-bottom: 1px solid #e8ecf0;
}

.ldcq-sub-opts { display: flex; flex-direction: column; gap: 8px; }

/* ── Option ── */
.ldcq-opt {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border: 2px solid #e2e6ea;
    border-radius: 8px;
    cursor: pointer;
    transition: all .2s;
    user-select: none;
    position: relative;
}
.ldcq-opt:hover { border-color: #2271b1; background: #f0f6fc; }
.ldcq-opt input[type=radio] { position: absolute; opacity: 0; width: 0; height: 0; }

.ldcq-radio {
    width: 22px; height: 22px; min-width: 22px;
    border: 2px solid #c3c4c7;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: all .2s;
}
.ldcq-radio::after {
    content: '';
    width: 12px; height: 12px;
    border-radius: 50%;
    background: transparent;
    transition: background .2s;
}

.ldcq-opt input:checked ~ .ldcq-radio { border-color: #2271b1; }
.ldcq-opt input:checked ~ .ldcq-radio::after { background: #2271b1; }
.ldcq-opt input:checked ~ .ldcq-opt-txt { font-weight: 600; color: #1d2327; }
.ldcq-opt:has(input:checked) { border-color: #2271b1; background: #f0f6fc; }

.ldcq-opt-txt { font-size: 15px; color: #3c434a; line-height: 1.4; }

/* ── Divider ── */
.ldcq-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, #dde0e4 30%, #dde0e4 70%, transparent);
    margin: 16px 0;
}

/* ══════════════════════════════════════
   RESULT STATES
   ══════════════════════════════════════ */

/* Correct */
.ldcq-sub.ldcq-ok {
    border-color: #00a32a;
    background: #f0faf3;
}
.ldcq-sub.ldcq-ok .ldcq-sub-hdr {
    color: #007017;
    border-bottom-color: #b7e4c7;
}
.ldcq-sub.ldcq-ok .ldcq-sub-hdr::before {
    content: '✓ ';
    color: #00a32a;
    font-weight: bold;
}

/* Incorrect */
.ldcq-sub.ldcq-no {
    border-color: #d63638;
    background: #fef5f5;
}
.ldcq-sub.ldcq-no .ldcq-sub-hdr {
    color: #8a2424;
    border-bottom-color: #f0b8b8;
}
.ldcq-sub.ldcq-no .ldcq-sub-hdr::before {
    content: '✗ ';
    color: #d63638;
    font-weight: bold;
}

/* Disable after grade */
.ldcq-sub.ldcq-ok .ldcq-opt,
.ldcq-sub.ldcq-no .ldcq-opt {
    pointer-events: none;
    opacity: .85;
}

/* ── Score badge ── */
.ldcq-badge {
    display: inline-block;
    margin-top: 14px;
    padding: 6px 18px;
    background: #dba617;
    color: #fff;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}
.ldcq-badge.ldcq-badge-ok { background: #00a32a; }
.ldcq-badge.ldcq-badge-no { background: #d63638; }

/* ══════════════════════════════════════
   RESPONSE LABEL (replaces LD's Верно/Неверно)
   ══════════════════════════════════════ */

.ldcq-resp {
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 15px;
    margin-top: 14px;
    display: flex; align-items: center; gap: 8px;
}
.ldcq-resp-ok {
    background: #f0faf3;
    border: 2px solid #00a32a;
    color: #007017;
}
.ldcq-resp-half {
    background: #fff8e5;
    border: 2px solid #dba617;
    color: #8a6d00;
}
.ldcq-resp-no {
    background: #fef5f5;
    border: 2px solid #d63638;
    color: #8a2424;
}

/* ══════════════════════════════════════
   FORCE-HIDE LD NATIVE FOR COMPOUND
   ══════════════════════════════════════ */

.ldcq-active .wpProQuiz_questionList {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}

.ldcq-active .wpProQuiz_response,
.ldcq-active .wpProQuiz_incorrect,
.ldcq-active .wpProQuiz_correct,
.ldcq-active .wpProQuiz_reviewCheck,
.ldcq-active .wpProQuiz_responseCorrect,
.ldcq-active .wpProQuiz_responseIncorrect {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
}

/* ══════════════════════════════════════
   NAV CIRCLE OVERRIDES
   ══════════════════════════════════════ */

/* 2/2 correct = green */
li.ldcq-nav-ok,
.wpProQuiz_reviewQuestion li.ldcq-nav-ok,
.wpProQuiz_reviewList li.ldcq-nav-ok {
    background-color: #00a32a !important;
    background: #00a32a !important;
    color: #fff !important;
}

/* 1/2 partial = orange */
li.ldcq-nav-half,
.wpProQuiz_reviewQuestion li.ldcq-nav-half,
.wpProQuiz_reviewList li.ldcq-nav-half {
    background-color: #dba617 !important;
    background: #dba617 !important;
    color: #fff !important;
}

/* 0/2 wrong = red */
li.ldcq-nav-no,
.wpProQuiz_reviewQuestion li.ldcq-nav-no,
.wpProQuiz_reviewList li.ldcq-nav-no {
    background-color: #d63638 !important;
    background: #d63638 !important;
    color: #fff !important;
}

/* Remove LD's ✗ icon for our overridden items */
li.ldcq-nav-ok::before,
li.ldcq-nav-ok::after,
li.ldcq-nav-half::before,
li.ldcq-nav-half::after,
li.ldcq-nav-no::before,
li.ldcq-nav-no::after,
.ldcq-nav-ok .wpProQuiz_reviewQuestionStar,
.ldcq-nav-half .wpProQuiz_reviewQuestionStar,
.ldcq-nav-ok > span,
.ldcq-nav-half > span {
    display: none !important;
}

/* LD 3.0 / Focus theme */
.learndash-wrapper .ldcq-nav-ok { background-color: #00a32a !important; }
.learndash-wrapper .ldcq-nav-half { background-color: #dba617 !important; }
.learndash-wrapper .ldcq-nav-no { background-color: #d63638 !important; }

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */

@media (max-width: 600px) {
    .ldcq-sub { padding: 14px; }
    .ldcq-sub-hdr { font-size: 14px; }
    .ldcq-opt { padding: 10px 12px; }
    .ldcq-opt-txt { font-size: 14px; }
    .ldcq-resp { font-size: 13px; padding: 10px 14px; }
}
