/* ============================================
   JEE MASTERY - DESIGN SYSTEM
   A sophisticated, modern educational platform
   ============================================ */

/* CSS Variables - Alpine Frost Palette */
:root {
    /* Primary Colors */
    --primary-900: #0A1929;
    --primary-800: #0D2137;
    --primary-700: #122B4A;
    --primary-600: #1A3A5C;
    --primary-500: #2E5090;
    --primary-400: #4A6FA5;
    --primary-300: #6B8FC7;
    --primary-200: #A8C4E0;
    --primary-100: #D4E5F7;
    --primary-50: #E3EDF7;
    
    /* Accent Colors */
    --accent-500: #00D4AA;
    --accent-400: #33E0BB;
    --accent-300: #66EBCC;
    --accent-600: #00B894;
    
    /* Neutral Colors */
    --neutral-900: #1A1A1A;
    --neutral-800: #2D2D2D;
    --neutral-700: #404040;
    --neutral-600: #525252;
    --neutral-500: #6B7280;
    --neutral-400: #9CA3AF;
    --neutral-300: #D1D5DB;
    --neutral-200: #E5E7EB;
    --neutral-100: #F3F4F6;
    --neutral-50: #F9FAFB;
    
    /* Semantic Colors */
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    --info: #3B82F6;
    
    /* Subject Colors */
    --physics: #8B5CF6;
    --chemistry: #10B981;
    --mathematics: #F59E0B;
    
    /* Typography */
    --font-display: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Outfit', sans-serif;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 40px rgba(46, 80, 144, 0.15);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
    
    /* Layout */
    --max-width: 1400px;
    --nav-height: 72px;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --primary-900: #E3EDF7;
    --primary-800: #D4E5F7;
    --primary-700: #A8C4E0;
    --primary-600: #6B8FC7;
    --primary-500: #4A6FA5;
    --primary-400: #2E5090;
    --primary-300: #1A3A5C;
    --primary-200: #122B4A;
    --primary-100: #0D2137;
    --primary-50: #0A1929;
    
    --neutral-900: #F9FAFB;
    --neutral-800: #F3F4F6;
    --neutral-700: #E5E7EB;
    --neutral-600: #D1D5DB;
    --neutral-500: #9CA3AF;
    --neutral-400: #6B7280;
    --neutral-300: #525252;
    --neutral-200: #404040;
    --neutral-100: #2D2D2D;
    --neutral-50: #1A1A1A;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
}

/* ============================================
   BASE STYLES
   ============================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--neutral-50);
    color: var(--neutral-900);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    color: var(--primary-900);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* ============================================
   NAVIGATION
   ============================================ */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--neutral-200);
    z-index: 1000;
    transition: all var(--transition-base);
}

[data-theme="dark"] .navbar {
    background: rgba(10, 25, 41, 0.9);
    border-bottom-color: var(--neutral-800);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-xl);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary-900);
}

.logo-icon {
    font-size: 1.75rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.nav-links {
    display: flex;
    gap: var(--space-xs);
}

.nav-link {
    padding: var(--space-sm) var(--space-md);
    font-weight: 500;
    color: var(--neutral-600);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-500);
    background: var(--primary-50);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.streak {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-weight: 600;
    color: var(--warning);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--neutral-100);
    color: var(--neutral-700);
    border: 1px solid var(--neutral-300);
}

.btn-secondary:hover {
    background: var(--neutral-200);
}

.btn-ghost {
    background: transparent;
    color: var(--neutral-600);
}

.btn-ghost:hover {
    background: var(--neutral-100);
    color: var(--neutral-900);
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover {
    background: #DC2626;
}

.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: 1.1rem;
}

.btn-sm {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    transition: transform var(--transition-fast);
}

.btn:hover .btn-icon {
    transform: translateX(4px);
}

/* ============================================
   SECTIONS
   ============================================ */

.section {
    min-height: calc(100vh - var(--nav-height));
    padding: var(--space-4xl) var(--space-xl);
    padding-top: calc(var(--nav-height) + var(--space-4xl));
}

.section.hidden {
    display: none;
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto var(--space-3xl);
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
    background: linear-gradient(135deg, var(--primary-500), var(--accent-500));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--neutral-500);
}

/* ============================================
   HERO SECTION
   ============================================ */

