/* ==========================================================================
   Telegram Quiz Mini App - Custom CSS Design System
   Theme: Glassmorphism Dark Mode with Vibrant Accents
   ========================================================================== */

:root {
    --bg-dark: #061126;
    --bg-surface: rgba(14, 34, 68, 0.75);
    --bg-glass: rgba(11, 27, 56, 0.72);
    --border-glass: rgba(59, 130, 246, 0.28);
    --border-hover: rgba(96, 165, 250, 0.85);
    
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-glow: rgba(37, 99, 235, 0.6);
    
    --accent: #06b6d4;
    --accent-glow: rgba(6, 182, 212, 0.5);
    
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.22);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.22);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.22);
    
    --text-primary: #ffffff;
    --text-secondary: #93c5fd;
    --text-muted: #60a5fa;
    
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* QR Payment Tab Pills */
.qr-tab-pill {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}
.qr-tab-pill:hover, .qr-tab-pill.active {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-color: #60a5fa;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.5);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 12% 15%, rgba(37, 99, 235, 0.55) 0%, transparent 48%),
        radial-gradient(circle at 88% 20%, rgba(6, 182, 212, 0.5) 0%, transparent 48%),
        radial-gradient(circle at 50% 65%, rgba(29, 78, 216, 0.45) 0%, transparent 52%),
        radial-gradient(circle at 82% 88%, rgba(14, 165, 233, 0.55) 0%, transparent 48%);
    background-attachment: fixed;
}

/* Viewport Layout */
.app-viewport {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: 80px; /* nav clearance */
}

/* Glassmorphic Components */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 36px 0 rgba(0, 10, 30, 0.5), inset 0 1px 1px 0 rgba(147, 197, 253, 0.2);
}

/* Top App Header */
.app-header {
    position: sticky;
    top: 12px;
    z-index: 50;
    margin: 12px 16px 0 16px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 18px;
    color: #fff;
    box-shadow: 0 0 14px var(--primary-glow);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.user-status {
    font-size: 12px;
    color: var(--text-secondary);
}

.xp-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(245, 158, 11, 0.18);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fbbf24;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 13px;
}

.xp-icon {
    width: 16px;
    height: 16px;
    fill: #fbbf24;
}

/* Main Content Area */
.content-area {
    flex: 1;
    padding: 16px;
}

/* Step Wizard Navigation */
.wizard-header {
    margin-bottom: 20px;
}

.wizard-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #ffffff 0%, #93c5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.wizard-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Step Progress Indicator Bar */
.step-bar-container {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 16px 0 24px 0;
}

.step-pill {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.step-pill.completed {
    background: var(--success);
}

.step-pill.active {
    background: #3b82f6;
    box-shadow: 0 0 12px var(--primary-glow);
}

/* Wizard Grid Cards */
.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.option-card {
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 1px solid var(--border-glass);
}

.option-card:hover, .option-card:active {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.32), rgba(6, 182, 212, 0.22));
    box-shadow: 0 8px 28px rgba(37, 99, 235, 0.35);
}

.option-card.selected {
    border-color: #60a5fa;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.4), rgba(6, 182, 212, 0.3));
    box-shadow: 0 0 22px var(--primary-glow);
}

.card-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.card-icon-box {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.35), rgba(6, 182, 212, 0.3));
    border: 1px solid rgba(147, 197, 253, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #93c5fd;
    font-size: 20px;
    flex-shrink: 0;
}

.card-icon-box svg, .card-icon-box i {
    width: 22px;
    height: 22px;
    stroke-width: 2.2;
}

.card-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
}

