:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #10b981;
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background: radial-gradient(circle at top left, #1e293b, #0f172a);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-x: hidden;
}

header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.8s ease-out;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.025em;
    margin-bottom: 8px;
}

p.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.mode-selector {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 20px 0;
}

.mode-btn {
    padding: 8px 16px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mode-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.container {
    width: 100%;
    max-width: 800px;
    position: relative;
    z-index: 1;
}

/* Glass Card */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.chapter-badge {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.progress-text {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Question Section */
.question-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-bottom: 30px;
}

.question-text {
    font-size: 1.5rem;
    line-height: 1.5;
    font-weight: 600;
    margin-bottom: 24px;
    animation: fadeIn 0.5s ease-out;
}

.answer-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
    display: none;
    animation: slideUp 0.4s ease-out;
}

.answer-section.visible {
    display: block;
}

.answer-label {
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.1em;
    margin-bottom: 12px;
    display: block;
}

.answer-text {
    font-size: 1.125rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Buttons */
.controls {
    display: flex;
    gap: 16px;
    margin-top: auto;
}

.btn {
    padding: 12px 24px;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    flex: 2;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    flex: 1;
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
}

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

/* Progress Bar */
.progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 4px;
    background: var(--primary);
    width: 0%;
    transition: width 0.4s ease;
    border-radius: 2px;
}

/* Navigation Overlay */
.nav-overlay {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 100;
}

.nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}

.nav-btn:hover {
    background: var(--primary);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 640px) {
    .card {
        padding: 24px;
        min-height: 450px;
    }

    h1 {
        font-size: 1.75rem;
    }

    .question-text {
        font-size: 1.25rem;
    }

    .controls {
        flex-direction: column;
    }
}