/* ══════════════════════════════════════
   Instant Courses Quiz
   ══════════════════════════════════════ */
.icq-wrap {
    padding: 24px;
    overflow-y: auto;
    background: #f9fafb;
    border-radius: 12px;
}

.icq-card {
    max-width: 900px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

/* Header */
.icq-header {
    padding: 18px 28px;
    border-bottom: 1px solid #e5e7eb;
}

.icq-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

/* Progress */
.icq-progress {
    padding: 16px 28px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.icq-progress-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 8px;
}

.icq-progress-label {
    font-weight: 600;
    color: #374151;
}

.icq-progress-remaining {
    color: #6b7280;
}

.icq-progress-bar {
    width: 100%;
    height: 10px;
    background: #e5e7eb;
    border-radius: 5px;
    overflow: hidden;
}

.icq-progress-fill {
    height: 100%;
    background: #2563eb;
    border-radius: 5px;
    transition: width 0.3s ease;
}

/* Question content */
.icq-content {
    padding: 28px 28px 20px;
}

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

.icq-question-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #dbeafe;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.icq-question-of {
    font-size: 13px;
    color: #6b7280;
}

.icq-question-text {
    font-size: 17px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 24px;
    padding-left: 42px;
    line-height: 1.5;
}

/* Answer options */
.icq-options {
    padding-left: 42px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.icq-option {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
}

.icq-option:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

.icq-option.selected {
    border-color: #2563eb;
    background: #eff6ff;
}

.icq-option input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #2563eb;
    flex-shrink: 0;
    cursor: pointer;
}

.icq-option span {
    margin-left: 14px;
    font-size: 14px;
    color: #111827;
    flex: 1;
}

/* Jump to question */
.icq-jump {
    padding: 16px 28px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.icq-jump-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
}

.icq-jump-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.icq-jump-btn {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    background: #e5e7eb;
    color: #374151;
}

.icq-jump-btn:hover:not(:disabled) {
    background: #d1d5db;
}

.icq-jump-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.icq-jump-btn.active {
    background: #2563eb;
    color: #fff;
}

.icq-jump-btn.answered {
    background: #dcfce7;
    color: #166534;
}

/* Navigation */
.icq-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    border-top: 1px solid #e5e7eb;
}

.icq-nav-prev {
    padding: 10px 22px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.icq-nav-prev:hover:not(:disabled) {
    background: #f9fafb;
}

.icq-nav-prev:disabled {
    color: #d1d5db;
    cursor: not-allowed;
}

.icq-nav-next {
    padding: 10px 22px;
    border: none;
    border-radius: 8px;
    background: #2563eb;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.icq-nav-next:hover:not(:disabled) {
    background: #1d4ed8;
}

.icq-nav-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.icq-nav-submit {
    padding: 10px 22px;
    border: none;
    border-radius: 8px;
    background: #22c55e;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    display: none;
}

.icq-nav-submit:hover:not(:disabled) {
    background: #16a34a;
}

.icq-nav-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Results page */
.icq-results {
    max-width: 900px;
    margin: 0 auto;
}

.icq-res-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

/* Score section */
.icq-res-score-section {
    text-align: center;
    padding: 48px 28px 36px;
    border-bottom: 1px solid #e5e7eb;
}

.icq-res-icon-circle {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.icq-res-green-circle { background: #dcfce7; }

.icq-res-pct {
    font-size: 48px;
    font-weight: 800;
    color: #111827;
    margin: 0 0 12px;
}

.icq-res-badge {
    display: inline-block;
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
}

.icq-res-badge-green { background: #dcfce7; color: #166534; }

.icq-res-msg {
    font-size: 15px;
    color: #6b7280;
    margin: 0;
}

/* Summary */
.icq-res-summary {
    padding: 24px 28px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.icq-res-summary-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 16px;
}

.icq-res-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.icq-res-stat {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px;
}

.icq-res-stat-icon {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

.icq-res-green { color: #16a34a; }
.icq-res-red { color: #dc2626; }
.icq-res-blue { color: #2563eb; }
.icq-res-purple { color: #7c3aed; }

.icq-res-stat-val {
    font-size: 24px;
    font-weight: 800;
    color: #111827;
    margin: 0;
}

.icq-res-stat-sm {
    font-size: 13px;
}

/* Breakdown */
.icq-res-breakdown {
    padding: 24px 28px;
}

.icq-res-breakdown-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 16px;
}

.icq-res-q {
    border: 2px solid;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 14px;
}

.icq-res-q-correct {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.icq-res-q-wrong {
    border-color: #fecaca;
    background: #fef2f2;
}

.icq-res-q-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.icq-res-q-left {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
}

.icq-res-q-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.icq-res-q-num-green { background: #bbf7d0; color: #166534; }
.icq-res-q-num-red { background: #fecaca; color: #991b1b; }

.icq-res-q-text {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 2px;
}

.icq-res-q-type {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
}

.icq-res-q-badge {
    flex-shrink: 0;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.icq-res-q-badge-green { background: #dcfce7; color: #166534; }
.icq-res-q-badge-red { background: #fee2e2; color: #991b1b; }

.icq-res-q-answers {
    padding-left: 42px;
}

.icq-res-q-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
}

.icq-res-q-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    width: 110px;
    flex-shrink: 0;
}

.icq-res-q-val {
    font-size: 13px;
    font-weight: 600;
    flex: 1;
}

.icq-res-green-text { color: #166534; }
.icq-res-red-text { color: #991b1b; }

.icq-res-q-explain {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #d1d5db;
}

.icq-res-q-explain-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 4px;
}

.icq-res-q-explain-text {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* Actions */
.icq-res-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.icq-res-back {
    padding: 10px 22px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}

.icq-res-back:hover {
    background: #f9fafb;
}

.icq-res-retake {
    padding: 10px 22px;
    border: none;
    border-radius: 8px;
    background: #2563eb;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}

.icq-res-retake:hover {
    background: #1d4ed8;
}

.icq-res-actions-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.icq-res-certificate {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    border: none;
    border-radius: 8px;
    background: #16a34a;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}

.icq-res-certificate:hover {
    background: #15803d;
}

/* Certificate Modal */
.icq-cert-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.85);
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.icq-cert-close {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 10000;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s;
}

.icq-cert-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.icq-cert-img {
    max-width: 95vw;
    max-height: 92vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

@media (max-width: 768px) {
    .icq-res-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .icq-res-q-answers {
        padding-left: 0;
    }
}

@media (max-width: 576px) {
    .icq-wrap {
        padding: 12px;
    }

    .icq-header,
    .icq-progress,
    .icq-content,
    .icq-jump,
    .icq-nav {
        padding-left: 16px;
        padding-right: 16px;
    }

    .icq-question-text,
    .icq-options {
        padding-left: 0;
    }

    .icq-res-summary-grid {
        grid-template-columns: 1fr 1fr;
    }
}
