/* ========================================
   QUESTION BANK — Shared Styles
   Covers: Dashboard, Creation, Test Session
   ======================================== */

/* ----------------------------------------
   GRADE CHIP (Top Bar)
   ---------------------------------------- */
.qb-grade-chip {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 6px 14px;
    border-radius: var(--radius-md);
    background: var(--color-glass);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: clamp(0.75rem, 1.8vw, 0.85rem);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.qb-grade-chip:hover {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.qb-grade-chip i:first-child {
    font-size: 1.1em;
}

.qb-grade-chip i:last-child {
    font-size: 0.8em;
    opacity: 0.6;
}

/* ----------------------------------------
   SECTION LAYOUT
   ---------------------------------------- */
.qb-dashboard {
    padding: var(--space-md);
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    padding-bottom: 100px;
    /* Space for floating CTA */
}

.qb-section-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.qb-section-header h2 {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    font-weight: 600;
    color: var(--color-text);
}

.qb-section-header h2 i {
    color: var(--color-primary);
    font-size: 1.2em;
}

.qb-collapse-btn {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
}

.qb-collapse-btn:hover {
    color: var(--color-primary);
}

.qb-collapse-btn i {
    transition: transform 0.3s ease;
}

.qb-collapse-btn.collapsed i {
    transform: rotate(180deg);
}

.qb-subsection {
    margin-bottom: var(--space-md);
}

.qb-subsection-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.qb-subsection-header h3 {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: clamp(0.9rem, 2vw, 1.05rem);
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
}

.qb-subsection-header h3 i {
    font-size: 1.1em;
    opacity: 0.7;
}

.qb-see-all {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    opacity: 0.8;
    transition: opacity 0.2s ease, gap 0.2s ease;
    white-space: nowrap;
}

.qb-see-all:hover {
    gap: 8px;
    opacity: 1;
}

/* ----------------------------------------
   TEST CARDS GRID & CARDS
   ---------------------------------------- */
.qb-tests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-md);
}

.qb-test-card {
    background: var(--color-surface);
    border: 1px solid var(--color-glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.qb-test-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.qb-test-card-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
}

.qb-test-card-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--color-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
    color: var(--color-primary);
}

.qb-test-card-title-group {
    flex: 1;
    min-width: 0;
}

.qb-test-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qb-test-card-subjects {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.qb-test-subject-tag {
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: var(--color-glass);
    color: var(--color-text-muted);
    font-weight: 500;
}

.qb-test-card-fav {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.qb-test-card-fav:hover,
.qb-test-card-fav.is-fav {
    color: #ef4444;
}

.qb-test-card-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.qb-test-card-meta i {
    font-size: 0.85rem;
}

.qb-mode-badge {
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 600;
}

.qb-mode-badge.study {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
}

.qb-mode-badge.test {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
}

.qb-difficulty {
    display: flex;
    gap: 3px;
    align-items: center;
}

.qb-difficulty-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-border);
}

.qb-difficulty-dot.filled {
    background: var(--color-primary);
}

.qb-test-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--space-xs);
    border-top: 1px solid var(--color-glass-border);
}

.qb-test-card-date {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.qb-test-card-actions {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.qb-test-card-score {
    font-family: var(--font-family-ui);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--color-primary);
}

.qb-test-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 500;
    font-family: inherit;
    background: var(--color-glass);
    border: 1px solid var(--color-glass-border);
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.qb-test-action-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.qb-test-action-btn.repeat {
    color: var(--color-text-muted);
}

/* ---- Empty State ---- */
.qb-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl) var(--space-md);
    text-align: center;
    color: var(--color-text-muted);
    gap: var(--space-xs);
}

.qb-empty-state-icon {
    font-size: 2rem;
    opacity: 0.4;
    margin-bottom: var(--space-xs);
}

.qb-empty-state h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text);
}

.qb-empty-state p {
    font-size: 0.8rem;
    max-width: 280px;
}

.qb-empty-state-action {
    margin-top: var(--space-sm);
    padding: 8px 20px;
    border-radius: var(--radius-md);
    background: var(--color-primary);
    color: #fff;
    border: none;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.qb-empty-state-action:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
}

/* ----------------------------------------
   QUICK WIZARD — SINGLE SCREEN
   ---------------------------------------- */
.qb-quick-all-card {
    max-width: 560px;
    margin: 0 auto;
    background: var(--color-surface);
    border: 1px solid var(--color-glass-border);
    border-radius: var(--radius-xl);
    padding: clamp(20px, 4vw, 36px);
}

.qb-quick-section {
    margin-bottom: var(--space-lg);
}

.qb-quick-label {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    margin-bottom: var(--space-sm);
}

.qb-quick-label i {
    font-size: 1rem;
    color: var(--color-primary);
}

/* Mode Pills */
.qb-quick-mode-row {
    display: flex;
    gap: var(--space-sm);
}

.qb-quick-pill {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: var(--color-glass);
    border: 1px solid var(--color-glass-border);
    color: var(--color-text);
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.qb-quick-pill:hover {
    border-color: var(--color-primary);
}

.qb-quick-pill.selected {
    border-color: var(--color-primary);
    background: rgba(45, 184, 76, 0.1);
    color: var(--color-primary);
    font-weight: 600;
}

/* Subject Chips — horizontal wrap */
.qb-quick-subjects {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

/* Count Buttons */
.qb-quick-count-row {
    display: flex;
    gap: var(--space-sm);
}

.qb-quick-count {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius-md);
    background: var(--color-glass);
    border: 1px solid var(--color-glass-border);
    color: var(--color-text);
    font-family: var(--font-family-ui);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.qb-quick-count:hover {
    border-color: var(--color-primary);
}

.qb-quick-count.selected {
    border-color: var(--color-primary);
    background: rgba(45, 184, 76, 0.1);
    color: var(--color-primary);
}

/* Start Button */
.qb-quick-launch {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    color: #fff;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s ease;
    margin-top: var(--space-sm);
}

.qb-quick-launch:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(45, 184, 76, 0.3);
}

/* ----------------------------------------
   WIZARD — CORE LAYOUT
   ---------------------------------------- */
.qb-wizard {
    max-width: 720px;
    margin: 0 auto;
    padding: var(--space-md);
    min-height: 50vh;
}

.qb-wizard-step {
    display: none;
}

.qb-wizard-step.active {
    display: block;
    animation: qbStepIn 0.35s ease;
}

@keyframes qbStepIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Step Header (back + progress) */
.qb-step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.qb-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-md);
    background: var(--color-glass);
    border: 1px solid var(--color-glass-border);
    color: var(--color-text);
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.qb-back-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* Progress Dots */
.qb-progress-dots {
    display: flex;
    gap: 6px;
    align-items: center;
}

.qb-progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-border);
    transition: all 0.3s ease;
}

.qb-progress-dot.active {
    width: 24px;
    border-radius: 4px;
    background: var(--color-primary);
}

.qb-progress-dot.done {
    background: var(--color-primary);
    opacity: 0.5;
}

/* Step Content */
.qb-step-content {
    max-width: 560px;
    margin: 0 auto;
}

.qb-step-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.qb-step-title i {
    font-size: 1.4rem;
    color: var(--color-primary);
}

.qb-step-title h2 {
    font-size: clamp(1.1rem, 3vw, 1.4rem);
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
}

/* Quick Title (quick-all header) */
.qb-quick-title {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
}

.qb-quick-title i {
    color: var(--color-primary);
}

/* ----------------------------------------
   TYPE SELECTION CARDS
   ---------------------------------------- */
.qb-type-cards {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    max-width: 560px;
    margin: var(--space-xl) auto 0;
}

.qb-type-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: clamp(16px, 3vw, 24px);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    border: 1px solid var(--color-glass-border);
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: start;
    font-family: inherit;
}

.qb-type-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.qb-type-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.qb-type-icon.exam-prep {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
}

.qb-type-icon.quick {
    background: rgba(45, 184, 76, 0.12);
    color: var(--color-primary);
}

.qb-type-icon.advanced {
    background: rgba(167, 139, 250, 0.12);
    color: #a78bfa;
}

.qb-type-info {
    flex: 1;
}

.qb-type-info h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 4px;
}

.qb-type-info p {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin: 0;
}

.qb-type-arrow {
    color: var(--color-text-muted);
    font-size: 1.1rem;
    transition: transform 0.2s ease;
}

[dir="rtl"] .qb-type-arrow {
    transform: scaleX(-1);
}

.qb-type-card:hover .qb-type-arrow {
    color: var(--color-primary);
}

