/* ============================================================
   CERDASTKA - QUESTION TYPE SYSTEM
   ============================================================ */


/* ------------------------------------------------------------
   ADMIN QUESTION BUILDER
   ------------------------------------------------------------ */

.question-type-panel {
    margin-top: 24px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fbfcff;
}

.question-panel-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.question-panel-title strong {
    display: block;
    color: var(--ink);
    font-size: 15px;
}

.question-panel-title span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}


.admin-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.admin-option-item {
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #fff;
}

.admin-option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.admin-option-header > label:first-child {
    font-weight: 800;
    color: var(--ink);
}

.correct-radio,
.correct-checkbox {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    margin: 0 !important;
    font-size: 11px !important;
    color: var(--blue) !important;
    font-weight: 700;
}

.correct-radio input,
.correct-checkbox input {
    width: auto !important;
    margin: 0 !important;
}


.admin-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #fff;
}


.question-builder-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
}

.question-builder-table th,
.question-builder-table td {
    padding: 13px 15px;
    border-bottom: 1px solid var(--line);
}

.question-builder-table th {
    background: #f8faff;
    color: var(--ink);
    font-size: 12px;
    text-align: left;
}

.question-builder-table td {
    background: #fff;
}

.question-builder-table textarea {
    width: 100%;
    min-height: 58px;
    resize: vertical;
}

.question-builder-table tr:last-child td {
    border-bottom: 0;
}

.center {
    text-align: center !important;
}


.table-delete-btn {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 9px;
    background: #fff1f1;
    color: var(--red);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.table-delete-btn:hover {
    background: #ffe1e1;
}


.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
}


/* ------------------------------------------------------------
   QUESTION TYPE BADGE
   ------------------------------------------------------------ */

.question-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--blue-soft);
    color: var(--blue);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.question-type-badge.badge-purple {
    background: #f3efff;
    color: #6941c6;
}

.question-type-badge.badge-green {
    background: #eafaf3;
    color: #087443;
}


/* ------------------------------------------------------------
   EXAM PAGE
   ------------------------------------------------------------ */

.exam-page {
    padding-bottom: 80px;
}

.exam-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    margin-bottom: 28px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255,255,255,.92);
    box-shadow: var(--shadow-sm);
}

.exam-header h2 {
    margin: 4px 0 5px;
}

.exam-header p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}


.exam-timer-container {
    min-width: 130px;
    text-align: right;
}

.timer-label {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 3px;
}

.timer {
    font-family: "Plus Jakarta Sans", sans-serif;
    color: var(--ink);
    font-size: 27px;
    font-weight: 800;
    letter-spacing: -1px;
}

.timer-warning {
    color: var(--red) !important;
}


/* ------------------------------------------------------------
   QUESTION CARD
   ------------------------------------------------------------ */

.question-card {
    padding: 25px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.question-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.question-number {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--blue);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.question-type-label {
    padding: 5px 9px;
    border-radius: 999px;
    background: #f4f6fa;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.question-content h3 {
    color: var(--ink);
    font-size: 17px;
    line-height: 1.7;
    margin-bottom: 20px;
}


/* ------------------------------------------------------------
   PILIHAN GANDA
   ------------------------------------------------------------ */

.exam-options {
    display: grid;
    gap: 11px;
}

.exam-option {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px 17px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
    cursor: pointer;
    transition:
        border-color .18s ease,
        background .18s ease,
        transform .18s ease;
}

.exam-option:hover {
    border-color: #b9c9ff;
    background: #fafcff;
    transform: translateY(-1px);
}

.exam-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.exam-option-code {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid #dce2ed;
    border-radius: 9px;
    color: var(--ink);
    background: #f8f9fc;
    font-size: 12px;
    font-weight: 800;
}

.exam-option-text {
    padding-top: 5px;
    color: var(--ink-2);
    font-size: 14px;
    line-height: 1.6;
}

.exam-option:has(input:checked) {
    border-color: var(--blue);
    background: var(--blue-soft);
}

.exam-option:has(input:checked)
.exam-option-code {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff;
}


/* ------------------------------------------------------------
   BENAR / SALAH
   ------------------------------------------------------------ */

.tf-instruction,
.complex-instruction {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 16px;
    padding: 13px 15px;
    border-radius: 12px;
    background: #f7f9fc;
    color: var(--muted);
    font-size: 12px;
}

.complex-instruction strong {
    color: var(--ink);
    font-size: 13px;
}

.exam-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 15px;
}

.exam-answer-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
}

.exam-answer-table th,
.exam-answer-table td {
    padding: 15px;
    border-bottom: 1px solid var(--line);
}

.exam-answer-table th {
    background: #f8faff;
    color: var(--ink);
    font-size: 12px;
    text-align: left;
}

.exam-answer-table th:not(:first-child),
.exam-answer-table td:not(:first-child) {
    width: 100px;
    text-align: center;
}

.exam-answer-table td:first-child {
    color: var(--ink-2);
    font-size: 14px;
}

.exam-answer-table tr:last-child td {
    border-bottom: 0;
}


/* custom radio */

.table-radio {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.table-radio input {
    position: absolute;
    opacity: 0;
}

.table-radio span {
    width: 22px;
    height: 22px;
    display: block;
    border: 2px solid #cbd3df;
    border-radius: 50%;
    transition: .18s;
}

.table-radio input:checked + span {
    border-color: var(--blue);
    background: var(--blue);
    box-shadow:
        inset 0 0 0 5px #fff;
}


/* ------------------------------------------------------------
   SUBMIT AREA
   ------------------------------------------------------------ */

.exam-submit {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-top: 26px;
    padding: 20px 22px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.exam-submit > div {
    display: flex;
    flex-direction: column;
}

.exam-submit strong {
    color: var(--ink);
    font-size: 14px;
}

.exam-submit span {
    color: var(--muted);
    font-size: 12px;
}


/* ------------------------------------------------------------
   RESULT
   ------------------------------------------------------------ */

.result-detail-card {
    margin-top: 30px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.result-answer-list {
    display: grid;
    gap: 0;
    margin-top: 25px;
}

.result-question {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid var(--line);
}

.result-question:last-child {
    border-bottom: 0;
}

.result-question-number {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #f3f6fb;
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
}

.result-question-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.result-question-meta > span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.result-correct {
    color: var(--green);
    font-size: 11px;
}

.result-wrong {
    color: var(--red);
    font-size: 11px;
}

.result-question-content h4 {
    color: var(--ink);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 7px;
}

.result-answer-text {
    color: var(--muted);
    font-size: 12px;
    margin: 0;
}

.result-answer-text strong {
    color: var(--ink);
}


/* ------------------------------------------------------------
   RESPONSIVE
   ------------------------------------------------------------ */

@media (max-width: 800px) {

    .admin-options-grid {
        grid-template-columns: 1fr;
    }

    .exam-header {
        align-items: flex-start;
    }

    .exam-timer-container {
        min-width: 90px;
    }

    .timer {
        font-size: 23px;
    }

    .exam-submit {
        align-items: stretch;
        flex-direction: column;
    }

    .exam-submit .btn {
        width: 100%;
    }

}


@media (max-width: 560px) {

    .question-card {
        padding: 18px;
        border-radius: 16px;
    }

    .question-content h3 {
        font-size: 15px;
    }

    .exam-header {
        flex-direction: column;
    }

    .exam-timer-container {
        width: 100%;
        text-align: left;
    }

    .question-panel-title {
        align-items: flex-start;
    }

    .result-detail-card {
        padding: 20px;
    }

    .result-question {
        grid-template-columns: 1fr;
    }

}