:root {
    --bg-dark: #0f0c29;
    --bg-gradient: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    --glass-surface: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --neon-lime: #ccff00;
    --neon-magenta: #ff00cc;
    --neon-cyan: #00ffff;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --font-main: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--bg-gradient);
    color: var(--text-primary);
    font-family: var(--font-main);
    min-height: 100vh;
    overflow: hidden; /* Prevent scrolling, app-like feel */
    display: flex;
    justify-content: center;
    align-items: center;
}

#background-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.container {
    width: 100%;
    max-width: 600px;
    height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--glass-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Loader */
#loader-screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    background: var(--bg-dark); /* Solid background initially */
    transition: opacity 0.5s ease;
}

.scanner-line {
    width: 100%;
    height: 4px;
    background: var(--neon-cyan);
    box-shadow: 
        0 0 10px var(--neon-cyan),
        0 0 20px var(--neon-cyan),
        0 0 40px var(--neon-cyan); /* Strong glow */
    position: absolute;
    top: 0;
    z-index: 10;
}

/* Trail effect using pseudo-element */
.scanner-line::after {
    content: '';
    position: absolute;
    top: -50px; /* Length of trail */
    left: 0;
    width: 100%;
    height: 50px;
    background: linear-gradient(to top, rgba(0, 255, 255, 0.8), transparent);
    pointer-events: none;
}

/* Container relative for absolute scanner */
#loader-screen {
    /* ... existing ... */
    overflow: hidden; /* Ensure scanner doesn't overflow */
}

/* Animation */
@keyframes scan {
    0% { top: -10%; opacity: 0; }
    10% { opacity: 1; }
    50% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 110%; opacity: 0; }
}

.scanner-line {
    animation: scan 2s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

.scanner-line.scanning-up::after {
    top: 4px;
    background: linear-gradient(to bottom, rgba(0, 255, 255, 0.8), transparent);
}

.loader-text {
    font-size: 1.2rem;
    color: var(--neon-cyan);
    margin-top: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Intro Screen */
.intro-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.intro-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #fff, var(--neon-magenta));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(255, 0, 204, 0.3);
}

/* 3D Brain Container */
#brain-container {
    width: 200px;
    height: 200px;
    position: relative;
}

/* Buttons */
.btn-neon {
    background: rgba(255, 255, 255, 0.02); /* Almost clear */
    border: 1px solid rgba(255, 255, 255, 0.4); /* Crisp outer glass edge */
    color: #fff;
    padding: 20px 60px; /* Larger touch area */
    font-size: 1.5rem; /* Bigger text */
    font-weight: 800;
    border-radius: 60px; /* Pill shape */
    text-transform: uppercase;
    letter-spacing: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    display: inline-block;
    z-index: 10;
    margin-top: 30px;
    
    /* Thick Glass Effect */
    box-shadow: 
        inset 0 0 0 2px rgba(255, 255, 255, 0.1), /* Inner rim */
        inset 0 0 20px rgba(0, 255, 255, 0.2), /* Inner volume */
        0 0 25px rgba(0, 255, 255, 0.3); /* Outer glow */
        
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    
    /* Neon Text Effect */
    text-shadow: 
        0 0 10px rgba(0, 255, 255, 0.8),
        0 0 20px rgba(0, 255, 255, 0.5);
}

.btn-neon:hover {
    background: rgba(0, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.05);
    box-shadow: 
        inset 0 0 0 2px rgba(255, 255, 255, 0.3),
        inset 0 0 30px rgba(0, 255, 255, 0.4),
        0 0 50px rgba(0, 255, 255, 0.6);
    text-shadow: 
        0 0 10px #fff,
        0 0 20px #0ff,
        0 0 40px #0ff;
}

.btn-neon:active {
    transform: scale(0.95);
    box-shadow: 
        inset 0 0 0 2px rgba(255, 255, 255, 0.1),
        inset 0 0 10px rgba(0, 255, 255, 0.2),
        0 0 15px rgba(0, 255, 255, 0.2);
}

/* Questions */
#question-screen {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.progress-wrapper {
    margin-bottom: 20px;
    position: relative;
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta));
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--neon-cyan);
}

.question-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
    max-height: 100%;
    overflow-y: auto;
    scrollbar-width: none;
}
.question-card::-webkit-scrollbar {
    display: none;
}

.question-text {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    margin-bottom: 20px;
}

.options-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-btn {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 18px;
    color: white;
    font-size: 1rem;
    text-align: left;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    margin-bottom: 10px;
    
    /* Glass Gloss */
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 4px 6px rgba(0, 0, 0, 0.1);
}

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

.option-btn:active::before, .option-btn.selected::before {
    left: 100%;
}

.option-btn:active, .option-btn.selected {
    /* Liquid Glow Effect */
    background: rgba(0, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(0.98);
    
    /* Inner "Light Up" */
    box-shadow: 
        inset 0 0 20px rgba(0, 255, 255, 0.4),
        0 0 15px rgba(0, 255, 255, 0.3);
        
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

/* Results */
#results-screen {
    padding-bottom: 80px; /* Space for MainButton if needed */
    overflow-y: auto;
    height: 100%;
    scrollbar-width: none; /* Hide scrollbar */
}

#results-screen::-webkit-scrollbar {
    display: none;
}

.result-header {
    text-align: center;
    margin-bottom: 30px;
}

.result-score-big {
    font-size: clamp(2rem, 9vw, 3.5rem);
    font-weight: 900;
    color: var(--neon-magenta);
    text-shadow: 0 0 30px rgba(255, 0, 204, 0.5);
    margin: 10px 0;
    line-height: 1.1;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.stat-item {
    background: rgba(255,255,255,0.03);
    padding: 15px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.05);
    text-align: center;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
    text-transform: uppercase;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--neon-cyan);
}

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

.rec-card {
    background: rgba(255,255,255,0.05);
    padding: 15px;
    border-radius: 12px;
    font-size: 0.95rem;
    border-left: 3px solid var(--neon-lime);
}

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

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

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


/* AI Report Styles */
.ai-report-container {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--neon-cyan);
    border-radius: 20px;
    padding: 20px;
    margin-top: 20px;
    font-size: 1rem;
    line-height: 1.6;
    color: #fff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.1);
}

.ai-report-container h1, .ai-report-container h2, .ai-report-container h3 {
    color: var(--neon-cyan);
    margin-top: 15px;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.ai-report-container strong, .ai-report-container b {
    color: var(--neon-lime);
}

.ai-report-container ul {
    padding-left: 20px;
    margin-bottom: 15px;
}

.ai-report-container li {
    margin-bottom: 5px;
}