/* ----------------------------------------
   OPTION CARDS (Mode, Pool, Difficulty)
   ---------------------------------------- */
.qb-mode-cards,
.qb-pool-cards,
.qb-diff-cards {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.qb-option-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    border: 1px solid var(--color-glass-border);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-align: start;
}

.qb-option-card:hover {
    border-color: var(--color-primary);
}

.qb-option-card.selected {
    border-color: var(--color-primary);
    background: rgba(45, 184, 76, 0.06);
}

.qb-option-card>i:first-child {
    font-size: 1.3rem;
    color: var(--color-text-muted);
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.qb-option-card.selected>i:first-child {
    color: var(--color-primary);
}

.qb-option-info {
    flex: 1;
}

.qb-option-info strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text);
}

.qb-option-info small {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.qb-option-check {
    font-size: 1.2rem;
    color: transparent;
    transition: color 0.2s ease;
}

.qb-option-card.selected .qb-option-check {
    color: var(--color-primary);
}

/* Difficulty Indicator Dots */
.qb-diff-indicator {
    font-size: 0.6rem;
    letter-spacing: 2px;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.qb-diff-indicator.easy {
    color: #4ade80;
}

.qb-diff-indicator.medium {
    color: #fbbf24;
}

.qb-diff-indicator.hard {
    color: #ef4444;
}

/* ----------------------------------------
   SUBJECT CHIPS (Advanced + Quick)
   ---------------------------------------- */
.qb-subject-grid,
.qb-quick-subjects {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.qb-subject-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    background: var(--color-glass);
    border: 1px solid var(--color-glass-border);
    color: var(--color-text);
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.qb-subject-chip:hover {
    border-color: var(--chip-color, var(--color-primary));
}

.qb-subject-chip.selected {
    border-color: var(--chip-color, var(--color-primary));
    background: var(--chip-color, var(--color-primary));
    color: #fff;
    font-weight: 600;
}

.qb-subject-chip i {
    font-size: 1rem;
}

/* ----------------------------------------
   COUNT CARDS (Advanced)
   ---------------------------------------- */
.qb-count-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--space-sm);
}

.qb-count-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 18px 12px;
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    border: 1px solid var(--color-glass-border);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-align: center;
}

.qb-count-card:hover {
    border-color: var(--color-primary);
}

.qb-count-card.selected {
    border-color: var(--color-primary);
    background: rgba(45, 184, 76, 0.06);
}

.qb-count-num {
    font-family: var(--font-family-ui);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--color-text);
    line-height: 1;
}

.qb-count-card.selected .qb-count-num {
    color: var(--color-primary);
}

.qb-count-label {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.qb-count-time {
    font-size: 0.65rem;
    color: var(--color-text-muted);
    opacity: 0.7;
    font-family: var(--font-family-ui);
}

/* ----------------------------------------
   SUMMARY CARD
   ---------------------------------------- */
.qb-summary-card {
    max-width: 480px;
    margin: 0 auto;
    background: var(--color-surface);
    border: 1px solid var(--color-glass-border);
    border-radius: var(--radius-xl);
    padding: clamp(20px, 4vw, 32px);
    overflow: hidden;
}

.qb-summary-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.qb-summary-header i {
    font-size: 1.4rem;
    color: var(--color-primary);
}

.qb-summary-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
}

.qb-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-glass-border);
}

.qb-summary-row:last-child {
    border-bottom: none;
}

.qb-summary-row.highlight {
    background: rgba(45, 184, 76, 0.04);
    margin: 0 -20px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    border-bottom: none;
}

.qb-summary-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.qb-summary-label i {
    font-size: 1rem;
    color: var(--color-primary);
}

.qb-summary-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text);
    max-width: 55%;
    text-align: end;
}

.qb-summary-count {
    font-family: var(--font-family-ui);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--color-primary);
}

/* Launch Button */
.qb-launch-btn {
    width: 100%;
    padding: 14px;
    margin-top: var(--space-lg);
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    color: #fff;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s ease;
}

.qb-launch-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(45, 184, 76, 0.3);
}

/* ----------------------------------------
   EXAM PREP CARDS
   ---------------------------------------- */
.qb-exam-prep-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-md);
}

.qb-ep-card {
    background: var(--color-surface);
    border: 1px solid var(--color-glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.qb-ep-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.qb-ep-top h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 8px;
}

.qb-ep-subjects {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.qb-ep-subject {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--tag-color) 12%, transparent);
    color: var(--tag-color);
    font-weight: 500;
}

.qb-ep-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    font-size: 0.72rem;
    color: var(--color-text-muted);
}

.qb-ep-meta span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.qb-ep-start {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    background: rgba(45, 184, 76, 0.1);
    border: 1px solid rgba(45, 184, 76, 0.2);
    color: var(--color-primary);
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: flex-start;
}

.qb-ep-start:hover {
    background: var(--color-primary);
    color: #fff;
}

/* ----------------------------------------
   WIZARD FOOTER (Fixed Next Button)
   ---------------------------------------- */
.qb-wizard-footer {
    padding: var(--space-lg) 0 var(--space-md);
    display: flex;
    justify-content: center;
    max-width: 560px;
    margin: 0 auto;
}

.qb-wizard-next {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 40px;
    border-radius: var(--radius-md);
    background: var(--color-primary);
    color: #fff;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.qb-wizard-next:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(45, 184, 76, 0.3);
}

/* ----------------------------------------
   WIZARD — RESPONSIVE DESKTOP
   ---------------------------------------- */
