/* ═══════════════════════════════════════════════
   QuizGO – Mobile-First Design System
   ═══════════════════════════════════════════════ */

/* --- Design Tokens --- */
:root {
    --primary: #6C63FF;
    --primary-dark: #5A52E0;
    --primary-light: #8B84FF;
    --accent: #FF6584;
    --accent-dark: #E0496D;
    --success: #00D4AA;
    --warning: #FFB347;
    --danger: #FF4757;
    --info: #4ECDC4;

    --bg: #0B0B18;
    --bg-card: #13132A;
    --bg-surface: #1A1A35;
    --bg-elevated: #22224A;

    --text-primary: #EEEEF8;
    --text-secondary: #9999BB;
    --text-muted: #6666AA;

    --border: rgba(108, 99, 255, 0.15);
    --border-focus: rgba(108, 99, 255, 0.6);

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 9999px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(108, 99, 255, 0.3);

    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    --nav-height: 60px;
    --bottom-nav-height: 70px;
    --max-width: 480px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* --- Layout --- */
.top-nav {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--max-width);
    height: var(--nav-height);
    background: rgba(11, 11, 24, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
}

.nav-brand { display: flex; align-items: center; gap: 10px; }

.brand-link { display: flex; align-items: center; gap: 10px; }

.brand-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    box-shadow: var(--shadow-glow);
}

.brand-name {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.brand-accent { color: var(--primary-light); }

.nav-right { display: flex; align-items: center; gap: 8px; }

.nav-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
}

.nav-avatar img { width: 100%; height: 100%; object-fit: cover; }

.avatar-initials {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-light);
}

.main-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding-top: calc(var(--nav-height) + 16px);
    padding-bottom: calc(var(--bottom-nav-height) + 20px);
    min-height: 100vh;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--max-width);
    height: var(--bottom-nav-height);
    background: rgba(13, 13, 26, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 8px;
    z-index: 1000;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    transition: var(--transition);
    min-width: 48px;
    min-height: 48px;
    justify-content: center;
}

.tab-item i { font-size: 20px; transition: var(--transition); }
.tab-item span { font-size: 10px; font-weight: 600; letter-spacing: 0.3px; }

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

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

.tab-item:hover { color: var(--primary-light); }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
    min-height: 44px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.4);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(108, 99, 255, 0.5);
}

.btn-primary:active { transform: translateY(0); }

.btn-accent {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(255, 101, 132, 0.4);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-ghost:hover { border-color: var(--primary); color: var(--primary-light); }

.btn-success {
    background: linear-gradient(135deg, var(--success), #00B890);
    color: #0B0B18;
    font-weight: 700;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #CC3A47);
    color: white;
}

.btn-sm { padding: 8px 16px; font-size: 13px; min-height: 36px; }
.btn-lg { padding: 16px 32px; font-size: 16px; min-height: 52px; }
.btn-full { width: 100%; }
.btn-icon { padding: 10px; min-width: 44px; }

/* --- Cards --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: var(--transition);
}

.card:hover { border-color: rgba(108, 99, 255, 0.3); }

.card-sm { padding: 14px; border-radius: var(--radius-md); }

/* --- Quiz Card --- */
.quiz-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

.quiz-card:hover {
    transform: translateY(-2px);
    border-color: rgba(108, 99, 255, 0.4);
    box-shadow: var(--shadow-md);
}

.quiz-card-thumb {
    height: 140px;
    background: linear-gradient(135deg, var(--bg-surface), var(--bg-elevated));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    position: relative;
    overflow: hidden;
}

.quiz-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.quiz-card-thumb::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(transparent, var(--bg-card));
}

.quiz-card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    z-index: 1;
}

.badge-free { background: rgba(0, 212, 170, 0.2); color: var(--success); border: 1px solid rgba(0, 212, 170, 0.3); }
.badge-paid { background: rgba(255, 183, 71, 0.2); color: var(--warning); border: 1px solid rgba(255, 183, 71, 0.3); }
.badge-hot { background: rgba(255, 71, 87, 0.2); color: var(--danger); border: 1px solid rgba(255, 71, 87, 0.3); }
.badge-new { background: rgba(108, 99, 255, 0.2); color: var(--primary-light); border: 1px solid var(--border); }

.quiz-card-body { padding: 14px 16px 16px; }

.quiz-card-subject {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--primary-light);
    margin-bottom: 6px;
}

.quiz-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.quiz-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.meta-item i { font-size: 11px; color: var(--text-muted); }

/* --- Category Card --- */
.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
    cursor: pointer;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: var(--transition);
}

.category-card:hover::before { opacity: 1; }
.category-card:hover { transform: translateY(-3px); border-color: rgba(108, 99, 255, 0.3); box-shadow: var(--shadow-md); }

.category-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 4px;
}