.section-home {
    display: flex;
    align-items: center;
    padding-top: var(--nav-height);
}

.hero {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4xl);
    align-items: center;
    width: 100%;
}

.hero-content {
    animation: fadeInUp 0.8s ease;
}

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

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--primary-50);
    border: 1px solid var(--primary-200);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-600);
    margin-bottom: var(--space-lg);
}

.badge-icon {
    font-size: 1.25rem;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: var(--space-lg);
    color: var(--primary-900);
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-500), var(--accent-500));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--neutral-500);
    margin-bottom: var(--space-2xl);
    max-width: 500px;
}

.hero-stats {
    display: flex;
    gap: var(--space-2xl);
    margin-bottom: var(--space-2xl);
}

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

.stat-number {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-500);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--neutral-500);
    font-weight: 500;
}

.hero-actions {
    display: flex;
    gap: var(--space-md);
}

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

.floating-card {
    position: absolute;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    animation: float 6s ease-in-out infinite;
    z-index: 10;
}

.card-physics {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
    border-left: 4px solid var(--physics);
}

.card-chemistry {
    top: 40%;
    right: 5%;
    animation-delay: 2s;
    border-left: 4px solid var(--chemistry);
}

.card-maths {
    bottom: 15%;
    left: 20%;
    animation-delay: 4s;
    border-left: 4px solid var(--mathematics);
}

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

.card-icon {
    font-size: 1.5rem;
}

.card-text {
    font-weight: 600;
    color: var(--neutral-700);
}

.hero-graphic {
    position: relative;
    width: 300px;
    height: 300px;
}

.orbit-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.orbit {
    position: absolute;
    border: 2px solid var(--primary-200);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.orbit-1 {
    width: 100%;
    height: 100%;
    animation: rotate 20s linear infinite;
}

.orbit-2 {
    width: 70%;
    height: 70%;
    animation: rotate 15s linear infinite reverse;
}

.orbit-3 {
    width: 40%;
    height: 40%;
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.center-core {
    position: absolute;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-500), var(--accent-500));
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 60px rgba(46, 80, 144, 0.4);
    animation: pulse-core 2s ease-in-out infinite;
}

@keyframes pulse-core {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
}

/* ============================================
   TESTS SECTION
   ============================================ */

.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    justify-content: center;
    margin-bottom: var(--space-2xl);
}

.filter-group {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: var(--space-sm) var(--space-md);
    background: var(--neutral-100);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-full);
    font-weight: 500;
    color: var(--neutral-600);
    transition: all var(--transition-fast);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-500);
    color: white;
    border-color: var(--primary-500);
}

.tests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-xl);
    max-width: var(--max-width);
    margin: 0 auto;
}

.test-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--neutral-200);
    transition: all var(--transition-base);
    cursor: pointer;
}

.test-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.test-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-md);
}

.test-subject-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.test-subject-badge.physics {
    background: rgba(139, 92, 246, 0.1);
    color: var(--physics);
}

.test-subject-badge.chemistry {
    background: rgba(16, 185, 129, 0.1);
    color: var(--chemistry);
}

.test-subject-badge.mathematics {
    background: rgba(245, 158, 11, 0.1);
    color: var(--mathematics);
}

.test-difficulty {
    font-size: 0.75rem;
    font-weight: 600;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-md);
}

.difficulty-easy { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.difficulty-medium { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.difficulty-hard { background: rgba(239, 68, 68, 0.1); color: var(--error); }

.test-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary-900);
    margin-bottom: var(--space-sm);
}

.test-description {
    font-size: 0.875rem;
    color: var(--neutral-500);
    margin-bottom: var(--space-lg);
    line-height: 1.5;
}

.test-meta {
    display: flex;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.test-meta-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.875rem;
    color: var(--neutral-600);
}

.test-meta-icon {
    font-size: 1rem;
}

.test-progress {
    margin-bottom: var(--space-lg);
}

.progress-bar {
    height: 6px;
    background: var(--neutral-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-500), var(--accent-500));
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.test-progress-text {
    font-size: 0.75rem;
    color: var(--neutral-500);
    margin-top: var(--space-xs);
}

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

/* ============================================
   TEST INTERFACE
   ============================================ */