@media (min-width: 768px) {
    .qb-wizard {
        max-width: 900px;
    }

    /* Type cards: horizontal row */
    .qb-type-cards {
        flex-direction: row;
        max-width: 100%;
    }

    .qb-type-card {
        flex: 1;
        flex-direction: column;
        text-align: center;
        gap: var(--space-sm);
        padding: clamp(20px, 3vw, 32px);
    }

    .qb-type-arrow {
        display: none;
    }

    /* Option cards: 2-column grid */
    .qb-mode-cards {
        flex-direction: row;
    }

    .qb-mode-cards .qb-option-card {
        flex: 1;
    }

    .qb-diff-cards {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .qb-pool-cards {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    /* Step content: wider */
    .qb-step-content {
        max-width: 680px;
    }

    /* Quick wizard card: wider */
    .qb-quick-all-card {
        max-width: 680px;
    }

    /* Subject chips: larger */
    .qb-subject-chip {
        padding: 10px 20px;
        font-size: 0.85rem;
    }

    /* Count cards: 4-column */
    .qb-count-cards {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Summary card: wider */
    .qb-summary-card {
        max-width: 560px;
    }
}

@media (min-width: 1200px) {
    .qb-wizard {
        max-width: 1060px;
    }

    .qb-step-content {
        max-width: 800px;
    }

    .qb-quick-all-card {
        max-width: 760px;
    }

    /* Type cards: even more spacious */
    .qb-type-card {
        padding: 32px;
    }

    .qb-type-icon {
        width: 56px;
        height: 56px;
        font-size: 1.6rem;
    }

    /* Option cards: comfortable sizing */
    .qb-option-card {
        padding: 18px 24px;
    }

    /* Exam prep: 3 columns */
    .qb-exam-prep-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ----------------------------------------
   SUBSCRIPTION CARDS (Credit Card Style)
   ---------------------------------------- */
.qb-subscriptions-scroll {
    display: flex;
    gap: var(--space-md);
    overflow-x: auto;
    padding: var(--space-sm) var(--space-xs) var(--space-md);
    margin: 0 calc(-1 * var(--space-xs));
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(45, 184, 76, 0.15) transparent;
    max-height: 340px;
    transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.35s ease,
        padding 0.35s ease,
        margin 0.35s ease;
}

.qb-subscriptions-scroll::-webkit-scrollbar {
    height: 4px;
}

.qb-subscriptions-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.qb-subscriptions-scroll::-webkit-scrollbar-thumb {
    background: rgba(45, 184, 76, 0.15);
    border-radius: 4px;
}

.qb-subscriptions-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(45, 184, 76, 0.2);
}

.qb-subscriptions-scroll.collapsed {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.qb-sub-card {
    flex: 0 0 clamp(200px, 24vw, 260px);
    aspect-ratio: 1.7;
    border-radius: var(--radius-md);
    padding: clamp(12px, 2vw, 18px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    scroll-snap-align: start;
    cursor: default;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.qb-sub-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

/* Card Backgrounds — subject-themed metallic gradients */
.qb-sub-card.sub-math {
    background: linear-gradient(135deg, #1a3a5c 0%, #2d6a9f 50%, #1a3a5c 100%);
    color: #e8f4ff;
}

.qb-sub-card.sub-physics {
    background: linear-gradient(135deg, #2d1b4e 0%, #6b3fa0 50%, #2d1b4e 100%);
    color: #f0e6ff;
}

.qb-sub-card.sub-chemistry {
    background: linear-gradient(135deg, #1a3d2e 0%, #2d8f5e 50%, #1a3d2e 100%);
    color: #e6fff0;
}

.qb-sub-card.sub-biology {
    background: linear-gradient(135deg, #3d2e1a 0%, #8f6b2d 50%, #3d2e1a 100%);
    color: #fff5e6;
}

.qb-sub-card.sub-arabic {
    background: linear-gradient(135deg, #3d1a1a 0%, #a04040 50%, #3d1a1a 100%);
    color: #ffe6e6;
}

.qb-sub-card.sub-english {
    background: linear-gradient(135deg, #1a2d3d 0%, #3a7ca5 50%, #1a2d3d 100%);
    color: #e6f2ff;
}

.qb-sub-card.sub-default {
    background: linear-gradient(135deg, #1e293b 0%, #475569 50%, #1e293b 100%);
    color: #e2e8f0;
}

/* Grade-level card — premium green-to-dark gradient */
.qb-sub-card.sub-grade {
    background: linear-gradient(135deg, #0f2e1c 0%, #1a5c36 40%, #2DB84C 100%);
    color: #e6fff0;
}

/* Teacher avatar on course cards */
.qb-sub-teacher-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.qb-sub-teacher-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.qb-sub-teacher-avatar i {
    font-size: 1.2rem;
    opacity: 0.6;
}

/* Holographic shimmer overlay */
.qb-sub-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg,
            transparent 40%,
            rgba(255, 255, 255, 0.06) 45%,
            rgba(255, 255, 255, 0.12) 50%,
            rgba(255, 255, 255, 0.06) 55%,
            transparent 60%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
    pointer-events: none;
}

.qb-sub-card:hover::before {
    transform: translateX(100%);
}

/* Card chip icon */
.qb-sub-chip {
    width: 28px;
    height: 20px;
    border-radius: 3px;
    background: linear-gradient(135deg, #d4a853 0%, #f0d78c 40%, #d4a853 80%);
    opacity: 0.85;
}

.qb-sub-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.qb-sub-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 3px 10px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
}

.qb-sub-badge.active {
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.qb-sub-badge.course {
    color: #93c5fd;
    border: 1px solid rgba(147, 197, 253, 0.3);
}

.qb-sub-subject {
    font-size: clamp(0.85rem, 2vw, 1rem);
    font-weight: 700;
    letter-spacing: 0.3px;
}

.qb-sub-grade {
    font-size: 0.65rem;
    opacity: 0.7;
    margin-top: 2px;
}

.qb-sub-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.qb-sub-expiry {
    font-size: 0.7rem;
    opacity: 0.6;
    font-family: var(--font-family-ui);
    letter-spacing: 1px;
}

.qb-sub-questions {
    font-size: 0.7rem;
    opacity: 0.6;
}

/* Add New Subscription Card */
.qb-sub-card.add-new {
    background: var(--color-glass);
    border: 2px dashed var(--color-border);
    color: var(--color-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: var(--space-sm);
}

.qb-sub-card.add-new::before {
    display: none;
}

.qb-sub-card.add-new:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(76, 175, 122, 0.05);
}

.qb-sub-card.add-new i {
    font-size: 2rem;
    opacity: 0.6;
}

.qb-sub-card.add-new span {
    font-size: 0.85rem;
    font-weight: 500;
}

/* ----------------------------------------
   TEST CARDS — Clean Square Design
   ---------------------------------------- */
.qb-tests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(clamp(240px, 28vw, 300px), 1fr));
    gap: var(--space-md);
}

.qb-test-card {
    position: relative;
    background: var(--color-surface);
    border: 1px solid var(--color-glass-border);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    cursor: pointer;
    transition: all 0.25s ease;
}

.qb-test-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary);
}

/* Card header */
.qb-test-card-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
}

/* Subject icon */
.qb-test-card-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.qb-test-card-title-group {
    flex: 1;
    min-width: 0;
}

.qb-test-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.3;
    margin-bottom: 2px;
}

.qb-test-card-subjects {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.qb-test-subject-tag {
    font-size: 0.65rem;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    background: var(--color-glass);
    color: var(--color-text-muted);
    border: 1px solid var(--color-glass-border);
}

.qb-test-card-fav {
    background: none;
    border: none;
    color: var(--color-text-dim);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.qb-test-card-fav.is-fav {
    color: var(--color-error);
}

.qb-test-card-fav:hover {
    color: var(--color-error);
}

/* Card meta row — question count, mode, difficulty */
.qb-test-card-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.75rem;
    color: var(--color-text-muted);
    padding-top: var(--space-xs);
    border-top: 1px solid var(--color-glass-border);
}

.qb-test-card-meta span {
    display: flex;
    align-items: center;
    gap: 3px;
}

.qb-test-card-meta i {
    font-size: 0.9em;
}

/* Difficulty dots */
.qb-difficulty {
    display: flex;
    gap: 3px;
    align-items: center;
}

.qb-difficulty-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-glass-border);
}

.qb-difficulty-dot.filled {
    background: var(--diff-color, var(--color-primary));
}

.qb-difficulty[data-level="easy"] .qb-difficulty-dot.filled {
    --diff-color: var(--color-success);
}

.qb-difficulty[data-level="medium"] .qb-difficulty-dot.filled {
    --diff-color: var(--color-warning);
}

.qb-difficulty[data-level="hard"] .qb-difficulty-dot.filled {
    --diff-color: var(--color-error);
}

/* Mode badge */
.qb-mode-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.qb-mode-badge.study {
    background: rgba(74, 144, 217, 0.12);
    color: var(--color-accent-blue);
}

.qb-mode-badge.test {
    background: rgba(245, 166, 35, 0.12);
    color: var(--color-accent-gold);
}

/* Card footer — score + action in one row */
.qb-test-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: var(--space-xs);
}

.qb-test-card-date {
    font-size: 0.7rem;
    color: var(--color-text-dim);
    display: flex;
    align-items: center;
    gap: 4px;
}

.qb-test-card-score {
    font-size: 0.8rem;
    font-weight: 700;
    font-family: var(--font-family-secondary);
    color: var(--color-primary);
}

.qb-test-card-actions {
    display: flex;
    gap: var(--space-xs);
}

.qb-test-action-btn {
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid var(--color-glass-border);
    background: var(--color-glass);
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 4px;
}

.qb-test-action-btn:hover {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.qb-test-action-btn.repeat {
    border-color: transparent;
    background: rgba(45, 184, 76, 0.1);
    color: var(--color-primary);
}


/* ----------------------------------------
   GRADE SELECTION MODAL
   ---------------------------------------- */
.qb-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: var(--space-md);
}

.qb-modal-overlay.active {
    display: flex;
}

.qb-modal {
    width: 100%;
    max-width: 560px;
    padding: clamp(24px, 4vw, 40px);
    border-radius: var(--radius-xl);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
    animation: qbModalIn 0.35s ease;
}

/* Prevent glass-card hover from making modal transparent */
.qb-modal.glass-card:hover {
    background: var(--color-surface);
    border-color: var(--color-border);
    transform: none;
}

@keyframes qbModalIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.qb-modal-header {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.qb-modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(76, 175, 122, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
    font-size: 1.8rem;
    color: var(--color-primary);
}

.qb-modal-header h2 {
    font-size: clamp(1.1rem, 3vw, 1.4rem);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--space-xs);
}

.qb-modal-header p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.qb-grade-level-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.qb-level-cards,
.qb-year-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: var(--space-sm);
}

.qb-level-card,
.qb-year-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: clamp(12px, 2vw, 16px);
    border-radius: var(--radius-md);
    background: var(--color-glass);
    border: 2px solid var(--color-border);
    color: var(--color-text);
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.qb-level-card i,
.qb-year-card i {
    font-size: 1.6rem;
    opacity: 0.7;
}

.qb-level-card:hover,
.qb-year-card:hover {
    border-color: var(--color-primary);
    background: rgba(76, 175, 122, 0.06);
}

.qb-level-card.selected,
.qb-year-card.selected {
    border-color: var(--color-primary);
    background: rgba(76, 175, 122, 0.12);
    color: var(--color-primary);
}

.qb-level-card.selected i,
.qb-year-card.selected i {
    opacity: 1;
}

.qb-grade-year-group {
    margin-top: var(--space-md);
    animation: qbSlideIn 0.3s ease;
}

@keyframes qbSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.qb-modal-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
    margin-top: var(--space-lg);
}

.qb-modal-btn {
    padding: 10px 24px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    border: none;
}

.qb-modal-btn.primary {
    background: var(--color-primary);
    color: #fff;
}

.qb-modal-btn.primary:hover:not(:disabled) {
    background: var(--color-primary-hover, #3d9d6a);
    transform: translateY(-1px);
}

.qb-modal-btn.primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.qb-modal-btn.secondary {
    background: var(--color-glass);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.qb-modal-btn.secondary:hover {
    background: var(--color-border);
}

/* ---- Modal Close Button ---- */
.qb-modal-close {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

[dir="rtl"] .qb-modal-close {
    right: auto;
    left: var(--space-sm);
}

.qb-modal-close:hover {
    background: var(--color-border);
    color: var(--color-text);
}

/* ---- Subscription Package Cards ---- */
.qb-modal-wide {
    max-width: 720px;
    width: 90vw;
}

.qb-add-sub-desc {
    color: var(--color-text-muted);
    font-size: 0.88rem;
    margin-bottom: var(--space-md);
    text-align: center;
}

.qb-pkg-grade {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(45, 184, 76, 0.08);
    border: 1px solid rgba(45, 184, 76, 0.15);
    border-radius: var(--radius-full);
    color: var(--color-primary);
    font-size: 0.82rem;
    font-weight: 600;
    margin: 0 auto var(--space-lg);
    display: flex;
    width: fit-content;
}

.qb-pkg-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.qb-pkg-card {
    position: relative;
    padding: var(--space-lg) var(--space-md);
    border-radius: var(--radius-lg);
    border: 2px solid var(--color-border);
    background: var(--color-surface);
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-height: 280px;
}

.qb-pkg-card:hover {
    border-color: rgba(45, 184, 76, 0.35);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.qb-pkg-card.selected {
    border-color: var(--color-primary);
    background: rgba(45, 184, 76, 0.04);
    box-shadow: 0 0 0 2px rgba(45, 184, 76, 0.15), 0 8px 24px rgba(45, 184, 76, 0.1);
}

.qb-pkg-card.popular {
    border-color: var(--color-primary);
    background: rgba(45, 184, 76, 0.03);
    padding-top: calc(var(--space-lg) + 8px);
}

.qb-pkg-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 16px;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    box-shadow: 0 2px 8px rgba(45, 184, 76, 0.3);
}

.qb-pkg-duration {
    display: flex;
    align-items: baseline;
    gap: 5px;
    color: var(--color-text);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: var(--space-xs);
}

.qb-pkg-months {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--color-primary);
    line-height: 1;
}

.qb-pkg-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-top: var(--space-xs);
}

.qb-pkg-amount {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-text);
    line-height: 1;
}

.qb-pkg-currency {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    font-weight: 600;
}

.qb-pkg-per {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-xs);
}

.qb-pkg-save {
    display: inline-block;
    padding: 3px 12px;
    background: rgba(45, 184, 76, 0.1);
    color: var(--color-primary);
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    margin-bottom: var(--space-xs);
}

.qb-pkg-features {
    list-style: none;
    padding: 0;
    margin: auto 0 0;
    width: 100%;
    text-align: start;
    border-top: 1px solid var(--color-border);
    padding-top: var(--space-sm);
}

.qb-pkg-features li {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    padding: 4px 0;
}

.qb-pkg-features li i {
    color: var(--color-primary);
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .qb-modal-wide {
        max-width: 95vw;
    }

    .qb-pkg-grid {
        gap: var(--space-md);
    }

    .qb-pkg-card {
        padding: var(--space-md) var(--space-sm);
        min-height: 240px;
    }

    .qb-pkg-months {
        font-size: 1.8rem;
    }

    .qb-pkg-amount {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .qb-pkg-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .qb-pkg-card {
        min-height: auto;
        padding: var(--space-md);
    }
}

/* ---- Fav Questions Modal ---- */
.qb-fav-modal {
    max-width: 520px;
}

.qb-fav-list {
    max-height: 360px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: var(--space-sm) 0;
    scrollbar-width: thin;
}

.qb-fav-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px 14px;
    background: var(--color-glass);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    transition: background 0.2s ease;
}

.qb-fav-item:hover {
    background: var(--color-glass-hover);
}

.qb-fav-item-num {
    flex: 0 0 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-text-muted);
}

.qb-fav-item-text {
    flex: 1;
    font-size: 0.85rem;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qb-fav-item-remove {
    flex: 0 0 auto;
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.qb-fav-item-remove:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.qb-fav-empty {
    text-align: center;
    padding: var(--space-xl) var(--space-md);
    color: var(--color-text-muted);
}

.qb-fav-empty i {
    font-size: 2.5rem;
    margin-bottom: var(--space-sm);
    opacity: 0.4;
}

.qb-fav-empty p {
    font-weight: 600;
    margin-bottom: 4px;
}

.qb-fav-empty span {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* ---- Add Subscription Modal ---- */
.qb-add-sub-desc {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin: 0 0 var(--space-md);
}

.qb-add-sub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--space-sm);
    padding: var(--space-xs) 0 var(--space-md);
}

.qb-add-sub-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 10px;
    background: var(--color-glass);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    color: var(--color-text);
    font-size: 0.8rem;
    font-weight: 500;
}

.qb-add-sub-card i {
    font-size: 1.4rem;
}

.qb-add-sub-card:hover {
    border-color: var(--color-primary);
    background: rgba(45, 184, 76, 0.05);
}

.qb-add-sub-card.selected {
    border-color: var(--color-primary);
    background: rgba(45, 184, 76, 0.1);
    box-shadow: 0 0 0 2px rgba(45, 184, 76, 0.2);
}

/* ---- Avatar Initials Fallback ---- */
.qb-sub-avatar-fallback {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

/* ----------------------------------------
   EMPTY STATE
   ---------------------------------------- */
.qb-empty-state {
    text-align: center;
    padding: var(--space-2xl) var(--space-md);
    color: var(--color-text-muted);
    grid-column: 1 / -1;
}

.qb-empty-state-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    background: var(--color-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
}

.qb-empty-state-icon i {
    font-size: 1.8rem;
    color: var(--color-text-dim);
}

.qb-empty-state h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--space-xs);
}

.qb-empty-state p {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    max-width: 280px;
    margin: 0 auto;
    line-height: 1.5;
}

.qb-empty-state-action {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    margin-top: var(--space-md);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    background: var(--color-primary);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.qb-empty-state-action:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
}

/* ----------------------------------------
   CTA — Start New Test
   ---------------------------------------- */
.qb-start-fab {
    position: fixed;
    bottom: var(--space-lg);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 16px 36px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    color: #fff;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1.05rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 8px 32px var(--color-primary-glow);
    transition: all 0.3s ease;
    animation: qbFabPulse 2.5s ease-in-out infinite;
}

@keyframes qbFabPulse {

    0%,
    100% {
        box-shadow: 0 8px 32px var(--color-primary-glow);
    }

    50% {
        box-shadow: 0 12px 48px var(--color-primary-glow), 0 0 0 6px rgba(45, 184, 76, 0.08);
    }
}

/* RTL/LTR positioning */
[dir="rtl"] .qb-start-fab {
    left: var(--space-lg);
}

[dir="ltr"] .qb-start-fab {
    right: var(--space-lg);
}

.qb-start-fab:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 16px 48px var(--color-primary-glow);
    animation: none;
}

