/* ============================================
   KẾ TOÁN PRO - Premium Design System
   ============================================ */

/* CSS Variables */
:root {
    color-scheme: dark;
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-card: rgba(17, 17, 24, 0.8);
    --bg-card-hover: rgba(25, 25, 40, 0.9);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --bg-glass-hover: rgba(255, 255, 255, 0.06);
    
    --text-primary: #f0f0f5;
    --text-secondary: #8888a0;
    --text-muted: #55556a;
    
    --accent-primary: #6366f1;
    --accent-primary-rgb: 99, 102, 241;
    --accent-secondary: #06b6d4;
    --accent-secondary-rgb: 6, 182, 212;
    --accent-green: #10b981;
    --accent-green-rgb: 16, 185, 129;
    --accent-red: #ef4444;
    --accent-red-rgb: 239, 68, 68;
    --accent-amber: #f59e0b;
    --accent-amber-rgb: 245, 158, 11;
    --accent-purple: #a855f7;
    --accent-purple-rgb: 168, 85, 247;
    
    --gradient-primary: linear-gradient(135deg, #6366f1, #06b6d4);
    --gradient-secondary: linear-gradient(135deg, #a855f7, #6366f1);
    --gradient-green: linear-gradient(135deg, #10b981, #06b6d4);
    --gradient-warm: linear-gradient(135deg, #f59e0b, #ef4444);
    
    --border-color: rgba(255, 255, 255, 0.06);
    --border-color-hover: rgba(255, 255, 255, 0.12);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Particle Canvas */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0 2rem;
    backdrop-filter: blur(20px);
    background: rgba(10, 10, 15, 0.8);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(10, 10, 15, 0.95);
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 1.1rem;
    letter-spacing: -0.02em;
}

.logo-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: 10px;
    color: white;
}

.nav-logo strong {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 4px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition-fast);
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-glass-hover);
}

.nav-link.active {
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
    transition: var(--transition);
}

.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.mobile-menu {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 999;
    padding: 1rem;
    flex-direction: column;
    gap: 4px;
}

.mobile-menu.open {
    display: flex;
}

.mobile-link {
    text-decoration: none;
    color: var(--text-secondary);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: var(--transition-fast);
}

.mobile-link:hover, .mobile-link.active {
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
    display: none;
    min-height: 100vh;
    padding: 80px 2rem 2rem;
    position: relative;
    z-index: 1;
}

.section.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-top: 2rem;
}

.section-title {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.75rem;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 1.0625rem;
    max-width: 500px;
    margin: 0 auto;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   HERO
   ============================================ */
.hero {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    min-height: calc(100vh - 200px);
    padding-top: 2rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--accent-primary);
    margin-bottom: 1.5rem;
}

.badge-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-green);
    border-radius: 50%;
    animation: pulse-dot 2s ease infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

.hero-title {
    font-size: 3.25rem;
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: -0.04em;
    margin-bottom: 1.25rem;
}

.hero-desc {
    color: var(--text-secondary);
    font-size: 1.0625rem;
    line-height: 1.7;
    margin-bottom: 2rem;
    max-width: 480px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.hero-stats {
    display: flex;
    gap: 3rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: var(--font-mono);
}

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

/* Hero Visual */
.hero-visual {
    position: relative;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-circle {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    animation: float-circle 6s ease-in-out infinite;
}

.hero-circle-2 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.12) 0%, transparent 70%);
    animation-delay: -3s;
}

@keyframes float-circle {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(20px, -20px) scale(1.05); }
}

.floating-card {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    padding: 14px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    animation: float 5s ease-in-out infinite;
    z-index: 2;
}

.card-1 {
    top: 40px;
    right: 20px;
    animation-delay: 0s;
}

.card-2 {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    animation-delay: -1.5s;
}

.card-3 {
    bottom: 40px;
    right: 60px;
    animation-delay: -3s;
}

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

.card-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 1.2rem;
}

.card-icon-green { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.card-icon-blue { background: rgba(6, 182, 212, 0.15); color: var(--accent-secondary); }
.card-icon-purple { background: rgba(168, 85, 247, 0.15); color: var(--accent-purple); }

.card-title {
    font-size: 0.875rem;
    font-weight: 600;
}

.card-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: var(--font-main);
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.4);
}

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

.btn-glow {
    position: relative;
    overflow: hidden;
}

.btn-glow::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    animation: btn-shine 3s ease infinite;
}

@keyframes btn-shine {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color-hover);
}

.btn-outline:hover {
    background: var(--bg-glass-hover);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1rem;
    width: 100%;
    justify-content: center;
}

.btn-danger {
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--accent-red);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.5);
}

/* ============================================
   FEATURES
   ============================================ */
.features-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    padding: 2rem 0 4rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: var(--transition);
}