.section-test-interface {
    padding: var(--space-lg);
    padding-top: calc(var(--nav-height) + var(--space-lg));
}

.test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-lg);
    position: sticky;
    top: var(--nav-height);
    z-index: 100;
}

.test-info {
    flex: 1;
}

.test-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-900);
}

.test-subject {
    font-size: 0.875rem;
    color: var(--neutral-500);
}

.test-timer {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    background: var(--primary-50);
    border-radius: var(--radius-lg);
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-600);
}

.timer-icon {
    font-size: 1.25rem;
}

.test-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--space-lg);
    max-width: var(--max-width);
    margin: 0 auto;
}

.question-panel {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
}

.question-nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--neutral-200);
}

.question-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 2px solid var(--neutral-200);
    background: white;
    color: var(--neutral-600);
}

.question-number:hover {
    border-color: var(--primary-300);
}

.question-number.answered {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.question-number.marked {
    background: var(--warning);
    border-color: var(--warning);
    color: white;
}

.question-number.current {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(46, 80, 144, 0.2);
}

.question-content {
    margin-bottom: var(--space-2xl);
}

.question-text {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--neutral-800);
    margin-bottom: var(--space-xl);
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.option-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--neutral-50);
    border: 2px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.option-item:hover {
    border-color: var(--primary-300);
    background: var(--primary-50);
}

.option-item.selected {
    border-color: var(--primary-500);
    background: var(--primary-50);
}

.option-marker {
    width: 24px;
    height: 24px;
    border: 2px solid var(--neutral-400);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--neutral-500);
    flex-shrink: 0;
}

.option-item.selected .option-marker {
    background: var(--primary-500);
    border-color: var(--primary-500);
    color: white;
}

.option-text {
    font-size: 1rem;
    color: var(--neutral-700);
    line-height: 1.5;
}

.question-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-lg);
    border-top: 1px solid var(--neutral-200);
}

.test-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.sidebar-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    box-shadow: var(--shadow-md);
}

.sidebar-card h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--neutral-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-md);
}

.status-legend {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.status-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.875rem;
    color: var(--neutral-600);
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.status-dot.answered { background: var(--success); }
.status-dot.not-answered { background: var(--neutral-300); }
.status-dot.marked { background: var(--warning); }
.status-dot.current { 
    background: white;
    border: 2px solid var(--primary-500);
}

.progress-ring {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto;
}

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

.progress-bg {
    fill: none;
    stroke: var(--neutral-200);
    stroke-width: 8;
}

.progress-fill {
    fill: none;
    stroke: url(#progressGradient);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset var(--transition-slow);
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.progress-text span:first-child {
    display: block;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-500);
}

.progress-text span:last-child {
    font-size: 0.75rem;
    color: var(--neutral-500);
}

/* ============================================
   RESULTS SECTION
   ============================================ */

.section-results {
    max-width: var(--max-width);
    margin: 0 auto;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2xl);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-xl);
    margin-bottom: var(--space-3xl);
}

.result-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--neutral-200);
}

.score-card {
    text-align: center;
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: conic-gradient(var(--primary-500) var(--score-deg), var(--neutral-200) var(--score-deg));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-lg);
    position: relative;
}

.score-circle::before {
    content: '';
    position: absolute;
    width: 120px;
    height: 120px;
    background: white;
    border-radius: 50%;
}

.score-value {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-500);
    position: relative;
    z-index: 1;
}

.score-total {
    font-size: 1rem;
    color: var(--neutral-500);
    position: relative;
    z-index: 1;
}

.score-percentage {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--success);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.stat-box {
    text-align: center;
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
}

.stat-box.correct { background: rgba(16, 185, 129, 0.1); }
.stat-box.incorrect { background: rgba(239, 68, 68, 0.1); }
.stat-box.unattempted { background: rgba(107, 114, 128, 0.1); }

.stat-icon {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
    display: block;
}

.stat-box.correct .stat-icon { color: var(--success); }
.stat-box.incorrect .stat-icon { color: var(--error); }
.stat-box.unattempted .stat-icon { color: var(--neutral-500); }

.stat-count {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    display: block;
    margin-bottom: var(--space-xs);
}

.stat-box.correct .stat-count { color: var(--success); }
.stat-box.incorrect .stat-count { color: var(--error); }
.stat-box.unattempted .stat-count { color: var(--neutral-500); }

