/* ============================================
   MOCK TEST — Premium Exam UI
   ============================================ */

/* Setup Screen */
.exam-setup {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    animation: examFadeIn 0.5s ease-out;
}

.exam-hero-icon {
    width: 90px; height: 90px;
    border-radius: 24px;
    background: linear-gradient(135deg, #4f46e5 0%, #0069ff 100%);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 40px; color: #fff;
    margin-bottom: 20px;
    box-shadow: 0 12px 32px rgba(99, 91, 255, 0.3);
    animation: heroFloat 3s ease-in-out infinite;
}

@keyframes heroFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.exam-option-cards { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 24px 0; }

.exam-opt-card {
    flex: 1; min-width: 120px; max-width: 160px;
    padding: 20px 16px; border-radius: var(--radius-lg);
    border: 2px solid var(--border); background: var(--surface);
    cursor: pointer; transition: all 0.25s ease;
    text-align: center;
}
.exam-opt-card:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.exam-opt-card.selected { border-color: var(--primary); background: var(--primary-subtle); box-shadow: 0 4px 16px rgba(99, 91, 255, 0.2); }
.exam-opt-card .opt-num { font-size: 28px; font-weight: 800; color: var(--primary); }
.exam-opt-card .opt-label { font-size: 11px; color: var(--text-tertiary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }

.exam-rules {
    background: var(--bg-subtle); border-radius: var(--radius-lg);
    padding: 16px 20px; margin: 20px 0; text-align: left;
    border: 1px solid var(--border);
}
.exam-rules li { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.exam-rules li i { color: var(--primary); margin-right: 6px; }

.btn-start-exam {
    background: linear-gradient(135deg, #4f46e5 0%, #005dfe 100%);
    border: none; color: #fff; padding: 12px 40px; border-radius: 50px;
    font-weight: 700; font-size: 15px; letter-spacing: 0.02em;
    box-shadow: 0 8px 24px rgba(99, 91, 255, 0.35);
    transition: all 0.3s ease; cursor: pointer;
}
.btn-start-exam:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 12px 32px rgba(99, 91, 255, 0.45); }
.btn-start-exam:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Question Screen */
.exam-live { animation: examSlideIn 0.4s ease-out; }

.exam-top-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 24px; background: #fff;
    border: 1px solid #f1f5f9; border-radius: 24px;
    margin-bottom: 24px; box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.exam-timer-circle {
    width: 54px; height: 54px; position: relative;
    display: flex; align-items: center; justify-content: center;
}
.exam-timer-circle svg { position: absolute; top: 0; left: 0; transform: rotate(-90deg); }
.exam-timer-circle .timer-text {
    font-size: 16px; font-weight: 800; color: var(--primary); z-index: 1;
}
.exam-timer-circle.warning .timer-text { color: var(--warning); }
.exam-timer-circle.danger .timer-text { color: var(--danger); animation: timerPulse 0.5s ease infinite; }

@keyframes timerPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }

.exam-score-pills { display: flex; gap: 10px; }
.score-pill {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 50px; font-size: 14px; font-weight: 800;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}
.score-pill.correct { 
    background: #ecfdf5; color: #059669; border: 1.5px solid #10b981; 
}
.score-pill.wrong { 
    background: #fef2f2; color: #dc2626; border: 1.5px solid #ef4444; 
}

.score-pill-pop {
    animation: scorePop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes scorePop {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.exam-progress-wrap { margin-bottom: 20px; }
.exam-progress-bar {
    height: 6px; border-radius: 3px; background: var(--bg-inset); overflow: hidden;
}
.exam-progress-fill {
    height: 100%; border-radius: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
    transition: width 0.4s ease;
}
.exam-progress-text { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--text-tertiary); font-weight: 600; }

.exam-question-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-xl); padding: 28px; margin-bottom: 16px;
    box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.exam-question-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, #005dfe 100%);
}
.exam-q-number { font-size: 11px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.exam-q-text { font-size: 16px; font-weight: 700; color: var(--text-primary); line-height: 1.6; margin-bottom: 20px; }

.exam-options { display: flex; flex-direction: column; gap: 10px; }
.exam-option-btn {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 18px; border-radius: var(--radius-md);
    border: 2px solid var(--border); background: var(--surface);
    cursor: pointer; transition: all 0.2s ease; text-align: left; width: 100%;
    font-size: 14px; color: var(--text-primary); font-weight: 500;
}
.exam-option-btn:hover:not(.disabled) { border-color: var(--primary); background: rgba(99, 91, 255, 0.03); transform: translateX(4px); }
.exam-option-btn .opt-index {
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--bg-inset); display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 13px; color: var(--text-secondary); flex-shrink: 0;
    transition: all 0.2s ease;
}
.exam-option-btn:hover:not(.disabled) .opt-index { background: var(--primary-subtle); color: var(--primary); }

.exam-option-btn.selected-correct {
    border-color: var(--success); background: rgba(34, 197, 94, 0.06);
    animation: optionCorrect 0.4s ease;
}
.exam-option-btn.selected-correct .opt-index { background: var(--success); color: #fff; }

.exam-option-btn.selected-wrong {
    border-color: var(--danger); background: rgba(239, 68, 68, 0.06);
    animation: optionShake 0.4s ease;
}
.exam-option-btn.selected-wrong .opt-index { background: var(--danger); color: #fff; }

.exam-option-btn.reveal-correct { border-color: var(--success); background: rgba(34, 197, 94, 0.06); }
.exam-option-btn.reveal-correct .opt-index { background: var(--success); color: #fff; }
.exam-option-btn.disabled { pointer-events: none; opacity: 0.7; }

@keyframes optionCorrect { 0% { transform: scale(0.97); } 50% { transform: scale(1.02); } 100% { transform: scale(1); } }
@keyframes optionShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.btn-next-q {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    border: none; color: #fff; padding: 10px 28px; border-radius: 50px;
    font-weight: 700; font-size: 14px; box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
    transition: all 0.3s ease; cursor: pointer;
}
.btn-next-q:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(245, 158, 11, 0.45); color: #fff; }

/* Results Screen */
.exam-results { max-width: 600px; margin: 0 auto; text-align: center; animation: examFadeIn 0.6s ease-out; }

.result-badge {
    width: 120px; height: 120px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 50px; margin-bottom: 16px;
    animation: resultBounce 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
.result-badge.pass { background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%); color: #fff; box-shadow: 0 12px 40px rgba(34, 197, 94, 0.4); }
.result-badge.fail { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); color: #fff; box-shadow: 0 12px 40px rgba(239, 68, 68, 0.4); }

@keyframes resultBounce { 0% { transform: scale(0); opacity: 0; } 60% { transform: scale(1.2); } 100% { transform: scale(1); opacity: 1; } }

.result-score-ring {
    width: 160px; height: 160px; margin: 20px auto; position: relative;
    display: flex; align-items: center; justify-content: center;
}
.result-score-ring svg { position: absolute; top: 0; left: 0; transform: rotate(-90deg); }
.result-score-ring .score-pct { font-size: 36px; font-weight: 900; color: var(--text-primary); z-index: 1; }
.result-score-ring .score-pct small { font-size: 16px; font-weight: 600; }

.result-stats { display: flex; gap: 12px; justify-content: center; margin: 20px 0; flex-wrap: wrap; }
.result-stat-card {
    flex: 1; min-width: 100px; padding: 14px; border-radius: var(--radius-lg);
    border: 1px solid var(--border); background: var(--surface);
}
.result-stat-card .stat-val { font-size: 24px; font-weight: 800; }
.result-stat-card .stat-lbl { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-tertiary); }

.result-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.btn-review {
    background: var(--surface); border: 2px solid var(--primary); color: var(--primary);
    padding: 10px 24px; border-radius: 50px; font-weight: 700; font-size: 13px;
    transition: all 0.3s ease; cursor: pointer;
}
.btn-review:hover { background: var(--primary); color: #fff; }

/* Review Screen */
.exam-review { animation: examFadeIn 0.4s ease-out; }
.review-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 20px; margin-bottom: 12px;
    border-left: 4px solid var(--danger); transition: all 0.2s ease;
}
.review-card:hover { box-shadow: var(--shadow-md); }
.review-card .review-q { font-weight: 700; font-size: 14px; color: var(--text-primary); margin-bottom: 10px; }
.review-card .your-ans { font-size: 13px; color: var(--danger); margin-bottom: 4px; }
.review-card .correct-ans { font-size: 13px; color: var(--success); font-weight: 600; }

/* Confetti */
.confetti-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 9999; overflow: hidden; }
.confetti-piece {
    position: absolute; width: 10px; height: 10px; top: -10px;
    animation: confettiFall 3s linear forwards;
}
@keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Animations */
@keyframes examFadeIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes examSlideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* Responsive */
@media (max-width: 576px) {
    .exam-question-card { padding: 18px; }
    .exam-q-text { font-size: 14px; }
    .exam-option-btn { padding: 12px 14px; font-size: 13px; }
    .exam-opt-card { min-width: 80px; padding: 14px 10px; }
    .exam-opt-card .opt-num { font-size: 22px; }
}

/* Particles for correct answer */
.particle {
    position: absolute;
    pointer-events: none;
    z-index: 100;
    border-radius: 50%;
    animation: particleOut 0.8s ease-out forwards;
}

@keyframes particleOut {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}