.qb-start-fab i {
    font-size: 1.3em;
}

/* ----------------------------------------
   RESPONSIVE
   ---------------------------------------- */
@media (max-width: 768px) {
    .qb-dashboard {
        padding: var(--space-sm);
    }

    .qb-sub-card {
        flex: 0 0 clamp(220px, 70vw, 280px);
    }

    .qb-tests-grid {
        grid-template-columns: 1fr;
    }

    .qb-test-card-subjects {
        display: none;
    }

    /* Mobile CTA — full width sticky bar at bottom */
    .qb-start-fab {
        left: var(--space-md) !important;
        right: var(--space-md) !important;
        bottom: var(--space-md);
        padding: 16px;
        border-radius: var(--radius-sm);
        font-size: 1rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .qb-tests-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ----------------------------------------
   LIGHT MODE OVERRIDES
   ---------------------------------------- */
[data-theme="light"] .qb-sub-card.add-new {
    background: rgba(255, 255, 255, 0.6);
}

[data-theme="light"] .qb-test-card {
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .qb-test-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .qb-modal {
    background: #ffffff;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .qb-start-fab {
    box-shadow: 0 8px 32px rgba(45, 184, 76, 0.3);
}

[data-theme="light"] .qb-empty-state-icon {
    background: rgba(0, 0, 0, 0.04);
}

/* ========================================
   CREATION WIZARD STYLES
   ======================================== */

/* Wizard container */
.qb-wizard {
    padding: var(--space-md);
    max-width: 800px;
    margin: 0 auto;
    min-height: 60vh;
}

/* Step visibility */
.qb-wizard-step {
    display: none;
}

.qb-wizard-step.active {
    display: block;
    animation: qbStepIn 0.35s ease;
}

@keyframes qbStepIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Step header (back + progress) */
.qb-step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.qb-back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    background: var(--color-glass);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.qb-back-btn:hover {
    background: var(--color-border);
}

[dir="rtl"] .qb-back-btn i {
    transform: scaleX(-1);
}

/* Progress dots */
.qb-progress-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.qb-progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-border);
    transition: all 0.3s ease;
}

.qb-progress-dot.active {
    width: 24px;
    border-radius: var(--radius-md);
    background: var(--color-primary);
}

.qb-progress-dot.done {
    background: var(--color-primary);
    opacity: 0.5;
}

/* Step content */
.qb-step-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.qb-step-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.qb-step-title i {
    font-size: 1.5rem;
    color: var(--color-primary);
}

.qb-step-title h2 {
    font-size: clamp(1.1rem, 3vw, 1.4rem);
    font-weight: 700;
    color: var(--color-text);
}

/* ----------------------------------------
   TYPE SELECTION CARDS (Landing)
   ---------------------------------------- */
.qb-type-cards {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-top: var(--space-xl);
}

.qb-type-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: clamp(16px, 3vw, 24px);
    border-radius: var(--radius-lg);
    background: var(--color-glass);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: start;
}