.time-stats {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.time-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    background: var(--neutral-50);
    border-radius: var(--radius-lg);
}

.time-label {
    font-size: 0.875rem;
    color: var(--neutral-500);
}

.time-value {
    font-weight: 600;
    color: var(--primary-600);
}

.subject-bars {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.subject-bar-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.subject-bar-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
}

.subject-bar-name {
    font-weight: 600;
    color: var(--neutral-700);
}

.subject-bar-score {
    font-weight: 700;
    color: var(--primary-500);
}

.subject-bar-track {
    height: 8px;
    background: var(--neutral-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.subject-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.subject-bar-fill.physics { background: var(--physics); }
.subject-bar-fill.chemistry { background: var(--chemistry); }
.subject-bar-fill.mathematics { background: var(--mathematics); }

/* Analysis Section */
.analysis-section {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-md);
}

.analysis-tabs {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
    border-bottom: 2px solid var(--neutral-200);
    padding-bottom: var(--space-sm);
}

.tab-btn {
    padding: var(--space-sm) var(--space-lg);
    font-weight: 600;
    color: var(--neutral-500);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    color: var(--primary-500);
}

.tab-btn.active {
    color: var(--primary-500);
    border-bottom-color: var(--primary-500);
}

.analysis-content {
    min-height: 300px;
}

.analysis-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.analysis-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--neutral-50);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--primary-500);
}

.analysis-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: var(--radius-lg);
    font-size: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.analysis-text h4 {
    font-size: 1rem;
    margin-bottom: var(--space-xs);
    color: var(--primary-900);
}

.analysis-text p {
    font-size: 0.875rem;
    color: var(--neutral-500);
}

/* ============================================
   DASHBOARD SECTION
   ============================================ */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl);
    max-width: var(--max-width);
    margin: 0 auto;
}

.dash-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--neutral-200);
}

.overview-card {
    grid-column: span 2;
}

.overview-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-xl);
    margin-top: var(--space-xl);
}

.overview-item {
    text-align: center;
}

.overview-value {
    display: block;
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-500);
    margin-bottom: var(--space-xs);
}

.overview-label {
    font-size: 0.875rem;
    color: var(--neutral-500);
    font-weight: 500;
}

.chart-container {
    height: 300px;
    margin-top: var(--space-lg);
}

.subject-radars {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
    margin-top: var(--space-lg);
}

.radar-item {
    text-align: center;
}

.radar-chart {
    width: 100px;
    height: 100px;
    margin: 0 auto var(--space-md);
    position: relative;
}

.radar-svg {
    width: 100%;
    height: 100%;
}

.radar-label {
    font-weight: 600;
    color: var(--neutral-700);
    font-size: 0.875rem;
}

.radar-score {
    font-size: 0.75rem;
    color: var(--neutral-500);
}

.test-history {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.history-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--neutral-50);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.history-item:hover {
    background: var(--primary-50);
}

.history-subject {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    font-size: 1.25rem;
}

.history-subject.physics { background: rgba(139, 92, 246, 0.1); }
.history-subject.chemistry { background: rgba(16, 185, 129, 0.1); }
.history-subject.mathematics { background: rgba(245, 158, 11, 0.1); }

.history-info {
    flex: 1;
}

.history-title {
    font-weight: 600;
    color: var(--neutral-800);
    font-size: 0.875rem;
}

.history-date {
    font-size: 0.75rem;
    color: var(--neutral-500);
}

.history-score {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--primary-500);
}

/* ============================================
   PROGRESS SECTION
   ============================================ */

.progress-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl);
    max-width: var(--max-width);
    margin: 0 auto;
}

.progress-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--neutral-200);
}

.mastery-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.mastery-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--neutral-50);
    border-radius: var(--radius-lg);
}

.mastery-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    font-size: 1.5rem;
}

.mastery-icon.beginner { background: rgba(239, 68, 68, 0.1); }
.mastery-icon.intermediate { background: rgba(245, 158, 11, 0.1); }
.mastery-icon.advanced { background: rgba(59, 130, 246, 0.1); }
.mastery-icon.master { background: rgba(16, 185, 129, 0.1); }

.mastery-info {
    flex: 1;
}

