/* Modern CSS Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Modern Color Palette */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border: #475569;
    --border-light: #64748b;
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 20px rgb(99 102 241 / 0.3);
}

/* Import Modern Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Base Styles */
body {
    font-family: var(--font-primary);
    background: linear-gradient(135deg, var(--background) 0%, #1a202c 50%, var(--surface) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
    overflow-x: hidden;
}

/* Smooth scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-lg);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-xl);
    min-height: 100vh;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: var(--space-2xl);
    position: relative;
    padding: var(--space-2xl) 0;
}

.header h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-md);
    letter-spacing: -0.02em;
}

.header p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.back-btn {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    font-weight: 500;
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.back-btn:hover {
    background: var(--surface-light);
    border-color: var(--primary);
    transform: translateY(-50%) translateX(-4px);
    box-shadow: var(--shadow-lg);
}

/* Test Selection Grid */
.test-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: var(--space-xl);
    margin-bottom: var(--space-2xl);
}

.test-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    padding: var(--space-2xl);
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.test-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.test-card:hover::before {
    transform: scaleX(1);
}

.test-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    background: rgba(30, 41, 59, 0.8);
}

.test-icon {
    font-size: 3.5rem;
    margin-bottom: var(--space-lg);
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.test-card h2 {
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.test-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-lg);
    font-size: 1rem;
}

.test-features {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    justify-content: center;
    margin-bottom: var(--space-xl);
}

.feature {
    background: var(--surface-light);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-xl);
    font-size: 0.85rem;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    font-weight: 500;
}

.test-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-xl);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    position: relative;
    overflow: hidden;
    font-family: var(--font-primary);
}

.test-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.test-btn:hover::before {
    left: 100%;
}

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

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    flex-direction: column;
    backdrop-filter: blur(8px);
}

.loading-spinner.show {
    display: flex;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--surface);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--space-lg);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner p {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 500;
}

/* Fullscreen Layout */
.fullscreen-body {
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(135deg, var(--background) 0%, #1a202c 50%, var(--surface) 100%);
}

.fullscreen-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: none;
    margin: 0;
    padding: 0;
}

.compact-header {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: var(--space-md) var(--space-xl);
    flex-shrink: 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary);
}

.header-content h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-content .back-btn {
    position: static;
    transform: none;
    padding: var(--space-sm) var(--space-md);
    font-size: 0.9rem;
}

/* Test Layout with Palette */
.test-with-palette {
    display: flex;
    height: calc(100vh - 80px);
    gap: var(--space-lg);
    padding: var(--space-lg) var(--space-xl);
    flex: 1;
    overflow: hidden;
}

.question-palette {
    min-width: 200px;
    max-width: 240px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    overflow-y: auto;
    flex-shrink: 0;
    backdrop-filter: blur(8px);
}