.qb-type-card:hover {
    transform: translateX(4px);
    border-color: var(--color-primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

[dir="rtl"] .qb-type-card:hover {
    transform: translateX(-4px);
}

.qb-type-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.qb-type-icon.exam-prep {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
}

.qb-type-icon.quick {
    background: rgba(76, 175, 122, 0.12);
    color: var(--color-primary);
}

.qb-type-icon.advanced {
    background: rgba(167, 139, 250, 0.12);
    color: #a78bfa;
}

.qb-type-info {
    flex: 1;
}

.qb-type-info h3 {
    font-size: clamp(0.95rem, 2.5vw, 1.15rem);
    font-weight: 600;
    margin-bottom: 4px;
}

.qb-type-info p {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.qb-type-arrow {
    font-size: 1.2rem;
    color: var(--color-text-muted);
    transition: color 0.2s;
}

[dir="rtl"] .qb-type-arrow {
    transform: scaleX(-1);
}

.qb-type-card:hover .qb-type-arrow {
    color: var(--color-primary);
}

/* ----------------------------------------
   OPTION CARDS (Mode, Pool, Difficulty)
   ---------------------------------------- */
.qb-mode-cards,
.qb-pool-cards,
.qb-diff-cards {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.qb-option-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: clamp(14px, 2.5vw, 20px);
    border-radius: var(--radius-lg);
    background: var(--color-glass);
    border: 2px solid var(--color-border);
    color: var(--color-text);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: start;
}

.qb-option-card:hover {
    border-color: var(--color-primary);
    background: rgba(76, 175, 122, 0.04);
}

.qb-option-card.selected {
    border-color: var(--color-primary);
    background: rgba(76, 175, 122, 0.08);
}

.qb-option-card>i:first-child {
    font-size: 1.4rem;
    color: var(--color-text-muted);
    width: 32px;
    text-align: center;
    flex-shrink: 0;
}

.qb-option-card.selected>i:first-child {
    color: var(--color-primary);
}

.qb-option-info {
    flex: 1;
}

.qb-option-info strong {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
}

.qb-option-info small {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.qb-option-check {
    font-size: 1.3rem;
    color: transparent;
    transition: color 0.2s;
}

.qb-option-card.selected .qb-option-check {
    color: var(--color-primary);
}

/* Difficulty color indicators */
.qb-diff-indicator {
    font-size: 0.7rem;
    letter-spacing: 3px;
    width: 32px;
    text-align: center;
    flex-shrink: 0;
}

.qb-diff-indicator.easy {
    color: #4ade80;
}

.qb-diff-indicator.medium {
    color: #fbbf24;
}

.qb-diff-indicator.hard {
    color: #ef4444;
}

/* ----------------------------------------
   SUBJECT CHIPS
   ---------------------------------------- */
.qb-subject-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.qb-subject-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    background: var(--color-glass);
    border: 2px solid var(--color-border);
    color: var(--color-text);
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.qb-subject-chip i {
    font-size: 1.1em;
}

.qb-subject-chip:hover {
    border-color: var(--chip-color, var(--color-primary));
}

.qb-subject-chip.selected {
    background: var(--chip-color, var(--color-primary));
    border-color: var(--chip-color, var(--color-primary));
    color: #fff;
}

/* ----------------------------------------
   COUNT CARDS
   ---------------------------------------- */
.qb-count-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-md);
}

.qb-count-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: clamp(18px, 3vw, 28px);
    border-radius: var(--radius-lg);
    background: var(--color-glass);
    border: 2px solid var(--color-border);
    color: var(--color-text);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
}

.qb-count-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.qb-count-card.selected {
    border-color: var(--color-primary);
    background: rgba(76, 175, 122, 0.1);
}

.qb-count-num {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    font-weight: 700;
    font-family: var(--font-family-ui);
    color: var(--color-text);
    line-height: 1;
}

.qb-count-card.selected .qb-count-num {
    color: var(--color-primary);
}

.qb-count-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.qb-count-time {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    opacity: 0.6;
    font-family: var(--font-family-ui);
}

/* ----------------------------------------
   EXAM PREP CARDS
   ---------------------------------------- */
.qb-exam-prep-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.qb-ep-card {
    padding: clamp(16px, 2.5vw, 24px);
    border-radius: var(--radius-lg);
    background: var(--color-glass);
    border: 1px solid var(--color-border);
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.qb-ep-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.qb-ep-top h3 {
    font-size: clamp(0.95rem, 2.5vw, 1.1rem);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 6px;
}

.qb-ep-subjects {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.qb-ep-subject {
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--tag-color) 12%, transparent);
    color: var(--tag-color);
}

.qb-ep-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.qb-ep-meta span {
    display: flex;
    align-items: center;
    gap: 3px;
}

.qb-ep-start {
    align-self: flex-end;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: var(--radius-md);
    background: var(--color-primary);
    color: #fff;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.qb-ep-start:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(76, 175, 122, 0.3);
}

/* ----------------------------------------
   SUMMARY CARD
   ---------------------------------------- */
.qb-summary-card {
    max-width: 600px;
    margin: var(--space-xl) auto 0;
    padding: clamp(24px, 4vw, 36px);
    border-radius: var(--radius-xl);
    background: var(--color-glass);
    border: 1px solid var(--color-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.qb-summary-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.qb-summary-header i {
    font-size: 1.6rem;
    color: var(--color-primary);
}

.qb-summary-header h2 {
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    font-weight: 700;
    color: var(--color-text);
}

.qb-summary-rows {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.qb-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
}

.qb-summary-row:last-child {
    border-bottom: none;
}

.qb-summary-row.highlight {
    background: rgba(76, 175, 122, 0.06);
    padding: 12px;
    border-radius: var(--radius-md);
    border-bottom: none;
    margin-top: var(--space-xs);
}

.qb-summary-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.qb-summary-label i {
    font-size: 1em;
}

.qb-summary-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text);
}

.qb-summary-count {
    font-size: 1.3rem;
    font-family: var(--font-family-ui);
    color: var(--color-primary);
}

.qb-launch-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 14px;
    border-radius: var(--radius-lg);
    background: var(--color-primary);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(76, 175, 122, 0.3);
}

.qb-launch-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(76, 175, 122, 0.45);
}

.qb-launch-btn i {
    font-size: 1.3em;
}

/* Wizard footer: centered, inside flow (not fixed) — see lines ~1125 & ~4533 */

[dir="rtl"] .qb-wizard-next i {
    transform: scaleX(-1);
}

/* ----------------------------------------
   CREATION PAGE — RESPONSIVE
   ---------------------------------------- */
