:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #1a1a2e;
    --accent-primary: #7c3aed;
    --accent-glow: #a78bfa;
    --text-primary: #ffffff;
    --text-secondary: #b0b0c8;
    --border-color: #2d2d4a;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
}

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

html, body {
    width: 100%;
    height: 100%;
    font-family: 'Space Grotesk', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

body {
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1626 100%);
    min-height: 100vh;
    overflow: hidden;
}

.app-container {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Background gradient mesh effect */
.app-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(124, 58, 237, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(167, 139, 250, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.screen {
    width: 100%;
    height: 100%;
    max-width: 500px;
    position: absolute;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1;
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.screen.active {
    display: flex;
}

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

/* Welcome Screen */
.welcome-content {
    text-align: center;
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.logo-circle {
    font-size: 64px;
    margin-bottom: 24px;
    animation: float 3s ease-in-out infinite;
}

.welcome-content h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #ffffff 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.6;
}

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

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

/* Quiz Screen */
.quiz-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.progress-section {
    animation: slideDown 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.progress-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background-color: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-glow));
    width: 10%;
    border-radius: 2px;
    transition: width 0.4s ease-out;
}

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

.question-section {
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.1s;
    opacity: 0;
    animation-fill-mode: forwards;
}

.question-section h2 {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
}

.answers-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.2s;
    opacity: 0;
    animation-fill-mode: forwards;
}

.answer-btn {
    padding: 16px;
    border: 2px solid var(--border-color);
    background-color: rgba(26, 26, 46, 0.5);
    color: var(--text-primary);
    border-radius: 12px;
    font-size: 15px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    text-align: left;
    min-height: 60px;
    display: flex;
    align-items: center;
    min-width: 0;
}

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

.answer-btn:hover {
    border-color: var(--accent-primary);
    background-color: rgba(124, 58, 237, 0.1);
    transform: translateX(4px);
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.2);
}

.answer-btn:active {
    transform: translateX(4px) scale(0.98);
}

.answer-btn.selected {
    border-color: var(--accent-primary);
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(167, 139, 250, 0.1));
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.3), inset 0 0 20px rgba(124, 58, 237, 0.1);
    color: var(--accent-glow);
}

.answer-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Results Screen */
.results-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.score-reveal {
    text-align: center;
    padding: 32px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(167, 139, 250, 0.1));
    border: 2px solid var(--border-color);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    width: 100%;
    animation: scaleIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.score-label {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 12px;
}

.score-number {
    font-size: 72px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-glow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 12px;
    animation: countUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    counter-set: score var(--score-value, 0);
    content: counter(score);
}

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

.score-category {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent-glow);
    margin-bottom: 0;
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.2s;
    opacity: 0;
    animation-fill-mode: forwards;
}

.results-description {
    width: 100%;
    padding: 24px;
    background-color: rgba(45, 45, 74, 0.4);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    text-align: center;
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.3s;
    opacity: 0;
    animation-fill-mode: forwards;
}

.results-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.4s;
    opacity: 0;
    animation-fill-mode: forwards;
}

/* Buttons */
.btn {
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-glow));
    color: white;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(124, 58, 237, 0.4);
}

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

.btn-secondary {
    background-color: rgba(45, 45, 74, 0.6);
    color: var(--accent-glow);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: rgba(124, 58, 237, 0.1);
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.2);
}

.btn-secondary:active {
    background-color: rgba(124, 58, 237, 0.15);
}

/* Mobile optimizations */
@media (max-width: 480px) {
    .screen {
        padding: 16px;
    }

    .welcome-content h1 {
        font-size: 28px;
    }

    .question-section h2 {
        font-size: 18px;
    }

    .score-number {
        font-size: 56px;
    }

    .answer-btn {
        min-height: 56px;
        font-size: 14px;
    }

    .btn {
        min-height: 44px;
        font-size: 15px;
    }
}

@media (max-height: 600px) {
    .quiz-container {
        gap: 16px;
    }

    .results-container {
        gap: 16px;
    }

    .score-reveal {
        padding: 20px;
    }
}