.test-area-fullscreen {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.test-header {
    flex-shrink: 0;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.test-info h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.test-stats {
    display: flex;
    gap: var(--space-lg);
    align-items: center;
    flex-wrap: wrap;
}

.timer {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Question Container */
.question-container {
    flex: 1;
    overflow-y: auto;
    margin-bottom: var(--space-lg);
    padding-right: var(--space-sm);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.question-type {
    background: var(--success);
    color: white;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.subject-tag {
    background: var(--accent);
    color: white;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
    font-weight: 600;
}

.question-content {
    font-size: 1.15rem;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: var(--space-xl);
    background: var(--surface-light);
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
}

.question-image {
    text-align: center;
    margin: var(--space-xl) 0;
}

.question-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

/* Options Container */
.options-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.option {
    background: var(--surface-light);
    border: 1px solid var(--border);
    padding: var(--space-lg) var(--space-xl);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    display: flex;
    align-items: center;
    position: relative;
}

.option:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
    transform: translateX(4px);
}

.option.selected {
    background: rgba(99, 102, 241, 0.2);
    color: var(--text-primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

.option.correct {
    background: rgba(16, 185, 129, 0.2);
    color: var(--text-primary);
    border-color: var(--success);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.option.incorrect {
    background: rgba(239, 68, 68, 0.2);
    color: var(--text-primary);
    border-color: var(--error);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3);
}

.option-letter {
    background: var(--primary);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: var(--space-lg);
    font-weight: 600;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.option.selected .option-letter,
.option.correct .option-letter {
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary);
}

.option.incorrect .option-letter {
    background: rgba(255, 255, 255, 0.9);
    color: var(--error);
}

/* Numerical Input */
.numerical-input {
    margin-bottom: var(--space-xl);
}

.numerical-input input {
    width: 100%;
    padding: var(--space-lg) var(--space-xl);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 1.1rem;
    background: var(--surface-light);
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-family: var(--font-primary);
}

.numerical-input input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: var(--surface);
}

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

/* Solution Container */
.solution-container {
    background: var(--surface-light);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-top: var(--space-xl);
    border: 1px solid var(--border);
    border-left: 4px solid var(--success);
}

.solution-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.solution-header h4 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
}

.correct-answer {
    background: var(--success);
    color: white;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 0.9rem;
}

.solution-content {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 1rem;
}

/* Navigation */
.test-navigation,
.practice-navigation {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.nav-btn {
    background: var(--surface-light);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    font-family: var(--font-primary);
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.nav-btn.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: var(--primary);
    color: white;
}

.nav-btn.primary:hover {
    box-shadow: var(--shadow-lg), 0 4px 20px rgba(99, 102, 241, 0.4);
}

.nav-btn.submit {
    background: linear-gradient(135deg, var(--success), #059669);
    border-color: var(--success);
    color: white;
}

.nav-btn.submit:hover {
    box-shadow: var(--shadow-lg), 0 4px 20px rgba(16, 185, 129, 0.4);
}

.nav-btn.answer {
    background: linear-gradient(135deg, var(--warning), #d97706);
    border-color: var(--warning);
    color: white;
}

.nav-btn.answer:hover {
    box-shadow: var(--shadow-lg), 0 4px 20px rgba(245, 158, 11, 0.4);
}

.nav-btn:disabled {
    background: var(--surface);
    color: var(--text-muted);
    border-color: var(--border);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Question Palette */
.question-palette h4 {
    text-align: center;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    border-bottom: 2px solid var(--primary);
    padding-bottom: var(--space-sm);
}

.palette-question-btn {
    width: 44px;
    height: 44px;
    margin: var(--space-xs);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface-light);
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: inline-block;
    position: relative;
}

.palette-question-btn:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    transform: scale(1.05);
}

.palette-question-btn.current {
    background: var(--primary);
    color: white;
    border-color: var(--primary-dark);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.palette-question-btn.answered {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.palette-question-btn.unanswered {
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.palette-question-btn.current.answered {
    background: var(--success);
    color: white;
    border-color: #059669;
}

.palette-question-btn.current.unanswered {
    background: var(--error);
    color: white;
    border-color: #dc2626;
}

/* Subject Dividers */
.subject-divider {
    width: 100%;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: var(--space-md) 0 var(--space-sm) 0;
    padding: var(--space-sm);
    background: var(--surface-light);
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid var(--border);
}

/* Cards and Selections */
.session-selection,
.topic-selection,
.topic-wise-selection,
.practice-area {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-xl);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    margin: var(--space-lg) var(--space-xl);
    backdrop-filter: blur(8px);
}

.sessions-grid,
.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-xl);
}

.session-card,
.topic-card {
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.session-card::before,
.topic-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.session-card:hover::before,
.topic-card:hover::before {
    transform: scaleX(1);
}

.session-card:hover,
.topic-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    background: var(--surface);
}

.session-card h3,
.topic-card h3 {
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    font-size: 1.25rem;
    font-weight: 600;
}

.session-card p,
.topic-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: var(--space-sm);
}

.time-info {
    color: var(--accent) !important;
    font-weight: 600 !important;
}

.topic-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-md);
}

.subject-badge {
    background: var(--primary);
    color: white;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-lg);
    font-size: 0.8rem;
    font-weight: 600;
}

.question-count {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Topic Selection */
.selection-info {
    color: var(--text-secondary);
    margin-bottom: var(--space-2xl);
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.6;
}

.subjects-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-xl);
    margin-bottom: var(--space-2xl);
}

.subject-group h3 {
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    font-size: 1.25rem;
    font-weight: 600;
    border-bottom: 2px solid var(--primary);
    padding-bottom: var(--space-sm);
}

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

.topic-checkbox {
    display: flex;
    align-items: center;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    transition: background-color 0.3s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.topic-checkbox:hover {
    background-color: var(--surface-light);
    border-color: var(--border);
}

.topic-checkbox input {
    margin-right: var(--space-md);
    transform: scale(1.2);
    accent-color: var(--primary);
}

.topic-checkbox label {
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.selection-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    flex-wrap: wrap;
}

/* Results */
.result-area {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    text-align: center;
    backdrop-filter: blur(8px);
}

.result-container h2 {
    color: var(--text-primary);
    margin-bottom: var(--space-2xl);
    font-size: 2.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-summary {
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-2xl);
    text-align: left;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border);
}

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

.result-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.result-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.result-value.score {
    color: var(--success);
}

.result-value.percentage {
    color: var(--primary);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

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

/* Responsive Design */
@media (max-width: 1024px) {
    .test-selection-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }
    
    .subjects-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: var(--space-lg);
    }
    
    .test-selection-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .test-card {
        padding: var(--space-xl);
    }
    
    .header h1 {
        font-size: 2.5rem;
    }
    
    .back-btn {
        position: static;
        transform: none;
        margin-bottom: var(--space-lg);
        width: fit-content;
    }
    
    .test-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }
    
    .test-stats {
        flex-direction: column;
        gap: var(--space-sm);
        align-items: flex-start;
    }
    
    .test-navigation,
    .practice-navigation {
        justify-content: center;
    }
    
    .selection-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-btn {
        min-width: 160px;
    }
    
    .test-with-palette {
        flex-direction: column;
        height: calc(100vh - 60px);
        padding: var(--space-sm) var(--space-md);
    }
    
    .question-palette {
        min-width: auto;
        max-width: none;
        max-height: 120px;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        order: 2;
    }
    
    .test-area-fullscreen {
        order: 1;
        flex: 1;
        min-height: 0;
    }
    
    .palette-question-btn {
        display: inline-block;
        margin: var(--space-xs);
    }
    
    .compact-header {
        padding: var(--space-sm) var(--space-md);
    }
    
    .header-content h1 {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .test-with-palette {
        gap: var(--space-sm);
        padding: var(--space-xs);
    }
    
    .test-area-fullscreen {
        padding: var(--space-lg);
    }
    
    .question-palette {
        padding: var(--space-md);
        max-height: 100px;
    }
    
    .palette-question-btn {
        width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }
    
    .question-content {
        font-size: 1rem;
        padding: var(--space-lg);
    }
    
    .option {
        padding: var(--space-md) var(--space-lg);
    }
    
    .session-selection,
    .topic-selection,
    .topic-wise-selection,
    .practice-area {
        padding: var(--space-lg);
        margin: var(--space-sm);
    }
}

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

.test-card,
.session-card,
.topic-card {
    animation: fadeInUp 0.6s ease-out;
}

/* Focus styles for accessibility */
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .test-navigation,
    .question-palette,
    .back-btn {
        display: none !important;
    }
}