@media (max-width: 768px) {
    .qb-wizard {
        padding: var(--space-sm);
    }

    .qb-type-icon {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }

    .qb-count-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .qb-summary-card {
        margin-top: var(--space-md);
    }
}

/* ----------------------------------------
   CREATION PAGE — LIGHT MODE
   ---------------------------------------- */
[data-theme="light"] .qb-type-card {
    background: rgba(255, 255, 255, 0.7);
}

[data-theme="light"] .qb-option-card {
    background: rgba(255, 255, 255, 0.7);
}

[data-theme="light"] .qb-count-card {
    background: rgba(255, 255, 255, 0.7);
}

[data-theme="light"] .qb-ep-card {
    background: rgba(255, 255, 255, 0.7);
}

[data-theme="light"] .qb-summary-card {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

/* ========================================
   TEST SESSION STYLES
   ======================================== */

/* Test Top Bar */
.qb-test-topbar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.qb-test-topbar-left {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.qb-test-topbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-inline-start: auto;
}

.qb-test-mode-badge {
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.qb-test-mode-badge.study {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
}

.qb-test-mode-badge.test {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}

/* Progress Bar */
.qb-test-progress-bar {
    flex: 1;
    min-width: 100px;
    height: 4px;
    background: var(--color-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.qb-test-progress-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: var(--radius-sm);
    transition: width 0.3s ease;
}

/* Timer */
.qb-test-timer {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    font-family: var(--font-family-ui);
    color: var(--color-text-muted);
}

.qb-test-counter {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
    font-family: var(--font-family-ui);
}

/* ----------------------------------------
   QUESTION CARD
   ---------------------------------------- */
.qb-test-area {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: calc(100vh - 120px);
    overflow: hidden;
    box-sizing: border-box;
}

/* ---- Question Header (Subject + Fav) ---- */
.qb-question-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.qb-question-fav {
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    cursor: pointer;
    color: var(--color-text-muted);
    font-size: 1.1rem;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qb-question-fav:hover {
    color: var(--color-primary);
    border-color: rgba(45, 184, 76, 0.3);
    background: rgba(45, 184, 76, 0.06);
}

.qb-question-fav.is-fav {
    color: var(--color-primary);
    border-color: rgba(45, 184, 76, 0.3);
    background: rgba(45, 184, 76, 0.1);
}

/* ---- Fav Access Button (Dashboard Top Bar) ---- */
.qb-fav-access-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(45, 184, 76, 0.08);
    border: 1px solid rgba(45, 184, 76, 0.2);
    border-radius: var(--radius-sm);
    color: var(--color-primary);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.qb-fav-access-btn:hover {
    background: rgba(45, 184, 76, 0.14);
    border-color: rgba(45, 184, 76, 0.4);
}

.qb-fav-access-btn i {
    font-size: 1em;
}

.qb-fav-count {
    background: var(--color-primary);
    color: #fff;
    font-size: 0.7rem;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    font-weight: 700;
}

/* ---- New Test CTA (layout flow) ---- */
.qb-cta-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.qb-new-test-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: var(--color-primary);
    border: none;
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(45, 184, 76, 0.2);
}

.qb-new-test-btn:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(45, 184, 76, 0.3);
}

.qb-new-test-btn i {
    font-size: 1.1em;
}

/* ---- CTA Responsive ---- */
@media (max-width: 768px) {
    .qb-cta-row {
        justify-content: stretch;
    }

    .qb-new-test-btn {
        width: 100%;
        justify-content: center;
        padding: 16px 28px;
        font-size: 1rem;
        border-radius: var(--radius-lg);
    }
}

/* ----------------------------------------
   RTL ARROW AUTO-FLIP
   All directional arrows mirror automatically
   ---------------------------------------- */
[dir="rtl"] .ph-arrow-right,
[dir="rtl"] .ph-arrow-left,
[dir="rtl"] .ph-caret-right,
[dir="rtl"] .ph-caret-left,
[dir="rtl"] .ph-arrow-circle-right,
[dir="rtl"] .ph-arrow-circle-left,
[dir="rtl"] .ph-arrow-square-right,
[dir="rtl"] .ph-arrow-square-left,
[dir="rtl"] .ph-caret-circle-right,
[dir="rtl"] .ph-caret-circle-left {
    transform: scaleX(-1);
}

.qb-question-card {
    background: var(--color-glass);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: clamp(20px, 4vw, 36px);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.qb-question-subject {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.qb-question-text {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.7;
    font-family: var(--font-family-reading);
}

/* ----------------------------------------
   ANSWER BUTTONS
   ---------------------------------------- */
.qb-answers-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.qb-answer-btn {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: clamp(12px, 2.5vw, 18px);
    border-radius: var(--radius-md);
    background: var(--color-glass);
    border: 2px solid var(--color-border);
    color: var(--color-text);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: start;
    width: 100%;
}

.qb-answer-btn:hover:not(.disabled) {
    border-color: var(--color-primary);
    background: rgba(76, 175, 122, 0.04);
}

.qb-answer-btn.selected {
    border-color: var(--color-primary);
    background: rgba(76, 175, 122, 0.08);
}

.qb-answer-btn.correct {
    border-color: #4ade80;
    background: rgba(74, 222, 128, 0.08);
}

.qb-answer-btn.wrong {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
}

.qb-answer-btn.disabled {
    cursor: default;
    opacity: 0.85;
}

.qb-answer-letter {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--color-border);
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font-family-ui);
    flex-shrink: 0;
}

.qb-answer-btn.selected .qb-answer-letter {
    background: var(--color-primary);
    color: #fff;
}

.qb-answer-btn.correct .qb-answer-letter {
    background: #4ade80;
    color: #fff;
}

.qb-answer-btn.wrong .qb-answer-letter {
    background: #ef4444;
    color: #fff;
}

.qb-answer-text {
    flex: 1;
    font-family: var(--font-family-reading);
    line-height: 1.7;
}

.qb-answer-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.qb-answer-icon.correct {
    color: #4ade80;
}

.qb-answer-icon.wrong {
    color: #ef4444;
}

/* ----------------------------------------
   FEEDBACK (Study Mode)
   ---------------------------------------- */
.qb-feedback {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    background: var(--color-glass);
    border: 1px solid var(--color-border);
    animation: qbStepIn 0.3s ease;
}

.qb-feedback-icon {
    flex-shrink: 0;
}

.qb-feedback-text {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text);
}

.qb-feedback-explanation {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 4px;
    font-family: var(--font-family-reading);
    line-height: 1.7;
}

/* ----------------------------------------
   QUESTION NAVIGATOR
   ---------------------------------------- */
.qb-question-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin: var(--space-lg) 0;
}

.qb-nav-dot {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--color-glass);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    font-family: var(--font-family-ui);
    cursor: pointer;
    transition: all 0.2s;
}

.qb-nav-dot:hover {
    border-color: var(--color-primary);
}

.qb-nav-dot.current {
    border-color: var(--color-primary);
    background: rgba(76, 175, 122, 0.12);
    color: var(--color-primary);
}

.qb-nav-dot.answered {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.qb-nav-dot.correct {
    background: #4ade80;
    border-color: #4ade80;
    color: #fff;
}

.qb-nav-dot.wrong {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}

/* ----------------------------------------
   TEST NAVIGATION BUTTONS
   ---------------------------------------- */
.qb-test-nav {
    display: flex;
    justify-content: space-between;
    gap: var(--space-md);
    margin-top: var(--space-md);
}

.qb-nav-btn {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 10px 24px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--color-border);
    background: var(--color-glass);
    color: var(--color-text);
}