.feature-card:hover {
    border-color: var(--border-color-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
}

.feature-icon-1 { background: rgba(99, 102, 241, 0.12); color: var(--accent-primary); }
.feature-icon-2 { background: rgba(6, 182, 212, 0.12); color: var(--accent-secondary); }
.feature-icon-3 { background: rgba(16, 185, 129, 0.12); color: var(--accent-green); }
.feature-icon-4 { background: rgba(168, 85, 247, 0.12); color: var(--accent-purple); }

.feature-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    line-height: 1.6;
}

/* ============================================
   QUIZ - CATEGORIES
   ============================================ */
.categories-grid {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.category-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    border: 2px solid transparent;
    transition: var(--transition);
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
    border-color: rgba(99, 102, 241, 0.3);
}

.category-card:hover::after {
    border-color: rgba(99, 102, 241, 0.2);
}

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

.category-info {
    flex: 1;
}

.category-name {
    font-size: 0.9375rem;
    font-weight: 700;
    margin-bottom: 2px;
}

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

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

.category-card:hover .category-arrow {
    color: var(--accent-primary);
    transform: translateX(4px);
}

/* ============================================
   QUIZ - SETTINGS
   ============================================ */
.settings-card {
    max-width: 500px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 1.5rem;
    padding: 6px 0;
    font-family: var(--font-main);
    transition: var(--transition-fast);
}

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

.settings-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
}

.settings-group {
    margin-bottom: 1.75rem;
}

.settings-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.settings-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.setting-btn {
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    font-family: var(--font-main);
}

.setting-btn:hover {
    border-color: var(--border-color-hover);
    color: var(--text-primary);
}

.setting-btn.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
    color: var(--accent-primary);
}

/* ============================================
   QUIZ - ACTIVE
   ============================================ */
.quiz-header {
    max-width: 700px;
    margin: 0 auto 1.5rem;
}

.quiz-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.quiz-category-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
    padding: 4px 12px;
    border-radius: 100px;
}

.quiz-counter {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-family: var(--font-mono);
}

.quiz-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.quiz-progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}

.quiz-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quiz-timer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    padding: 6px 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.quiz-timer.warning {
    color: var(--accent-amber);
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.08);
    animation: timer-pulse 1s ease infinite;
}

.quiz-timer.danger {
    color: var(--accent-red);
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.08);
    animation: timer-pulse 0.5s ease infinite;
}

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

.quiz-score-live {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    font-weight: 600;
}

.score-correct { color: var(--accent-green); }
.score-wrong { color: var(--accent-red); }
.score-divider { color: var(--text-muted); }