.category-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

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

/* --- Section headers --- */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 0 20px;
}

.section-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.section-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-light);
}

.section-link:hover { text-decoration: underline; }

/* --- Grid layouts --- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; padding: 0 20px; }
.grid-1 { display: flex; flex-direction: column; gap: 12px; padding: 0 20px; }

/* --- Horizontal scroll --- */
.scroll-x {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 20px 12px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x mandatory;
}

.scroll-x::-webkit-scrollbar { display: none; }

.scroll-x > * {
    flex-shrink: 0;
    scroll-snap-align: start;
}

/* --- Hero Banner --- */
.hero-banner {
    margin: 0 20px 24px;
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.2), rgba(255, 101, 132, 0.1));
    border: 1px solid rgba(108, 99, 255, 0.3);
    border-radius: var(--radius-xl);
    padding: 24px 20px;
    position: relative;
    overflow: hidden;
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(108, 99, 255, 0.3), transparent);
    border-radius: 50%;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(108, 99, 255, 0.2);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.hero-title {
    font-size: 26px;
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--text-primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.hero-stats {
    display: flex;
    gap: 20px;
    margin-top: 16px;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hero-stat-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
}

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

/* --- Search Bar --- */
.search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 12px 16px;
    margin: 0 20px 20px;
    transition: var(--transition);
}

.search-bar:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1); }
.search-bar i { color: var(--text-muted); font-size: 16px; }

.search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
}

.search-bar input::placeholder { color: var(--text-muted); }

/* --- Form elements --- */
.form-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
}

.form-input, .form-select {
    background: var(--bg-surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    color: var(--text-primary);
    font-size: 15px;
    transition: var(--transition);
    outline: none;
    width: 100%;
    min-height: 50px;
}

.form-input:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
}

.form-input::placeholder { color: var(--text-muted); }

.form-error {
    font-size: 12px;
    color: var(--danger);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* --- Progress/Stats --- */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    line-height: 1;
}

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

/* --- Progress bar --- */
.progress-bar {
    height: 6px;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Quiz Taking Screen --- */
.quiz-take-container {
    min-height: calc(100vh - var(--nav-height) - var(--bottom-nav-height));
    padding: 0 20px 20px;
}

.quiz-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: var(--nav-height);
    z-index: 100;
}

.question-counter {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
}

.timer {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-surface);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.timer.warning { color: var(--warning); border-color: rgba(255, 179, 71, 0.3); }
.timer.danger { color: var(--danger); border-color: rgba(255, 71, 87, 0.3); animation: pulse 1s infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.question-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 24px;
    margin: 16px 0;
}

.question-number {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.question-text {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.options-list { display: flex; flex-direction: column; gap: 10px; }

.option-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    min-height: 54px;
}

.option-item:hover { border-color: var(--primary); background: rgba(108, 99, 255, 0.08); }
.option-item:active { transform: scale(0.99); }

.option-item.selected { border-color: var(--primary); background: rgba(108, 99, 255, 0.15); }
.option-item.correct { border-color: var(--success); background: rgba(0, 212, 170, 0.12); }
.option-item.wrong { border-color: var(--danger); background: rgba(255, 71, 87, 0.12); }

.option-label {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: var(--transition);
}

.option-item.selected .option-label { background: var(--primary); border-color: var(--primary); color: white; }
.option-item.correct .option-label { background: var(--success); border-color: var(--success); color: var(--bg); }
.option-item.wrong .option-label { background: var(--danger); border-color: var(--danger); color: white; }

.option-text { font-size: 14px; font-weight: 500; color: var(--text-primary); line-height: 1.4; flex: 1; }

/* Question navigation dots */
.question-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

.q-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    border: 1.5px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-secondary);
    transition: var(--transition);
}

.q-dot.answered { background: var(--primary); border-color: var(--primary); color: white; }
.q-dot.flagged { background: rgba(255, 179, 71, 0.2); border-color: var(--warning); color: var(--warning); }
.q-dot.current { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.2); color: var(--primary-light); }

/* --- Result Screen --- */
.result-hero {
    text-align: center;
    padding: 32px 20px 24px;
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.1), rgba(255, 101, 132, 0.05));
    border-radius: var(--radius-xl);
    margin: 16px 20px;
}

.score-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: conic-gradient(var(--primary) var(--score-pct), var(--bg-elevated) 0);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    position: relative;
}

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

.score-value { font-size: 28px; font-weight: 900; color: var(--text-primary); }
.score-denom { font-size: 12px; color: var(--text-muted); }

.result-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 0 20px 16px;
}

.result-stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    text-align: center;
}

.result-stat-value { font-size: 22px; font-weight: 800; }
.result-stat-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* Explanation box */
.explanation-box {
    background: rgba(0, 212, 170, 0.05);
    border: 1px solid rgba(0, 212, 170, 0.2);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-top: 12px;
}