.qb-nav-btn:hover:not(:disabled) {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.qb-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.qb-nav-btn.next {
    margin-inline-start: auto;
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.qb-nav-btn.next:hover:not(:disabled) {
    box-shadow: 0 4px 16px rgba(76, 175, 122, 0.3);
    transform: translateY(-1px);
}

[dir="rtl"] .qb-nav-btn.prev i {
    transform: scaleX(-1);
}

[dir="rtl"] .qb-nav-btn.next i {
    transform: scaleX(-1);
}

/* ----------------------------------------
   RESULTS PANEL
   ---------------------------------------- */
/* ========================================
   RESULTS SCREEN — ENHANCED
   ======================================== */
.qb-results {
    max-width: 640px;
    margin: 0 auto;
    padding: var(--space-md);
}

.qb-results-card {
    background: var(--color-surface);
    border: 1px solid var(--color-glass-border);
    border-radius: var(--radius-xl);
    padding: clamp(24px, 5vw, 40px);
    animation: qbResultsSlideIn 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes qbResultsSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ---- MIA Celebration ---- */
.qb-results-mia {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    animation: qbMiaFadeIn 0.8s ease 0.2s both;
}

@keyframes qbMiaFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.qb-results-mia-video {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    background: var(--color-glass);
    box-shadow:
        0 0 0 3px var(--color-primary),
        0 0 24px rgba(45, 184, 76, 0.25);
    animation: qbMiaPulse 2.5s ease-in-out infinite;
}

@keyframes qbMiaPulse {

    0%,
    100% {
        box-shadow: 0 0 0 3px var(--color-primary), 0 0 24px rgba(45, 184, 76, 0.25);
    }

    50% {
        box-shadow: 0 0 0 5px var(--color-primary), 0 0 40px rgba(45, 184, 76, 0.4);
    }
}

.qb-results-mia-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.qb-results-mia-video .mia-fallback {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 16px;
    background: var(--color-glass);
}

.qb-results-mia-msg {
    text-align: center;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text);
    line-height: 1.5;
    margin: 0;
    max-width: 340px;
}

/* ---- Score Section ---- */
.qb-results-score-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: var(--space-xl);
    animation: qbScoreFadeIn 0.6s ease 0.2s both;
}

@keyframes qbScoreFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.qb-results-score-ring {
    position: relative;
    width: 140px;
    height: 140px;
    flex-shrink: 0;
}

.qb-results-score-ring svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.ring-bg {
    fill: none;
    stroke: var(--color-border);
    stroke-width: 8;
}

.ring-fill {
    fill: none;
    stroke: var(--color-primary);
    stroke-width: 8;
    stroke-linecap: round;
}

.qb-results-score-value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--font-family-ui);
    color: var(--color-primary);
}

.qb-results-score-label {
    margin-top: var(--space-sm);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ---- Stat Cards ---- */
.qb-results-stat-chips {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.qb-stat-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 24px;
    border-radius: var(--radius-lg);
    min-width: 100px;
    animation: qbChipPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.qb-stat-chip:nth-child(1) {
    animation-delay: 0.5s;
}

.qb-stat-chip:nth-child(2) {
    animation-delay: 0.65s;
}

.qb-stat-chip:nth-child(3) {
    animation-delay: 0.8s;
}

@keyframes qbChipPop {
    from {
        opacity: 0;
        transform: scale(0.6);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.qb-stat-chip i {
    font-size: 1.3rem;
}

.qb-stat-chip-value {
    font-family: var(--font-family-ui);
    font-weight: 700;
    font-size: 1.5rem;
    line-height: 1;
}

.qb-stat-chip-label {
    font-size: 0.7rem;
    font-weight: 600;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.qb-stat-chip.correct {
    background: rgba(74, 222, 128, 0.1);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.qb-stat-chip.wrong {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.qb-stat-chip.skipped {
    background: var(--color-glass);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}

/* ---- Breakdown ---- */
.qb-results-breakdown-title {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.qb-results-breakdown-title i {
    font-size: 1rem;
    color: var(--color-primary);
}

.qb-results-breakdown {
    margin-bottom: var(--space-lg);
    max-height: 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scrollbar-width: thin;
}

.qb-breakdown-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px var(--space-md);
    border-radius: var(--radius-sm);
    background: var(--color-glass);
    font-size: 0.8rem;
    animation: qbRowSlideIn 0.35s ease both;
    transition: background 0.2s ease;
}

.qb-breakdown-row:hover {
    background: var(--color-glass-hover);
}

.qb-breakdown-row:nth-child(1) {
    animation-delay: 0.7s;
}

.qb-breakdown-row:nth-child(2) {
    animation-delay: 0.8s;
}

.qb-breakdown-row:nth-child(3) {
    animation-delay: 0.9s;
}

.qb-breakdown-row:nth-child(4) {
    animation-delay: 1.0s;
}

.qb-breakdown-row:nth-child(5) {
    animation-delay: 1.1s;
}

.qb-breakdown-row:nth-child(n+6) {
    animation-delay: 1.2s;
}

@keyframes qbRowSlideIn {
    from {
        opacity: 0;
        transform: translateX(15px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

[dir="rtl"] .qb-breakdown-row {
    animation-name: qbRowSlideInRTL;
}

@keyframes qbRowSlideInRTL {
    from {
        opacity: 0;
        transform: translateX(-15px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.qb-breakdown-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--color-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.7rem;
    font-family: var(--font-family-ui);
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.qb-breakdown-subject {
    flex-shrink: 0;
    font-size: 1rem;
}

.qb-breakdown-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--color-text);
}

.qb-breakdown-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.qb-breakdown-row.correct .qb-breakdown-icon {
    color: #4ade80;
}

.qb-breakdown-row.correct .qb-breakdown-num {
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
}

.qb-breakdown-row.wrong .qb-breakdown-icon {
    color: #ef4444;
}

.qb-breakdown-row.wrong .qb-breakdown-num {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.qb-breakdown-row.skipped .qb-breakdown-icon {
    color: var(--color-text-muted);
}

/* ---- Action Buttons ---- */
.qb-results-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
    flex-wrap: wrap;
}

.qb-results-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    border: none;
}

.qb-results-btn.primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    color: #fff;
}

.qb-results-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 184, 76, 0.3);
}

.qb-results-btn.secondary {
    background: var(--color-glass);
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.qb-results-btn.secondary:hover {
    background: var(--color-glass-hover);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* ----------------------------------------
   TEST SESSION — RESPONSIVE
   ---------------------------------------- */
@media (max-width: 768px) {
    .qb-test-area {
        padding: var(--space-sm);
    }

    .qb-question-card {
        padding: var(--space-md);
    }

    .qb-results-score-ring {
        width: 110px;
        height: 110px;
    }

    .qb-results-mia {
        flex-direction: column;
        text-align: center;
    }

    .qb-results-mia-bubble::before {
        display: none;
    }

    .qb-results-stat-chips {
        gap: 6px;
    }

    .qb-stat-chip {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .qb-nav-btn span {
        display: none;
        /* icons only on mobile */
    }
}

/* ----------------------------------------
   TEST SESSION — LIGHT MODE
   ---------------------------------------- */
[data-theme="light"] .qb-question-card {
    background: rgba(255, 255, 255, 0.7);
}

[data-theme="light"] .qb-answer-btn {
    background: rgba(255, 255, 255, 0.6);
}

[data-theme="light"] .qb-results-card {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .qb-results-mia-bubble {
    background: rgba(240, 245, 240, 0.9);
}

[data-theme="light"] .qb-stat-chip.correct {
    background: rgba(34, 197, 94, 0.08);
}

[data-theme="light"] .qb-stat-chip.wrong {
    background: rgba(239, 68, 68, 0.08);
}

[data-theme="light"] .qb-breakdown-row {
    background: rgba(240, 245, 240, 0.6);
}

/* ========================================
   CREATE / WIZARD PAGE
   ======================================== */

/* ---- Wizard Container ---- */
.qb-wizard {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-md);
}

/* ---- Steps ---- */
.qb-wizard-step {
    display: none;
    animation: qbStepIn 0.35s ease;
}

.qb-wizard-step.active {
    display: block;
}

@keyframes qbStepIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- Type Selection Cards ---- */
.qb-type-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    padding: var(--space-xl) 0;
}

.qb-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-lg) var(--space-md);
    background: var(--color-glass);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-family: inherit;
    color: var(--color-text);
    transition: all 0.25s ease;
    text-align: center;
}

.qb-type-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(45, 184, 76, 0.12);
}

.qb-type-card:active {
    transform: translateY(-1px);
}

.qb-type-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: var(--space-xs);
}

.qb-type-icon.exam-prep {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.qb-type-icon.quick {
    background: rgba(45, 184, 76, 0.15);
    color: var(--color-primary);
}

.qb-type-icon.advanced {
    background: rgba(167, 139, 250, 0.15);
    color: #a78bfa;
}

.qb-type-info h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 4px;
}

.qb-type-info p {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin: 0;
    line-height: 1.4;
}

/* ---- Wizard Step Labels ---- */
.qb-quick-section-label,
.qb-step-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* ---- Option Cards (mode, pool, count) ---- */
.qb-option-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
}

.qb-option-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: var(--space-md);
    background: var(--color-glass);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: inherit;
    color: var(--color-text);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.qb-option-card i {
    font-size: 1.3rem;
    color: var(--color-text-muted);
}

.qb-option-card:hover {
    border-color: var(--color-primary);
}

.qb-option-card.selected {
    border-color: var(--color-primary);
    background: rgba(45, 184, 76, 0.08);
    color: var(--color-primary);
}

.qb-option-card.selected i {
    color: var(--color-primary);
}

/* ---- Subject Chips (multi-select) ---- */
.qb-subject-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
}

.qb-subject-chip {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px 14px;
    background: var(--color-glass);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: inherit;
    color: var(--color-text);
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.qb-subject-chip i {
    font-size: 1.1rem;
}

.qb-subject-chip:hover {
    border-color: var(--color-primary);
}

.qb-subject-chip.selected {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: #fff;
}

/* ---- Count Cards ---- */
.qb-count-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
}

.qb-count-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    background: var(--color-glass);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: inherit;
    color: var(--color-text);
    font-size: 1rem;
    font-weight: 700;
    transition: all 0.2s ease;
}

.qb-count-card:hover {
    border-color: var(--color-primary);
}

.qb-count-card.selected {
    border-color: var(--color-primary);
    background: rgba(45, 184, 76, 0.08);
    color: var(--color-primary);
}

/* ---- Summary Card ---- */
.qb-summary-card {
    background: var(--color-glass);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
}

.qb-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.85rem;
}

.qb-summary-row:last-child {
    border-bottom: none;
}

.qb-summary-label {
    color: var(--color-text-muted);
    font-weight: 500;
}

.qb-summary-value {
    color: var(--color-text);
    font-weight: 600;
}

/* ---- Exam Prep Cards ---- */
.qb-exam-prep-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.qb-exam-prep-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--color-glass);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: inherit;
    color: var(--color-text);
    transition: all 0.2s ease;
    text-align: start;
    width: 100%;
}

