/* Bias Spotter Challenge Styles */

/* ========================================
   Quiz Layout
======================================== */

.quiz-section {
    padding: 4rem 0;
    background-color: #f9fafb;
}

.quiz-container {
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.quiz-screen {
    display: none;
    padding: 3rem;
    min-height: 500px;
}

.quiz-screen.active {
    display: block;
}

/* ========================================
   Welcome Screen
======================================== */

.welcome-content {
    text-align: center;
}

.welcome-content h2 {
    color: #1e3a8a;
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.welcome-content p {
    font-size: 1.125rem;
    color: #6b7280;
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.difficulty-selector {
    margin-bottom: 3rem;
}

.difficulty-selector h3 {
    color: #1f2937;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.difficulty-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.difficulty-btn {
    background-color: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 2rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    text-align: center;
}

.difficulty-btn:hover {
    border-color: #f59e0b;
    background-color: #fffbeb;
}

.difficulty-btn.selected {
    border-color: #f59e0b;
    background-color: #fffbeb;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.difficulty-icon {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.difficulty-name {
    display: block;
    font-weight: 600;
    color: #1e3a8a;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.difficulty-desc {
    display: block;
    color: #6b7280;
    font-size: 0.9rem;
}

/* ========================================
   Quiz Screen
======================================== */

.quiz-header {
    margin-bottom: 2rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.quiz-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #6b7280;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

.question-container {
    margin-bottom: 2rem;
}

.scenario-card {
    background: linear-gradient(135deg, #fffbeb 0%, #fed7aa 100%);
    border: 1px solid #fed7aa;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.scenario-type {
    display: inline-block;
    background-color: #f59e0b;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.scenario-content {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #1f2937;
}

.question-text h3 {
    color: #1e3a8a;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.answer-options {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.answer-option {
    background-color: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    text-align: left;
    font-size: 1rem;
}

.answer-option:hover {
    border-color: #f59e0b;
    background-color: #fffbeb;
}

.answer-option.selected {
    border-color: #f59e0b;
    background-color: #fffbeb;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.answer-option.correct {
    border-color: #10b981;
    background-color: #f0fdf4;
}

.answer-option.incorrect {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.quiz-actions {
    text-align: center;
}

/* ========================================
   Feedback Panel
======================================== */

.feedback-panel {
    background-color: #f9fafb;
    border-top: 1px solid #e5e7eb;
    padding: 2rem;
    margin: 0 -3rem -3rem;
}

.feedback-result {
    text-align: center;
    margin-bottom: 1.5rem;
}

.feedback-correct {
    color: #10b981;
    font-weight: 600;
    font-size: 1.2rem;
}

.feedback-incorrect {
    color: #ef4444;
    font-weight: 600;
    font-size: 1.2rem;
}

.feedback-explanation {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid #e5e7eb;
    line-height: 1.6;
}

.feedback-explanation h4 {
    color: #1e3a8a;
    margin-bottom: 1rem;
    margin-top: 0;
}

.feedback-learn-more {
    text-align: center;
    margin-bottom: 2rem;
}

.feedback-learn-more a {
    color: #1e3a8a;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.feedback-learn-more a:hover {
    border-bottom-color: #1e3a8a;
}

/* ========================================
   Results Screen
======================================== */

.results-content {
    text-align: center;
}

.results-content h2 {
    color: #1e3a8a;
    font-size: 2rem;
    margin-bottom: 2rem;
}

.final-score {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.score-number {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.score-label {
    font-size: 1.2rem;
    opacity: 0.9;
}

.score-breakdown {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: left;
}

.score-breakdown h3 {
    color: #1e3a8a;
    margin-bottom: 1.5rem;
    text-align: center;
}

.category-scores {
    display: grid;
    gap: 1rem;
}

.category-score {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.category-score:last-child {
    border-bottom: none;
}

.category-name {
    font-weight: 500;
    color: #1f2937;
}

.category-result {
    font-weight: 600;
}

.category-result.good {
    color: #10b981;
}

.category-result.okay {
    color: #f59e0b;
}

.category-result.needs-work {
    color: #ef4444;
}

.improvement-suggestions {
    background-color: #fffbeb;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: left;
}

.improvement-suggestions h3 {
    color: #0c4a6e;
    margin-bottom: 1.5rem;
    text-align: center;
}

.suggestion-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.suggestion-list li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.suggestion-list li:before {
    content: "💡";
    position: absolute;
    left: 0;
    top: 0;
}

.suggestion-list a {
    color: #1e3a8a;
    text-decoration: none;
    font-weight: 500;
}

.suggestion-list a:hover {
    text-decoration: underline;
}

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

/* ========================================
   How It Works Section
======================================== */

.how-it-works {
    padding: 4rem 0;
    background-color: white;
}

.how-it-works h2 {
    text-align: center;
    color: #1e3a8a;
    margin-bottom: 3rem;
    font-size: 2rem;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.step-item {
    text-align: center;
    background-color: #f9fafb;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 1.5rem;
}

.step-item h3 {
    color: #1e3a8a;
    margin-bottom: 1rem;
}

.step-item p {
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
}

/* ========================================
   Responsive Design
======================================== */

@media (max-width: 768px) {
    .quiz-screen {
        padding: 2rem;
    }
    
    .difficulty-options {
        grid-template-columns: 1fr;
    }
    
    .difficulty-btn {
        padding: 1.5rem 1rem;
    }
    
    .scenario-card {
        padding: 1.5rem;
    }
    
    .feedback-panel {
        margin: 0 -2rem -2rem;
    }
    
    .results-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .results-actions .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .steps-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .quiz-container {
        margin: 0 1rem;
        border-radius: 12px;
    }
    
    .quiz-screen {
        padding: 1.5rem;
    }
    
    .scenario-card {
        padding: 1rem;
    }
    
    .score-number {
        font-size: 2.5rem;
    }
    
    .final-score {
        padding: 1.5rem;
    }
    
    .score-breakdown,
    .improvement-suggestions {
        padding: 1.5rem;
    }
}

/* ========================================
   Animation & Transitions
======================================== */

.quiz-screen {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.quiz-screen.active {
    opacity: 1;
    transform: translateY(0);
}

.answer-option {
    transform: scale(1);
    transition: all 0.2s ease;
}

.answer-option:hover {
    transform: scale(1.02);
}

.answer-option.selected {
    transform: scale(1.02);
}

.feedback-panel {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.feedback-panel.show {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   Accessibility
======================================== */

.quiz-container:focus-within {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.answer-option:focus {
    outline: 2px solid #f59e0b;
    outline-offset: 2px;
}

.difficulty-btn:focus {
    outline: 2px solid #f59e0b;
    outline-offset: 2px;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

button:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* ========================================
   Dark Theme Support
======================================== */

[data-theme="dark"] .quiz-section {
    background-color: var(--bg-primary, #0f172a);
}

[data-theme="dark"] .quiz-container {
    background-color: var(--bg-secondary, #1e293b);
    border: 1px solid var(--border-secondary, #475569);
}

[data-theme="dark"] .welcome-content h2 {
    color: var(--text-primary, #f1f5f9);
}

[data-theme="dark"] .welcome-content p {
    color: var(--text-secondary, #cbd5e1);
}

[data-theme="dark"] .question h3 {
    color: var(--text-primary, #f1f5f9);
}

[data-theme="dark"] .question-text {
    color: var(--text-secondary, #cbd5e1);
}

[data-theme="dark"] .option {
    background-color: var(--bg-tertiary, #334155);
    border: 2px solid var(--border-secondary, #475569);
    color: var(--text-primary, #f1f5f9);
}

[data-theme="dark"] .option:hover {
    background-color: var(--bg-secondary, #1e293b);
    border-color: var(--accent-primary, #3b82f6);
}

[data-theme="dark"] .option.selected {
    background-color: var(--accent-primary, #3b82f6);
    border-color: var(--accent-primary, #3b82f6);
    color: white;
}

[data-theme="dark"] .option.correct {
    background-color: var(--success-bg, #065f46);
    border-color: var(--success-border, #10b981);
    color: var(--success-text, #d1fae5);
}

[data-theme="dark"] .option.incorrect {
    background-color: var(--error-bg, #7f1d1d);
    border-color: var(--error-border, #ef4444);
    color: var(--error-text, #fecaca);
}

[data-theme="dark"] .feedback {
    background-color: var(--bg-tertiary, #334155);
    border: 1px solid var(--border-secondary, #475569);
}

[data-theme="dark"] .feedback h4 {
    color: var(--text-primary, #f1f5f9);
}

[data-theme="dark"] .feedback p {
    color: var(--text-secondary, #cbd5e1);
}

[data-theme="dark"] .explanation {
    background-color: var(--bg-secondary, #1e293b);
    border-left: 4px solid var(--accent-primary, #3b82f6);
}

[data-theme="dark"] .explanation strong {
    color: var(--text-primary, #f1f5f9);
}

[data-theme="dark"] .progress-bar {
    background-color: var(--bg-tertiary, #334155);
}

[data-theme="dark"] .progress-fill {
    background-color: var(--accent-primary, #3b82f6);
}

[data-theme="dark"] .quiz-navigation {
    border-top: 1px solid var(--border-secondary, #475569);
}

[data-theme="dark"] .nav-btn {
    background-color: var(--accent-primary, #3b82f6);
    color: white;
}

[data-theme="dark"] .nav-btn:hover {
    background-color: var(--accent-secondary, #2563eb);
}

[data-theme="dark"] .nav-btn:disabled {
    background-color: var(--bg-tertiary, #334155);
    color: var(--text-secondary, #cbd5e1);
}

[data-theme="dark"] .results-screen h2 {
    color: var(--text-primary, #f1f5f9);
}

[data-theme="dark"] .score-display {
    background-color: var(--bg-tertiary, #334155);
    border: 2px solid var(--border-secondary, #475569);
}

[data-theme="dark"] .score-number {
    color: var(--accent-primary, #3b82f6);
}

[data-theme="dark"] .score-description {
    color: var(--text-secondary, #cbd5e1);
}

[data-theme="dark"] .performance-breakdown {
    background-color: var(--bg-tertiary, #334155);
    border: 1px solid var(--border-secondary, #475569);
}

[data-theme="dark"] .performance-item {
    border-bottom: 1px solid var(--border-secondary, #475569);
}

[data-theme="dark"] .performance-category {
    color: var(--text-primary, #f1f5f9);
}

[data-theme="dark"] .performance-score {
    color: var(--text-secondary, #cbd5e1);
}

[data-theme="dark"] .restart-btn {
    background-color: var(--accent-primary, #3b82f6);
    color: white;
}

[data-theme="dark"] .restart-btn:hover {
    background-color: var(--accent-secondary, #2563eb);
}