:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #151520;
    --bg-tertiary: #1f1f2e;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-tertiary: #ec4899;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --border: #334155;
    --shadow: rgba(0, 0, 0, 0.5);
    --gradient-1: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    --gradient-2: linear-gradient(135deg, var(--accent-secondary), var(--accent-tertiary));
    --gradient-3: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary));
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.2) 0%, transparent 50%);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 0.4rem;
}

.title {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.1rem;
    text-shadow: 0 0 30px rgba(99, 102, 241, 0.5);
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 300;
}

.screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.hidden {
    display: none !important;
}

/* Start Screen */
.welcome-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    max-width: 600px;
    box-shadow: 0 20px 40px var(--shadow);
    backdrop-filter: blur(10px);
}

.welcome-box h2 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.welcome-box p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.icon {
    font-size: 1.5rem;
}

/* Buttons */
.btn {
    background: var(--gradient-1);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

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

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

.btn-secondary {
    background: var(--gradient-2);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn-secondary:hover {
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.6);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Quiz Screen */
#quiz-screen {
    justify-content: flex-start;
    padding-top: 2rem;
}

.quiz-header {
    width: 100%;
    max-width: 800px;
    margin-bottom: 3rem;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-1);
    transition: width 0.5s ease;
    border-radius: 4px;
}

#question-counter {
    color: var(--text-secondary);
    font-weight: 600;
    min-width: 80px;
}

.stats {
    display: flex;
    gap: 2rem;
    justify-content: center;
}

.stat {
    text-align: center;
}

.stat-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

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

/* Question Container */
.question-container {
    width: 100%;
    max-width: 800px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 20px 40px var(--shadow);
}

.difficulty-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

#difficulty-level {
    padding: 0.5rem 1rem;
    background: var(--gradient-3);
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.stars {
    display: flex;
    gap: 0.25rem;
}

.star {
    color: #fbbf24;
    font-size: 1.2rem;
}

.star.empty {
    color: var(--text-muted);
}

.question {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2rem;
    line-height: 1.5;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.option {
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    color: var(--text-primary);
}

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

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

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

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

.option:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Feedback Section */
.feedback-section {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    animation: slideDown 0.3s ease;
}

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

.feedback-result {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.feedback-result.correct {
    color: var(--success);
}

.feedback-result.incorrect {
    color: var(--error);
}

.feedback-explanation {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.feedback-reference {
    background: var(--bg-tertiary);
    border-left: 4px solid var(--accent-primary);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.feedback-reference a {
    color: var(--accent-primary);
    text-decoration: none;
}

.feedback-reference a:hover {
    text-decoration: underline;
}

/* Results Screen */
.results-container {
    text-align: center;
    max-width: 800px;
    width: 100%;
}

.results-container h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.final-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 2rem 1rem;
    box-shadow: 0 10px 20px var(--shadow);
}

.stat-card .stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.stat-card .stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.performance-message {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
}

#performance-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

#performance-description {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.share-url {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.share-url p {
    color: var(--text-secondary);
    margin: 0;
}

.share-url input {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    color: var(--text-primary);
    font-family: monospace;
    font-size: 0.9rem;
    min-width: 200px;
}

.share-url input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: auto;
}

footer a {
    color: var(--accent-primary);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .welcome-box {
        padding: 2rem;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    .question-container {
        padding: 1.5rem;
    }
    
    .stats {
        gap: 1rem;
    }
    
    .final-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .actions {
        flex-direction: column;
    }
    
    .share-url {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    .final-stats {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        padding: 1.5rem;
    }
}