.qb-exam-prep-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.qb-exam-prep-info {
    flex: 1;
}

.qb-exam-prep-info h4 {
    margin: 0 0 4px;
    font-size: 0.9rem;
    font-weight: 600;
}

.qb-exam-prep-meta {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    display: flex;
    gap: var(--space-sm);
}

.qb-exam-prep-arrow {
    color: var(--color-text-muted);
    font-size: 1.1rem;
}

/* ---- Wizard Progress Dots ---- */
.qb-wizard-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: var(--space-md) 0;
}

.qb-wizard-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-border);
    transition: all 0.3s ease;
}

.qb-wizard-dot.active {
    background: var(--color-primary);
    width: 24px;
    border-radius: 4px;
}

.qb-wizard-dot.done {
    background: var(--color-primary);
}

/* ---- Wizard Footer ---- */
.qb-wizard-footer {
    display: flex;
    justify-content: center;
    padding: var(--space-lg) 0;
}

.qb-wizard-footer .qb-wizard-next {
    padding: 12px 32px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--color-primary);
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.qb-wizard-footer .qb-wizard-next:hover {
    background: var(--color-primary-hover);
    transform: translateY(-2px);
}

.qb-wizard-footer .qb-wizard-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ---- Quick Test "All" Card ---- */
.qb-quick-all-container {
    max-width: 500px;
    margin: 0 auto;
}

.qb-quick-start-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--color-primary);
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    transition: all 0.2s ease;
    margin-top: var(--space-md);
}

.qb-quick-start-btn:hover {
    background: var(--color-primary-hover);
    transform: translateY(-2px);
}

/* ---- Responsive: Mobile type cards stack ---- */
@media (max-width: 600px) {
    .qb-type-cards {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }

    .qb-type-card {
        flex-direction: row;
        text-align: start;
        padding: var(--space-md);
    }

    .qb-type-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 0;
    }

    .qb-count-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .qb-subject-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .qb-option-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ========================================
   FAVORITES PAGE
   ======================================== */

/* ---- Topbar ---- */
.qb-fav-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    gap: var(--space-md);
}

.qb-fav-topbar-left {
    flex: 0 0 auto;
}

.qb-fav-topbar-center {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex: 1;
    justify-content: center;
}

.qb-fav-topbar-center h1 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: var(--color-text);
}

.qb-fav-total-count {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    min-width: 24px;
    text-align: center;
}

/* ---- Filter Bar ---- */
.qb-fav-filters {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-sm);
}

.qb-fav-filter-group {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.qb-fav-filter-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-text-muted);
    white-space: nowrap;
    min-width: 70px;
}

.qb-fav-filter-chips {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 2px 0;
}

.qb-fav-filter-chips::-webkit-scrollbar {
    display: none;
}

.qb-fav-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.qb-fav-chip:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.qb-fav-chip.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.qb-fav-chip i {
    font-size: 0.85rem;
}

.qb-fav-chip.active i {
    color: #fff !important;
}

.qb-fav-chip-count {
    font-size: 0.65rem;
    opacity: 0.7;
}

.qb-fav-chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.qb-fav-chip.active .qb-fav-chip-dot {
    background: #fff !important;
}

.qb-fav-filter-actions {
    display: flex;
    justify-content: flex-end;
}

.qb-fav-clear-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: none;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    font-size: 0.72rem;
    font-weight: 500;
    font-family: inherit;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.qb-fav-clear-btn:hover {
    background: rgba(239, 68, 68, 0.18);
}

/* ---- Question Cards Grid ---- */
.qb-fav-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-sm);
    padding: 0 var(--space-md) var(--space-xl);
}

.qb-fav-q-card {
    background: var(--color-glass);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    transition: border-color 0.2s ease;
}

.qb-fav-q-card:hover {
    border-color: rgba(239, 68, 68, 0.25);
}

.qb-fav-q-top {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.qb-fav-q-subject {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.qb-fav-q-diff {
    font-size: 0.7rem;
    font-weight: 600;
    margin-inline-start: auto;
}

.qb-fav-q-remove {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: all 0.2s ease;
    opacity: 0;
}

.qb-fav-q-card:hover .qb-fav-q-remove {
    opacity: 1;
}

.qb-fav-q-remove:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.qb-fav-q-text {
    font-size: 0.9rem;
    color: var(--color-text);
    line-height: 1.6;
    margin: 0 0 var(--space-sm);
}

/* ---- Options Grid ---- */
.qb-fav-q-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.qb-fav-q-opt {
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    background: var(--color-border);
    font-size: 0.75rem;
    color: var(--color-text-muted);
    transition: all 0.2s ease;
}

.qb-fav-q-opt.correct {
    background: rgba(45, 184, 76, 0.15);
    color: var(--color-primary);
    font-weight: 600;
}

/* ---- Empty & No Results States ---- */
.qb-fav-empty-state,
.qb-fav-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-2xl) var(--space-md);
    color: var(--color-text-muted);
    min-height: 40vh;
}

.qb-fav-empty-state i,
.qb-fav-no-results i {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: var(--space-md);
}

.qb-fav-empty-state h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 var(--space-xs);
    color: var(--color-text);
}

.qb-fav-empty-state p,
.qb-fav-no-results p {
    font-size: 0.82rem;
    opacity: 0.7;
    margin: 0;
}

/* ---- Responsive ---- */
@media (min-width: 768px) {
    .qb-fav-content {
        grid-template-columns: repeat(2, 1fr);
    }

    .qb-fav-filters {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }
}

@media (min-width: 1200px) {
    .qb-fav-content {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ========================================
   EXIT CONFIRMATION MODAL (Test Page)
   Cloned from schedule.css completion-modal
   because test page doesn't load schedule.css
   ======================================== */

.completion-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.completion-modal.active {
    opacity: 1;
    visibility: visible;
}

.completion-modal-card {
    width: 100%;
    max-width: 420px;
    margin: var(--space-md);
    background: var(--color-surface);
    border: 1px solid var(--color-glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl) var(--space-xl);
    text-align: center;
    position: relative;
    animation: wizardEnter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

[data-theme="light"] .completion-modal-card {
    background: #FAFCFB;
}

.completion-close {
    position: absolute;
    top: var(--space-md);
    left: var(--space-md);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--color-glass);
    border: 1px solid var(--color-glass-border);
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
    font-size: 1rem;
}

[dir="ltr"] .completion-close {
    left: auto;
    right: var(--space-md);
}

.completion-close:hover {
    background: var(--color-error);
    border-color: var(--color-error);
    color: white;
}

.completion-mia {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-full);
    margin: 0 auto var(--space-lg);
    overflow: hidden;
    box-shadow: 0 12px 50px var(--color-primary-glow);
}

.completion-mia video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.completion-modal-card h2 {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
}

.completion-modal-card p {
    color: var(--color-text-muted);
    font-size: 1rem;
    margin-bottom: var(--space-xl);
}

.completion-modal-card .btn {
    width: 100%;
}

@keyframes wizardEnter {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(30px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}