/* Question Card */
.quiz-question-card {
    max-width: 700px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.question-number {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
}

.question-text {
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.6;
    margin-bottom: 1.75rem;
    letter-spacing: -0.01em;
}

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

.option-btn {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-glass);
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: left;
    width: 100%;
    font-family: var(--font-main);
    font-size: 0.9375rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.option-btn:hover:not(.disabled) {
    border-color: rgba(99, 102, 241, 0.4);
    background: rgba(99, 102, 241, 0.06);
}

.option-letter {
    width: 28px;
    height: 28px;
    min-width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.8125rem;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.option-btn:hover:not(.disabled) .option-letter {
    background: rgba(99, 102, 241, 0.2);
    color: var(--accent-primary);
}

.option-btn.correct {
    border-color: rgba(16, 185, 129, 0.5);
    background: rgba(16, 185, 129, 0.08);
}

.option-btn.correct .option-letter {
    background: var(--accent-green);
    color: white;
}

.option-btn.wrong {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.08);
}

.option-btn.wrong .option-letter {
    background: var(--accent-red);
    color: white;
}

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

.option-btn.correct.disabled,
.option-btn.wrong.disabled {
    opacity: 1;
}

/* Explanation */
.question-explanation {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: var(--radius-md);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.explanation-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.question-explanation p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

/* Quiz Actions */
.quiz-actions {
    max-width: 700px;
    margin: 1.25rem auto 0;
    display: flex;
    justify-content: flex-end;
}

/* ============================================
   QUIZ - RESULTS
   ============================================ */
.results-card {
    max-width: 500px;
    margin: 0 auto 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 3rem 2.5rem;
    text-align: center;
}

.results-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: bounce-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bounce-in {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.results-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
}

.results-score-circle {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 2rem;
}

.score-ring {
    width: 100%;
    height: 100%;
}

.score-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.score-percent {
    font-size: 2.25rem;
    font-weight: 900;
    font-family: var(--font-mono);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.score-unit {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 8px;
}

.results-details {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.result-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.result-correct .result-dot { background: var(--accent-green); }
.result-wrong .result-dot { background: var(--accent-red); }
.result-time .result-dot { background: var(--accent-primary); }

.results-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Review Section */
.review-section {
    max-width: 700px;
    margin: 0 auto;
}

.review-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
}

.review-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.review-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border-left: 3px solid;
}

.review-item.review-correct {
    border-left-color: var(--accent-green);
}

.review-item.review-wrong {
    border-left-color: var(--accent-red);
}

.review-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.review-q-number {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.review-badge {
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.review-badge.badge-correct {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.review-badge.badge-wrong {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.review-question {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.review-answer {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.review-answer strong {
    color: var(--accent-green);
}

.review-answer.your-answer strong {
    color: var(--accent-red);
}

.review-explanation {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(99, 102, 241, 0.06);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============================================
   KNOWLEDGE
   ============================================ */
.knowledge-grid {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.knowledge-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    transition: var(--transition);
}

.knowledge-card:hover {
    border-color: var(--border-color-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}

.knowledge-icon {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.knowledge-card h3 {
    font-size: 1.0625rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.knowledge-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.knowledge-card li {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
    padding-left: 16px;
    position: relative;
}

.knowledge-card li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent-primary);
}

.knowledge-card li strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ============================================
   STATS
   ============================================ */
.stats-overview {
    max-width: 900px;
    margin: 0 auto 2rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.stats-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
}

.stats-card:hover {
    border-color: var(--border-color-hover);
    transform: translateY(-3px);
}

.stats-card-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    margin: 0 auto 1rem;
}

.stats-icon-1 { background: rgba(99, 102, 241, 0.12); color: var(--accent-primary); }
.stats-icon-2 { background: rgba(16, 185, 129, 0.12); color: var(--accent-green); }
.stats-icon-3 { background: rgba(6, 182, 212, 0.12); color: var(--accent-secondary); }
.stats-icon-4 { background: rgba(245, 158, 11, 0.12); color: var(--accent-amber); }

.stats-card-value {
    font-size: 1.75rem;
    font-weight: 900;
    font-family: var(--font-mono);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.stats-card-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stats-history {
    max-width: 900px;
    margin: 0 auto 2rem;
}

.stats-history-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.stats-table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.stats-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
}

.stats-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.stats-table tr:last-child td {
    border-bottom: none;
}

.stats-table tr:hover td {
    background: var(--bg-glass);
}

.empty-row td {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-style: italic;
}

.stats-actions {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    justify-content: flex-end;
}

/* ============================================
   TOAST
   ============================================ */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 0.875rem;
    color: var(--text-primary);
    animation: toast-in 0.3s ease;
    backdrop-filter: blur(10px);
}

.toast.toast-out {
    animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(50px); }
}

.toast-success { border-left: 3px solid var(--accent-green); }
.toast-error { border-left: 3px solid var(--accent-red); }
.toast-info { border-left: 3px solid var(--accent-primary); }

/* ============================================
   EXAM MODE (Thi thử)
   ============================================ */
.settings-hint {
    margin-top: 0.625rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.option-btn.selected {
    border-color: rgba(var(--accent-primary-rgb), 0.6);
    background: rgba(var(--accent-primary-rgb), 0.1);
}

.option-btn.selected .option-letter {
    background: var(--accent-primary);
    color: white;
}

.exam-nav {
    max-width: 700px;
    margin: 1.25rem auto 0;
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.exam-palette-card {
    max-width: 700px;
    margin: 1.25rem auto 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}

.exam-palette-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.exam-palette-header strong {
    color: var(--accent-primary);
}

.exam-palette {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 8px;
}

.palette-cell {
    height: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-glass);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.palette-cell:hover {
    border-color: var(--border-color-hover);
    color: var(--text-primary);
}

.palette-cell.answered {
    background: rgba(var(--accent-primary-rgb), 0.18);
    border-color: rgba(var(--accent-primary-rgb), 0.4);
    color: var(--text-primary);
}

.palette-cell.current {
    outline: 2px solid var(--accent-secondary);
    outline-offset: 1px;
}

.confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.confirm-box {
    width: 100%;
    max-width: 400px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color-hover);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.2s ease;
}

.confirm-message {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.site-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem 1rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}

/* ============================================
   UTILITIES
   ============================================ */
.hidden {
    display: none !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-desc {
        margin: 0 auto 2rem;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-stats {
        justify-content: center;
    }

    .hero-visual {
        height: 280px;
    }

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

@media (max-width: 768px) {
    .section {
        padding: 72px 1rem 1rem;
    }

    .nav-links {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }

    .hero-title {
        font-size: 2rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
    }

    .results-details {
        flex-direction: column;
        gap: 0.75rem;
    }

    .results-actions {
        flex-direction: column;
    }

    .results-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .hero-visual {
        display: none;
    }

    .hero-stats {
        gap: 2rem;
    }

    .settings-card {
        padding: 1.5rem;
    }

    .quiz-question-card {
        padding: 1.5rem;
    }

    .results-card {
        padding: 2rem 1.5rem;
    }

    .knowledge-grid {
        grid-template-columns: 1fr;
    }

    .stats-table {
        font-size: 0.75rem;
    }

    .stats-table th, .stats-table td {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.75rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .settings-options {
        flex-direction: column;
    }

    .setting-btn {
        width: 100%;
        text-align: center;
    }
}
