/* =============================================
   Quiz Plugin – Frontend Styles
   ============================================= */

.quiz-container {
    max-width: 720px;
    margin: 30px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.quiz-title {
    font-size: 1.6em;
    margin-bottom: 20px;
    color: #1a1a1a;
    border-bottom: 3px solid #2563eb;
    padding-bottom: 10px;
}

/* ---- Progress bar ---- */
.quiz-progress-wrap {
    margin-bottom: 24px;
}

.quiz-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.quiz-progress-text {
    font-size: 0.9em;
    font-weight: 600;
    color: #6b7280;
    letter-spacing: 0.02em;
}

.quiz-progress-track {
    height: 6px;
    background: #e5e7eb;
    border-radius: 99px;
    overflow: hidden;
}

.quiz-progress-bar {
    height: 100%;
    width: 0%;
    background: #2563eb;
    border-radius: 99px;
    transition: width 0.4s ease;
}

/* ---- Questions ---- */
.quiz-question {
    display: none;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 28px 28px 24px;
}

.quiz-question.is-active {
    display: block;
    animation: quiz-slide-in 0.3s ease;
}

.quiz-question.is-exiting {
    animation: quiz-slide-out 0.3s ease forwards;
    pointer-events: none;
}

@keyframes quiz-slide-in {
    from {
        opacity: 0;
        transform: translateX(24px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes quiz-slide-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-24px);
    }
}

.quiz-question-text {
    font-size: 1.1em;
    font-weight: 600;
    color: #111827;
    margin: 0 0 20px;
    line-height: 1.55;
}

/* ---- Choices ---- */
.quiz-choices {
    list-style: none;
    margin: 0;
    padding: 0;
}

.quiz-choice {
    margin-bottom: 10px;
}

.quiz-choice label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    font-size: 0.97em;
    color: #374151;
}

.quiz-choice label:hover {
    background: #eff6ff;
    border-color: #93c5fd;
}

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

.quiz-choice.choice-correct label {
    background: #dcfce7;
    border-color: #16a34a;
    color: #14532d;
    font-weight: 600;
}

.quiz-choice.choice-incorrect label {
    background: #fee2e2;
    border-color: #dc2626;
    color: #7f1d1d;
}

.quiz-choice.choice-reveal label {
    background: #dcfce7;
    border-color: #16a34a;
    color: #14532d;
}

/* Lock hover & cursor after answer is revealed */
.quiz-choice label.no-hover {
    cursor: default;
    pointer-events: none;
}

/* ---- Per-question feedback ---- */
.quiz-question-feedback {
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.95em;
    font-weight: 600;
    min-height: 0;
    display: none;
}

.quiz-question-feedback.correct {
    display: block;
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #15803d;
}

.quiz-question-feedback.incorrect {
    display: block;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #b91c1c;
}

/* ---- Navigation ---- */
.quiz-nav {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
}

.quiz-next-btn,
.quiz-retry-btn {
    display: inline-block;
    padding: 12px 32px;
    font-size: 1em;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    letter-spacing: 0.01em;
}

.quiz-next-btn {
    background: #2563eb;
    color: #fff;
    min-width: 140px;
}

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

.quiz-next-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.quiz-next-btn:disabled {
    background: #bfdbfe;
    cursor: not-allowed;
}

.quiz-retry-btn {
    background: #f3f4f6;
    color: #374151;
    border: 2px solid #d1d5db;
}

.quiz-retry-btn:hover {
    background: #e5e7eb;
}

/* ---- Results ---- */
.quiz-results {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 36px 28px;
    text-align: center;
}

.quiz-score-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.quiz-score-circle {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: conic-gradient(#2563eb var(--pct, 0%), #e5e7eb 0%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.quiz-score-circle::after {
    content: '';
    position: absolute;
    width: 82px;
    height: 82px;
    background: #fff;
    border-radius: 50%;
}

.quiz-score-percent {
    position: relative;
    z-index: 1;
    font-size: 1.5em;
    font-weight: 700;
    color: #1a1a1a;
}

.quiz-score-info {
    text-align: left;
}

.quiz-score-text {
    font-size: 1.05em;
    color: #374151;
    margin: 0 0 6px;
}

.quiz-pass-fail {
    font-size: 1.15em;
    font-weight: 700;
    margin: 0;
}

.quiz-pass-fail.passed { color: #16a34a; }
.quiz-pass-fail.failed { color: #dc2626; }

.quiz-error {
    color: #dc2626;
    font-style: italic;
}