.mastery-topic {
    font-weight: 600;
    color: var(--neutral-800);
    margin-bottom: var(--space-xs);
}

.mastery-level {
    font-size: 0.75rem;
    color: var(--neutral-500);
}

.mastery-bar {
    width: 100px;
    height: 6px;
    background: var(--neutral-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.mastery-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--primary-500), var(--accent-500));
}

.difficulty-bars {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    margin-top: var(--space-lg);
}

.difficulty-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.difficulty-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
}

.difficulty-name {
    font-weight: 600;
    color: var(--neutral-700);
}

.difficulty-accuracy {
    font-weight: 700;
    color: var(--primary-500);
}

.difficulty-track {
    height: 10px;
    background: var(--neutral-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.difficulty-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.difficulty-fill.easy { background: var(--success); }
.difficulty-fill.medium { background: var(--warning); }
.difficulty-fill.hard { background: var(--error); }

.comparison-chart {
    height: 250px;
    margin-top: var(--space-lg);
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: var(--space-md);
}

.comparison-bar {
    flex: 1;
    max-width: 60px;
    background: linear-gradient(180deg, var(--primary-500), var(--primary-300));
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    position: relative;
    transition: height var(--transition-slow);
}

.comparison-bar.you {
    background: linear-gradient(180deg, var(--accent-500), var(--accent-300));
}

.comparison-label {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: var(--neutral-500);
    white-space: nowrap;
}

.comparison-value {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--primary-500);
}

.recommendations {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.recommendation-item {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--neutral-50);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--primary-500);
}

.recommendation-icon {
    font-size: 1.5rem;
}

.recommendation-text h4 {
    font-size: 1rem;
    margin-bottom: var(--space-xs);
    color: var(--primary-900);
}

.recommendation-text p {
    font-size: 0.875rem;
    color: var(--neutral-500);
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    background: var(--primary-900);
    color: var(--primary-100);
    padding: var(--space-3xl) var(--space-xl) var(--space-xl);
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: var(--space-md);
}

.footer-text {
    color: var(--primary-300);
    margin-bottom: var(--space-xl);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: var(--space-xl);
    margin-bottom: var(--space-2xl);
}

.footer-links a {
    color: var(--primary-200);
    font-weight: 500;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid var(--primary-700);
    padding-top: var(--space-xl);
    text-align: center;
    color: var(--primary-400);
    font-size: 0.875rem;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1024px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-content {
        order: 2;
    }
    
    .hero-visual {
        order: 1;
        height: 350px;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .test-layout {
        grid-template-columns: 1fr;
    }
    
    .test-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .sidebar-card {
        flex: 1;
        min-width: 200px;
    }
    
    .dashboard-grid,
    .progress-grid {
        grid-template-columns: 1fr;
    }
    
    .overview-card {
        grid-column: span 1;
    }
    
    .overview-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --space-4xl: 4rem;
        --space-3xl: 3rem;
    }
    
    .nav-links {
        display: none;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .tests-grid {
        grid-template-columns: 1fr;
    }
    
    .filters-bar {
        flex-direction: column;
    }
    
    .filter-group {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: var(--space-sm);
    }
    
    .test-header {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }
    
    .question-nav {
        justify-content: center;
    }
    
    .question-actions {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .results-header {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .subject-radars {
        grid-template-columns: 1fr;
    }
    
    .overview-stats {
        grid-template-columns: 1fr;
    }
    
    .footer-links {
        flex-direction: column;
        gap: var(--space-md);
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: var(--space-lg);
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .btn-lg {
        width: 100%;
    }
    
    .floating-card {
        display: none;
    }
    
    .test-card-actions {
        flex-direction: column;
    }
}

/* ============================================
   ANIMATIONS & UTILITIES
   ============================================ */

.fade-in {
    animation: fadeIn 0.5s ease;
}

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

.slide-up {
    animation: slideUp 0.5s ease;
}

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

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--neutral-100);
}

::-webkit-scrollbar-thumb {
    background: var(--neutral-400);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--neutral-500);
}

/* Selection */
::selection {
    background: var(--primary-200);
    color: var(--primary-900);
}

/* Focus States */
*:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid var(--neutral-300);
    border-top-color: var(--primary-500);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* SVG Gradient Definition */
.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
}