:root {
    --bg-dark: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-primary: #6366f1;
    --accent-hover: #4f46e5;
    --glass-bg: rgba(30, 41, 59, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --left-color: #38bdf8;
    --right-color: #f472b6;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    padding: 1rem;
}

/* Dynamic Background Gradients */
.bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    animation: float 20s infinite alternate;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: rgba(99, 102, 241, 0.4);
    top: -100px;
    left: -100px;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: rgba(244, 114, 182, 0.3);
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

.shape-3 {
    width: 250px;
    height: 250px;
    background: rgba(56, 189, 248, 0.3);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(30px, -50px) scale(1.1);
    }

    100% {
        transform: translate(-30px, 50px) scale(0.9);
    }
}

/* Glassmorphism Container */
.glass-container {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem;
    width: 100%;
    max-width: 600px;
    box-shadow: var(--glass-shadow);
    text-align: center;
    position: relative;
    overflow: hidden;
}

section {
    display: none;
    animation: fadeIn 0.5s ease-out forwards;
}

section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    margin-bottom: 1rem;
}

.title {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #fff, #cbd5e1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.description {
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

/* Brain SVG Hero */
.brain-hero {
    width: 100%;
    margin-bottom: 1.5rem;
}

.brain-svg {
    width: 100%;
    height: auto;
    max-height: 200px;
    display: block;
    animation: brainFloat 6s ease-in-out infinite;
}

@keyframes brainFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}


/* Buttons */
button {
    font-family: var(--font-heading);
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.3s ease;
}

.primary-btn {
    background: var(--accent-primary);
    color: white;
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
    border-radius: 999px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.primary-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Quiz Elements */
.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--left-color), var(--right-color));
    width: 0%;
    transition: width 0.4s ease;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.question-counter {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0;
}

.question {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    line-height: 1.4;
    min-height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 1.25rem 1.5rem;
    border-radius: 16px;
    font-size: 1rem;
    text-align: left;
    font-family: var(--font-body);
    position: relative;
    overflow: hidden;
}

.option-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.option-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.option-btn:hover::before {
    opacity: 1;
}

.option-btn.selected {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--accent-primary);
}

/* Image Options Styling */
.image-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
}

.img-option-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.img-option-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
    border-color: var(--accent-primary);
}

.img-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 10px;
}

.img-label {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
}

/* Stroop Styling */
.stroop-wrapper {
    background: rgba(255, 255, 255, 0.05);
    padding: 2.5rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    margin-top: 1rem;
}

.stroop-display {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 2rem;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.stroop-hint,
.perception-hint {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* Perception / Navon Grid Styling */
.perception-wrapper {
    background: rgba(255, 255, 255, 0.05);
    padding: 2.5rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    margin-top: 1rem;
}

.navon-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(7, 1fr);
    gap: 8px;
    width: 200px;
    height: 280px;
    margin: 0 auto 2.5rem;
    font-family: monospace;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--accent-primary);
}

.navon-item {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
}


/* Result Visualization Dashboard */
.result-viz {
    margin-bottom: 3rem;
    animation: fadeInScale 0.8s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.bias-meter-container {
    margin: 2.5rem 0;
    padding: 0 1rem;
}

.bias-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.bias-bar-bg {
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    position: relative;
    overflow: visible;
    background: linear-gradient(90deg, var(--left-color-dark) 0%, rgba(255, 255, 255, 0.1) 50%, var(--right-color-dark) 100%);
}

.bias-marker {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
    transition: left 1.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2;
}

.bias-percentage {
    display: flex;
    justify-content: space-between;
    margin-top: 0.8rem;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
}

#perc-left {
    color: var(--left-color);
}

#perc-right {
    color: var(--right-color);
}

.score-cards {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 2rem;
}

.mini-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.2rem;
    width: 120px;
    position: relative;
    overflow: hidden;
}

.mini-card.left-brain {
    border-left: 4px solid var(--left-color);
}

.mini-card.right-brain {
    border-left: 4px solid var(--right-color);
}

.card-icon {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 2.5rem;
    font-weight: 900;
    opacity: 0.05;
    font-style: italic;
}

.card-val {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.2rem;
}

.card-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.left-brain .score-value {
    color: var(--left-color);
}

.right-brain .score-value {
    color: var(--right-color);
}

.result-desc {
    line-height: 1.6;
    margin-bottom: 2rem;
    font-size: 1.125rem;
    text-align: left;
}

/* Basis Info Fixed Layout */
.basis-container {
    text-align: left;
    margin-top: 2rem;
    border-top: 1px solid var(--glass-border);
    padding-top: 1.5rem;
}

.basis-header h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.basis-content {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.basis-content h4 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: var(--text-primary);
    margin: 1.5rem 0 0.5rem;
}

.basis-content ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

.basis-content li {
    margin-bottom: 0.5rem;
}

@media (max-width: 600px) {
    .glass-container {
        padding: 2rem 1.5rem;
        width: 100%;
    }

    .title {
        font-size: 2rem;
    }

    .score-container {
        gap: 1rem;
    }

    .score-box {
        width: 45%;
        padding: 1rem;
    }
}