.explanation-box h4 { font-size: 13px; font-weight: 700; color: var(--success); margin-bottom: 6px; }
.explanation-box p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

/* --- Auth Screens --- */
.auth-container {
    min-height: calc(100vh - var(--nav-height) - var(--bottom-nav-height));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px 24px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 28px;
}

.auth-logo .brand-logo {
    width: 64px;
    height: 64px;
    font-size: 28px;
    margin: 0 auto 12px;
    border-radius: 16px;
}

.auth-logo h1 { font-size: 26px; font-weight: 900; letter-spacing: -0.5px; }
.auth-logo p { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    margin: 16px 0;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* --- Plans/Premium --- */
.plan-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 24px;
    position: relative;
    transition: var(--transition);
}

.plan-card.popular {
    border-color: var(--primary);
    box-shadow: 0 0 30px rgba(108, 99, 255, 0.2);
}

.plan-popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    padding: 4px 16px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.plan-price {
    font-size: 36px;
    font-weight: 900;
    color: var(--text-primary);
    margin: 8px 0;
    letter-spacing: -1px;
}

.plan-price sup { font-size: 18px; font-weight: 700; margin-right: 2px; color: var(--text-secondary); }
.plan-price span { font-size: 14px; font-weight: 500; color: var(--text-muted); }
.plan-name { font-size: 18px; font-weight: 800; color: var(--text-primary); }
.plan-features { list-style: none; margin: 16px 0; display: flex; flex-direction: column; gap: 10px; }
.plan-features li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-secondary); }
.plan-features li i { color: var(--success); font-size: 13px; width: 16px; }

/* --- Alerts --- */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    margin: 8px 20px;
}

.alert-success { background: rgba(0, 212, 170, 0.1); border: 1px solid rgba(0, 212, 170, 0.3); color: var(--success); }
.alert-error { background: rgba(255, 71, 87, 0.1); border: 1px solid rgba(255, 71, 87, 0.3); color: var(--danger); }
.alert-info { background: rgba(108, 99, 255, 0.1); border: 1px solid var(--border); color: var(--primary-light); }

/* --- Empty state --- */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.empty-state i { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 14px; line-height: 1.5; }

/* --- Chip/Tag --- */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

/* --- Streak badge --- */
.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(255, 179, 71, 0.2), rgba(255, 101, 132, 0.1));
    border: 1px solid rgba(255, 179, 71, 0.3);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
    color: var(--warning);
}

/* --- Misc --- */
.lock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(11, 11, 24, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    z-index: 5;
}

.lock-overlay i { font-size: 32px; color: var(--warning); }

.page-header {
    padding: 16px 20px 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.back-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

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

.page-title { font-size: 20px; font-weight: 800; color: var(--text-primary); }

/* --- Animations --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes shimmer {
    from { background-position: -200% 0; }
    to { background-position: 200% 0; }
}

.animate-fade-up { animation: fadeInUp 0.4s ease both; }
.animate-fade { animation: fadeIn 0.3s ease both; }

/* Stagger children */
.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-elevated) 50%, var(--bg-surface) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

/* Confetti animation for results */
@keyframes confettiFall {
    0% { transform: translateY(-10px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 2px; }

/* Dashboard chart placeholder */
.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin: 0 20px;
    height: 180px;
    display: flex;
    flex-direction: column;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    flex: 1;
    padding-top: 16px;
}

.chart-bar {
    flex: 1;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(180deg, var(--primary), var(--primary-dark));
    opacity: 0.8;
    min-height: 4px;
    transition: height 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tooltip */
.tooltip-text {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 8px;
    display: flex;
    justify-content: space-around;
}

/* Mobile-specific refinements */
@media (max-width: 400px) {
    .hero-title { font-size: 22px; }
    .grid-3 { grid-template-columns: 1fr 1fr; }
    .stat-value { font-size: 22px; }
}

/* Dark overlay */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 11, 24, 0.85);
    backdrop-filter: blur(8px);
    z-index: 500;
    animation: fadeIn 0.2s ease;
}

/* Bottom Sheet */
.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--max-width);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 16px 20px calc(var(--bottom-nav-height) + 16px);
    z-index: 600;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from { transform: translateX(-50%) translateY(100%); }
    to { transform: translateX(-50%) translateY(0); }
}

.sheet-handle {
    width: 36px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto 20px;
}

/* List items */
.list-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.list-item:last-child { border-bottom: none; }

.list-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.list-content { flex: 1; min-width: 0; }
.list-title { font-size: 14px; font-weight: 600; color: var(--text-primary); text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.list-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.list-end { font-size: 13px; font-weight: 700; color: var(--text-secondary); flex-shrink: 0; }
