/* Container Layouts */
.quiz-container,
.results-container {
    max-width: 820px;
    margin: 2rem auto;
    background: #111625;
    border: 1px solid #1e293b;
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    padding: 2.5rem;
    color: #e2e8f0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.quiz-container h3,
.results-container h2,
.review-header h3,
.review-card h4 {
    color: #ffffff !important;
}

/* Header Progress Bars */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #020617;
    border: 1px solid #1e293b;
    border-radius: 999px;
    margin: 1rem 0 1.5rem 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #10b981);
    width: 0%;
    transition: width 0.3s ease-in-out;
}

.quiz-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    color: #94a3b8;
    font-weight: 700;
}

/* Questions & Option Styling */
.question-title {
    font-size: 1.3rem;
    color: #f8fafc;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.options-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 2rem;
}

.empty-options-message {
    margin: 0;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.22);
    border-radius: 10px;
    padding: 1rem;
}

.option-card {
    background: #0f172a;
    border: 1px solid #263449;
    border-radius: 12px;
    padding: 1.1rem 1.5rem;
    font-size: 1.02rem;
    text-align: left;
    cursor: pointer;
    color: #cbd5e1;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.option-card:hover {
    background: #151f32;
    border-color: #475569;
    color: #ffffff;
    transform: translateY(-1px);
}

.option-card.selected {
    background: rgba(79, 70, 229, 0.18);
    border-color: #818cf8;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.45), 0 12px 30px rgba(79, 70, 229, 0.15);
}

/* Footer & Buttons */
.quiz-footer {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #1e293b;
    padding-top: 1.5rem;
    gap: 10px;
}