.card-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.arrow-icon {
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.option-card:hover .arrow-icon {
    color: #bfdbfe;
    transform: translateX(4px);
}

/* Language Filter Pills Bar */
.lang-filter-bar {
    display: flex;
    gap: 8px;
    margin: 14px 0 18px 0;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.lang-filter-bar::-webkit-scrollbar {
    display: none;
}

.lang-pill {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-fast);
}

.lang-pill:hover, .lang-pill.active {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.lang-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

.lang-badge.lang-uz {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.lang-badge.lang-ru {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
}

.lang-badge.lang-en {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

/* Breadcrumb Navigation Pill */
.breadcrumb-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    font-size: 12px;
}

.crumb-tag {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.crumb-tag.clickable {
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.crumb-tag.clickable:hover {
    background: rgba(99, 102, 241, 0.35);
    color: #ffffff;
}

.crumb-tag.active {
    background: rgba(52, 211, 153, 0.2);
    color: #34d399;
}

.crumb-separator {
    color: var(--text-muted);
}

/* Search Bar Styles */
.search-container {
    width: 100%;
}

.search-input-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-box .search-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition-fast);
}

.search-input:focus {
    background: rgba(255, 255, 255, 0.09);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.clear-search-btn {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
}

.clear-search-btn:hover {
    color: #fff;
}

/* Button Styles */
.btn-primary {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 20px var(--primary-glow);
    transition: var(--transition-fast);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition-fast);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* Exam View Styling */
.exam-sticky-bar {
    position: sticky;
    top: 8px;
    z-index: 40;
    margin-top: 8px;
    margin-bottom: 16px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Toast Notification Banner */
.app-toast-banner {
    position: fixed;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.app-toast-banner.show {
    top: 16px;
}

.toast-content {
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(250, 204, 21, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(250, 204, 21, 0.2);
    padding: 10px 20px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.btn-ai-explain {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(126, 34, 206, 0.4));
    border: 1px solid rgba(168, 85, 247, 0.5);
    color: #e9d5ff;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.2);
}
.btn-ai-explain:hover {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.45), rgba(126, 34, 206, 0.6));
    border-color: #c084fc;
    transform: translateY(-1px);
    color: #fff;
}

.timer-box {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 18px;
    color: var(--text-primary);
}

.timer-box.warning {
    color: var(--danger);
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.05); opacity: 0.8; }
}

.flag-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
}

.flag-btn.flagged {
    background: var(--warning-bg);
    border-color: var(--warning);
    color: var(--warning);
}

/* Question Matrix Grid (1..35) */
.matrix-container {
    display: none !important;
    margin-bottom: 16px;
    padding: 12px;
}

.matrix-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 12px;
    color: var(--text-secondary);
}

.matrix-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.matrix-item {
    height: 34px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.matrix-item.active {
    border-color: var(--primary);
    color: #fff;
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary-glow);
}

.matrix-item.answered {
    background: var(--success-bg);
    border-color: var(--success);
    color: var(--success);
}

.matrix-item.correct {
    background: rgba(16, 185, 129, 0.3) !important;
    border-color: #10b981 !important;
    color: #34d399 !important;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4) !important;
}

.matrix-item.wrong {
    background: rgba(239, 68, 68, 0.3) !important;
    border-color: #ef4444 !important;
    color: #f87171 !important;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4) !important;
}

.matrix-item.flagged {
    background: var(--warning-bg);
    border-color: var(--warning);
    color: var(--warning);
}

/* Question Card */
.question-card {
    padding: 20px;
    margin-bottom: 16px;
}

.question-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.question-text {
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 20px;
}

/* Option Items */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-option {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.quiz-option:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.06);
}

.quiz-option.selected {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(139, 92, 246, 0.25));
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
}

.quiz-option.correct {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.35), rgba(5, 150, 105, 0.3)) !important;
    border-color: #10b981 !important;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.5) !important;
    color: #ffffff !important;
}

.quiz-option.correct .opt-badge {
    background: #10b981 !important;
    color: #ffffff !important;
}

.quiz-option.wrong {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.35), rgba(220, 38, 38, 0.3)) !important;
    border-color: #ef4444 !important;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.5) !important;
    color: #ffffff !important;
}

.quiz-option.wrong .opt-badge {
    background: #ef4444 !important;
    color: #ffffff !important;
}

.quiz-option.disabled {
    opacity: 0.6;
    cursor: default;
}

/* Instant Quiz Feedback Card */
.feedback-card {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    animation: slideUpFade 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.feedback-card.correct {
    background: rgba(16, 185, 129, 0.16);
    border: 1px solid rgba(16, 185, 129, 0.45);
    color: #34d399;
}

.feedback-card.wrong {
    background: rgba(239, 68, 68, 0.16);
    border: 1px solid rgba(239, 68, 68, 0.45);
    color: #f87171;
}

.feedback-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 4px;
}

.feedback-body {
    font-size: 13px;
    line-height: 1.4;
    color: #e2e8f0;
}

@keyframes slideUpFade {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

.opt-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: var(--text-secondary);
}

.quiz-option.selected .opt-badge {
    background: var(--primary);
    color: #fff;
}

.opt-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

