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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --dark: #1f2937;
    --light: #f8fafc;
    --border: #e5e7eb;
    --text: #374151;
    --text-light: #6b7280;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.mode-toggle {
    display: flex;
    background: var(--light);
    border-radius: 50px;
    padding: 4px;
    gap: 4px;
}

.mode-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 50px;
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.main-content {
    padding: 2rem 0;
}

.app-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.stats-dashboard {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2rem;
}

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

.stat-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

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

.progress-section {
    padding: 1.5rem 2rem;
    background: var(--light);
    border-bottom: 1px solid var(--border);
}

.progress-bar-container {
    background: #e5e7eb;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-bar {
    background: linear-gradient(90deg, var(--success), var(--info));
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 6px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-light);
}

.content-area {
    padding: 2rem;
}

.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 12px 24px;
    border: 2px solid var(--border);
    background: white;
    color: var(--text);
    border-radius: 50px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.question-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border);
    margin-bottom: 2rem;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.question-number {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 12px 20px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
}

.question-type-badge {
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: capitalize;
}

.question-type-badge.intérieure {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
}

.question-type-badge.extérieure {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.question-section {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    border-radius: 16px;
    border-left: 4px solid;
}

.question-section.verification {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    border-left-color: var(--text);
}

.question-section.securite {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-left-color: var(--warning);
}

.question-section.secours {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border-left-color: var(--danger);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.question-text {
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

.answer {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    padding: 1rem;
    border-radius: 12px;
    border-left: 4px solid var(--success);
    font-weight: 500;
}

.answer.hidden {
    display: none;
}

.reveal-answer-btn {
    background: linear-gradient(135deg, var(--info), #2563eb);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 1rem;
}

.reveal-answer-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.hide-answer-btn {
    background: linear-gradient(135deg, var(--text-light), #4b5563);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.hide-answer-btn:hover {
    background: linear-gradient(135deg, #4b5563, #374151);
}

.practical-tip {
    background: linear-gradient(135deg, #e0f2fe, #b3e5fc);
    color: #01579b;
    padding: 1rem;
    border-radius: 12px;
    margin-top: 1rem;
    border-left: 4px solid var(--info);
}

.practical-tip .tip-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quiz-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    text-align: center;
}

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

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

.quiz-option {
    padding: 1rem 1.5rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

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

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

.quiz-option.correct {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.quiz-option.incorrect {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    background: var(--light);
    border-top: 1px solid var(--border);
}

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

.nav-btn.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.nav-btn.secondary {
    background: var(--text-light);
    color: white;
}

.nav-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.quiz-results {
    text-align: center;
    padding: 2rem;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 auto 1.5rem;
}

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

.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pulse {
    animation: pulse 2s infinite;
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }

    .content-area {
        padding: 1rem;
    }

    .question-header {
        flex-direction: column;
        text-align: center;
    }

    .navigation {
        flex-direction: column;
        gap: 1rem;
    }
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