.btn {
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.btn:disabled {
    background: #1e293b !important;
    color: #64748b !important;
    cursor: not-allowed;
    transform: none;
}

.btn-primary { background: #4f46e5; color: white; }
.btn-primary:hover { background: #6366f1; }
.btn-success { background: #059669; color: white; }
.btn-success:hover { background: #10b981; }
.btn-danger { background: #dc2626; color: white; }
.btn-danger:hover { background: #ef4444; }

/* Score Breakdown & Review Options */
.results-summary-box {
    text-align: center;
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 14px;
    padding: 2rem;
    margin-bottom: 2.5rem;
}

.results-summary-box p {
    color: #94a3b8 !important;
}

.score-circle {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(79, 70, 229, 0.18);
    border: 4px solid #6366f1;
    margin-bottom: 1rem;
}

#final-score {
    font-size: 2rem;
    font-weight: 900;
    color: #c4b5fd;
}

/* Result Percentage Bar */
.results-bar-container {
    width: 100%;
    height: 12px;
    background: #020617;
    border: 1px solid #1e293b;
    border-radius: 999px;
    margin-top: 1.5rem;
    overflow: hidden;
}

.results-bar-fill {
    height: 100%;
    width: 0%;
    background: #10b981;
    border-radius: 999px;
    transition: width 0.8s ease-out;
}

/* Detailed Review Cards */
.review-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #1e293b;
    padding-bottom: 0.75rem;
    color: #ffffff;
}

.review-card {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 6px solid #475569;
}

.correct-border { border-left-color: #10b981; }
.wrong-border { border-left-color: #ef4444; }

.review-status-row {
    margin-bottom: 1rem;
}

.status-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    margin-right: 0.4rem;
}

.badge-success { background: rgba(16, 185, 129, 0.16); color: #6ee7b7; }
.badge-danger { background: rgba(239, 68, 68, 0.16); color: #fca5a5; }
.badge-warning { background: rgba(245, 158, 11, 0.16); color: #fcd34d; }

.review-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 1rem 0;
}

.review-option {
    padding: 0.85rem 1rem;
    border-radius: 10px;
    background: #111827;
    border: 1px solid #263449;
    color: #cbd5e1;
}

.opt-correct {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.4);
    color: #d1fae5;
}

.opt-incorrect {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fee2e2;
}

.badge-marker {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 800;
    margin-left: 10px;
    padding: 0.18rem 0.45rem;
    border-radius: 999px;
}

.correct-marker { background: #10b981; color: white; }
.incorrect-marker { background: #ef4444; color: white; }

.explanation-box {
    background: #111827;
    border-top: 1px dashed #334155;
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 10px;
    font-size: 0.95rem;
}

.explanation-box strong {
    color: #e2e8f0;
    display: block;
    margin-bottom: 0.25rem;
}

.explanation-box p {
    margin: 0;
    color: #94a3b8;
    font-style: italic;
}

/* Question category and multi-select UI */
.question-context-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.question-category-pill,
.category-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    border: 1px solid rgba(129, 140, 248, 0.35);
    background: rgba(79, 70, 229, 0.14);
    color: #c4b5fd;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    padding: 0.35rem 0.7rem;
}

.answer-mode,
.multi-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    border: 1px solid rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    padding: 0.35rem 0.7rem;
}

.answer-mode-warning {
    border-color: rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.12);
    color: #fcd34d;
}

.answer-mode-success {
    border-color: rgba(16, 185, 129, 0.5);
    background: rgba(16, 185, 129, 0.16);
    color: #a7f3d0;
}

.answer-mode-danger {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.16);
    color: #fecaca;
}

.quiz-timer-learning {
    background: rgba(16, 185, 129, 0.14) !important;
    color: #a7f3d0 !important;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.quiz-timer-mock {
    background: rgba(239, 68, 68, 0.14) !important;
    color: #fecaca !important;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.option-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.85rem;
}

.option-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 2rem;
    height: 2rem;
    border-radius: 0.75rem;
    background: #020617;
    border: 1px solid #334155;
    color: #a5b4fc;
    font-weight: 900;
}

.option-card.selected .option-letter {
    background: rgba(79, 70, 229, 0.35);
    border-color: #818cf8;
    color: #ffffff;
}

.option-content {
    line-height: 1.45;
}

.option-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    color: #a7f3d0;
    font-weight: 900;
}

/* Category results breakdown */
.category-breakdown-section {
    margin-bottom: 2.5rem;
}

.category-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.category-card {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-left: 5px solid #64748b;
    border-radius: 14px;
    padding: 1rem;
}

.category-card.category-good { border-left-color: #10b981; }
.category-card.category-mid { border-left-color: #f59e0b; }
.category-card.category-low { border-left-color: #ef4444; }

.category-card-topline {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.category-card-title {
    color: #f8fafc;
    font-weight: 850;
    line-height: 1.25;
}

.category-card-score {
    color: #c4b5fd;
    font-size: 1.1rem;
    font-weight: 950;
    white-space: nowrap;
}

.category-card-meta {
    color: #94a3b8;
    font-size: 0.84rem;
    margin-bottom: 0.8rem;
}

.category-progress-track {
    height: 8px;
    background: #020617;
    border: 1px solid #1e293b;
    border-radius: 999px;
    overflow: hidden;
}

.category-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #10b981);
    border-radius: 999px;
}

.review-question-topline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.badge-neutral {
    background: rgba(100, 116, 139, 0.16);
    color: #cbd5e1;
}

.opt-selected {
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.2);
}


/* Review filtering controls */
.review-header-with-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.review-filter-summary {
    margin: 0.35rem 0 0;
    color: #94a3b8;
    font-size: 0.92rem;
    line-height: 1.45;
}

.clear-review-filters {
    border: 1px solid rgba(129, 140, 248, 0.35);
    background: rgba(79, 70, 229, 0.12);
    color: #c4b5fd;
    border-radius: 999px;
    padding: 0.55rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 850;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

.clear-review-filters:hover:not(:disabled) {
    background: rgba(79, 70, 229, 0.22);
    border-color: rgba(129, 140, 248, 0.65);
    transform: translateY(-1px);
}

.clear-review-filters:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.review-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    background: rgba(15, 23, 42, 0.86);
    border: 1px solid #1e293b;
    border-radius: 14px;
    padding: 1rem;
    margin: -0.25rem 0 1rem;
}

.review-filter-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.filter-label {
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-right: 0.1rem;
}

.filter-chip {
    border: 1px solid #263449;
    background: #0b1120;
    color: #cbd5e1;
    border-radius: 999px;
    padding: 0.45rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 850;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.filter-chip:hover {
    background: #151f32;
    border-color: #475569;
    color: #ffffff;
    transform: translateY(-1px);
}

.filter-chip.active {
    background: rgba(79, 70, 229, 0.22);
    border-color: #818cf8;
    color: #ffffff;
    box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.28);
}

.active-category-filter {
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    flex-wrap: wrap;
    background: rgba(79, 70, 229, 0.12);
    border: 1px solid rgba(129, 140, 248, 0.35);
    color: #cbd5e1;
    border-radius: 14px;
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
}

.active-category-filter strong {
    color: #f8fafc;
}

.active-category-filter button {
    border: 1px solid rgba(129, 140, 248, 0.35);
    background: rgba(15, 23, 42, 0.85);
    color: #c4b5fd;
    border-radius: 999px;
    padding: 0.4rem 0.7rem;
    font-weight: 850;
    cursor: pointer;
}

.category-card {
    display: block;
    width: 100%;
    appearance: none;
    text-align: left;
    font: inherit;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.category-card:hover {
    transform: translateY(-2px);
    background: #111c31;
    border-color: rgba(129, 140, 248, 0.55);
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.18);
}

.category-card-active,
.category-card-active.category-good,
.category-card-active.category-mid,
.category-card-active.category-low {
    border-color: #818cf8;
    border-left-color: #818cf8;
    box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.25), 0 16px 35px rgba(79, 70, 229, 0.18);
}

.category-card-filter-hint {
    display: block;
    color: #818cf8;
    font-size: 0.75rem;
    font-weight: 850;
    margin-top: 0.65rem;
}

.review-empty-state {
    background: #0f172a;
    border: 1px dashed #334155;
    border-radius: 14px;
    color: #cbd5e1;
    padding: 1.5rem;
    margin-top: 1rem;
    text-align: center;
}

.review-empty-state strong {
    display: block;
    color: #f8fafc;
    margin-bottom: 0.35rem;
}

.review-empty-state p {
    margin: 0;
    color: #94a3b8;
}

@media (max-width: 640px) {
    .quiz-container,
    .results-container {
        padding: 1.25rem;
        margin: 0.5rem auto;
    }

    .option-card {
        grid-template-columns: auto 1fr;
    }

    .option-check {
        grid-column: 2;
        justify-self: start;
    }
}