/* Quiz Controls Navigation */
.quiz-nav-btns {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

/* Result & Analytics Screen */
.result-hero {
    text-align: center;
    padding: 30px 20px;
    margin-bottom: 20px;
}

.score-radial {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    margin: 0 auto 16px auto;
    background: conic-gradient(var(--primary) calc(var(--score-pct) * 1%), rgba(255, 255, 255, 0.1) 0);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 0 30px var(--primary-glow);
}

.score-inner {
    width: 116px;
    height: 116px;
    border-radius: 50%;
    background: var(--bg-surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.score-num {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
}

.score-pct-text {
    font-size: 13px;
    color: var(--text-secondary);
}

.grade-badge {
    display: inline-block;
    padding: 4px 16px;
    border-radius: 20px;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 14px;
    margin-bottom: 8px;
}

.grade-badge.excellent { background: var(--success-bg); color: var(--success); border: 1px solid var(--success); }
.grade-badge.good { background: rgba(99, 102, 241, 0.2); color: #a5b4fc; border: 1px solid var(--primary); }
.grade-badge.fail { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger); }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.stat-card {
    padding: 14px 10px;
    text-align: center;
}

.stat-value {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 18px;
    margin-top: 4px;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
}



.ans-line.user-correct { background: var(--success-bg); color: var(--success); }
.ans-line.user-wrong { background: var(--danger-bg); color: var(--danger); }
.ans-line.correct-key { background: rgba(255, 255, 255, 0.05); color: var(--text-secondary); }

.explanation-text {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-glass);
    font-size: 12px;
    color: #a5b4fc;
}

/* Leaderboard View */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.leader-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
}

.rank-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
}

.rank-1 { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
.rank-2 { background: linear-gradient(135deg, #9ca3af, #4b5563); color: #fff; }
.rank-3 { background: linear-gradient(135deg, #b45309, #78350f); color: #fff; }
.rank-other { background: rgba(255, 255, 255, 0.08); color: var(--text-secondary); }

/* Bottom Navigation Bar */
.bottom-nav, .app-nav {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 448px;
    height: 62px;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 10px;
    border-radius: 30px;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.nav-item i {
    width: 20px;
    height: 20px;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active i {
    filter: drop-shadow(0 0 6px var(--primary-glow));
}

/* Wallet & Subscription Modal */
.sub-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.25s ease-out;
}

.sub-modal-card {
    position: relative;
    max-width: 440px;
    width: 100%;
    padding: 24px;
    border-radius: 20px;
    text-align: center;
    background: rgba(16, 24, 48, 0.95);
    border: 1px solid rgba(96, 165, 250, 0.3);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.modal-close-btn {
    position: absolute;
    top: 14px; right: 14px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    width: 28px; height: 28px;
    border-radius: 50%;
    cursor: pointer;
}

.wallet-pill-box {
    background: rgba(99, 102, 241, 0.15);
    border: 1px dashed rgba(99, 102, 241, 0.4);
    padding: 10px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.plans-list-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
    text-align: left;
}

.plan-card-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.plan-card-item.featured {
    border-color: #38bdf8;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(99, 102, 241, 0.12));
}

.best-tag {
    position: absolute;
    top: -9px; right: 12px;
    background: #38bdf8;
    color: #000;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.plan-name { font-weight: 700; font-size: 14px; color: #fff; }
.plan-dur { font-size: 11px; color: var(--text-secondary); }
.plan-price { font-weight: 800; font-size: 14px; color: #38bdf8; margin-bottom: 4px; }
.btn-primary-sm {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

/* Embedded Quiz Images & Diagrams */
.quiz-media-img {
    max-width: 100%;
    height: auto;
    max-height: 380px;
    display: block;
    margin: 12px auto;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(15, 23, 42, 0.7);
    object-fit: contain;
}

/* Anti-Copy and Text Selection Protection */
body, .app-viewport, .test-runner-container, .quiz-question-box, .option-card, .quiz-question-text {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
}

/* History Card Interaction & Analysis Styles */
.history-card-item {
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.history-card-item:hover, .history-card-item:active {
    transform: translateY(-2px);
    border-color: rgba(96, 165, 250, 0.4);
    background: rgba(255, 255, 255, 0.06);
}

.analysis-filter-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}
.analysis-filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}
.analysis-filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 12px var(--primary-glow);
}

.question-card.status-correct {
    border-left: 4px solid var(--success);
}
.question-card.status-wrong {
    border-left: 4px solid var(--danger);
}
.question-card.status-skipped {
    border-left: 4px solid var(--warning);
}

.quiz-option.correct-key {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.08);
}


