/* eCours.org - Style principal avec Mode Sombre Pro */

/* ========================================
   VARIABLES CSS ÉTENDUES POUR DARK MODE
   ======================================== */
:root {
    /* Couleurs principales */
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --critical-color: #dc2626;
    
    /* Mode clair (défaut) */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Mode sombre automatique selon préférences système */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --text-light: #64748b;
        
        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
        --bg-tertiary: #334155;
        
        --border-color: #475569;
        --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
        --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.2);
        --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.2);
    }
}

/* Mode sombre forcé via toggle */
[data-theme="dark"] {
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-light: #64748b;
    
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    
    --border-color: #475569;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.2);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.2);
}

/* Mode clair forcé */
[data-theme="light"] {
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Optimisations performance */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
}

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

/* Header & Navigation */
.main-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
}

.navbar {
    padding: 1rem 0;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
}

.brand-icon {
    font-size: 1.5rem;
}

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

.brand-tagline {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.2s;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s;
}

/* Focus visible pour accessibilité */
:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Global Alert */
.global-alert {
    background: linear-gradient(135deg, var(--danger-color), var(--critical-color));
    color: white;
    padding: 0.75rem 0;
}

/* Mode sombre spécifique pour l'alerte */
@media (prefers-color-scheme: dark) {
    .global-alert {
        background: linear-gradient(135deg, #991b1b, #7f1d1d);
    }
}

[data-theme="dark"] .global-alert {
    background: linear-gradient(135deg, #991b1b, #7f1d1d);
}

.alert-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.alert-icon {
    font-size: 1.2rem;
}

.alert-text {
    font-weight: 500;
}

.alert-cta {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: background 0.2s;
}

.alert-cta:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    padding: 4rem 0;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.highlight {
    color: var(--primary-color);
    position: relative;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
    max-width: 65ch;
    margin-left: auto;
    margin-right: auto;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    border: 2px solid transparent;
}

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

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* Stats Section */
.stats-section {
    padding: 4rem 0;
}

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

.stat-card {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border-color);
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card.critical {
    border-left-color: var(--critical-color);
}

.stat-card.warning {
    border-left-color: var(--warning-color);
}

.stat-card.danger {
    border-left-color: var(--danger-color);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.stat-context {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Countries Section */
.countries-preview {
    background: var(--bg-secondary);
    padding: 4rem 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
}

.section-description {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-size: 1.1rem;
    max-width: 65ch;
    margin-left: auto;
    margin-right: auto;
}

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

.country-card {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border-color);
}

.country-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.country-flag {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.country-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.country-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.country-status.democracy .status-dot {
    background: var(--success-color);
}

.country-status.imperfect .status-dot {
    background: var(--warning-color);
}

.country-status.authoritarian .status-dot {
    background: var(--danger-color);
}

/* Amélioration contraste mode sombre */
@media (prefers-color-scheme: dark) {
    .country-status.democracy .status-dot {
        background: #22c55e;
    }
    .country-status.imperfect .status-dot {
        background: #fbbf24;
    }
    .country-status.authoritarian .status-dot {
        background: #f87171;
    }
}

[data-theme="dark"] .country-status.democracy .status-dot {
    background: #22c55e;
}
[data-theme="dark"] .country-status.imperfect .status-dot {
    background: #fbbf24;
}
[data-theme="dark"] .country-status.authoritarian .status-dot {
    background: #f87171;
}

.country-detail {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.country-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.country-link:hover {
    text-decoration: underline;
}

.section-cta {
    text-align: center;
}

/* Key Question */
.key-question {
    background: linear-gradient(135deg, var(--primary-color), #1e40af);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

/* Mode sombre pour la section question */
@media (prefers-color-scheme: dark) {
    .key-question {
        background: linear-gradient(135deg, #1e40af, #1e3a8a);
    }
}

[data-theme="dark"] .key-question {
    background: linear-gradient(135deg, #1e40af, #1e3a8a);
}

.question-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.question-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

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

/* Sources Preview */
.sources-preview {
    padding: 4rem 0;
}

.sources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.source-card {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.source-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.source-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.source-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.source-desc {
    color: var(--text-secondary);
    line-height: 1.5;
}

.transparency-note {
    background: var(--bg-tertiary);
    padding: 2rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.transparency-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.transparency-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.transparency-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.transparency-link:hover {
    text-decoration: underline;
}

/* BOUTON TOGGLE MODE SOMBRE */
.theme-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    z-index: 1000;
}

.theme-toggle:hover {
    transform: scale(1.1);
    background: #1d4ed8;
}

.theme-toggle:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.5);
    outline-offset: 2px;
}

.theme-toggle .sun-icon {
    display: none;
}

.theme-toggle .moon-icon {
    display: block;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: block;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: none;
}

/* Footer */
.main-footer {
    background: var(--text-primary);
    color: white;
    padding: 3rem 0 1rem;
}

/* Mode sombre pour footer */
@media (prefers-color-scheme: dark) {
    .main-footer {
        background: #020617;
        border-top: 1px solid var(--border-color);
    }
}

[data-theme="dark"] .main-footer {
    background: #020617;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.footer-description {
    color: #94a3b8;
    line-height: 1.5;
}

.footer-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

.update-info {
    color: #94a3b8;
}

.update-date {
    color: var(--success-color);
    font-weight: 500;
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 2rem;
    text-align: center;
    color: #94a3b8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        flex-direction: column;
        gap: 0;
        padding: 1rem;
        box-shadow: var(--shadow-lg);
        border-top: 1px solid var(--border-color);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        z-index: 1000;
    }
    
    .nav-item {
        width: 100%;
    }
    
    .nav-link {
        display: block;
        padding: 1rem 0;
        text-align: center;
        border-bottom: 1px solid var(--border-color);
        border-bottom-style: solid;
        border-bottom-width: 1px;
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .mobile-menu-toggle:focus-visible {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-description {
        font-size: 1.1rem;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .countries-grid {
        grid-template-columns: 1fr;
    }
    
    .question-title {
        font-size: 1.75rem;
    }
    
    .question-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .transparency-note {
        flex-direction: column;
        text-align: center;
    }
    
    .sources-grid {
        grid-template-columns: 1fr;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .brand-tagline {
        display: none;
    }
    
    .theme-toggle {
        bottom: 1rem;
        right: 1rem;
        width: 3rem;
        height: 3rem;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .stats-section,
    .countries-preview,
    .sources-preview {
        padding: 2rem 0;
    }
    
    .stat-card,
    .country-card,
    .source-card {
        padding: 1.5rem;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    .country-flag {
        font-size: 2rem;
    }
    
    .source-icon {
        font-size: 2rem;
    }
    
    .question-title {
        font-size: 1.5rem;
    }
    
    .question-subtitle {
        font-size: 1.1rem;
    }
    
    .alert-content {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .alert-text {
        text-align: center;
        font-size: 0.9rem;
    }
}

/* Très petits écrans */
@media (max-width: 320px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .stats-grid,
    .countries-grid,
    .sources-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* Animations et transitions */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content > * {
    animation: fadeInUp 0.6s ease-out;
}

.hero-title {
    animation-delay: 0.1s;
}

.hero-description {
    animation-delay: 0.2s;
}

.hero-actions {
    animation-delay: 0.3s;
}

/* Skip link pour navigation clavier */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* Améliorations pour l'impression */
@media print {
    .main-header,
    .global-alert,
    .hero-actions,
    .question-actions,
    .main-footer,
    .theme-toggle {
        display: none;
    }
    
    .hero {
        background: none;
        padding: 1rem 0;
    }
    
    .hero-title,
    .section-title {
        color: black;
    }
    
    .stat-card,
    .country-card,
    .source-card {
        border: 1px solid #ccc;
        break-inside: avoid;
        box-shadow: none;
        margin-bottom: 1rem;
    }
    
    a::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}

/* Classes utilitaires */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

.hidden { display: none; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* CSS supplémentaire pour les pages détaillées */

/* Breadcrumb */
.breadcrumb {
    background: var(--bg-tertiary);
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.breadcrumb-list {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    align-items: center;
}

.breadcrumb-list li::after {
    content: "→";
    margin-left: 0.5rem;
    color: var(--text-light);
}

.breadcrumb-list li:last-child::after {
    display: none;
}

.breadcrumb-list a {
    color: var(--primary-color);
    text-decoration: none;
}

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

/* Page Header */
.page-header {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    padding: 3rem 0;
    text-align: center;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.page-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Global Stats détaillées */
.global-stats {
    padding: 4rem 0;
}

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

.detailed-stat-card {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid;
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.detailed-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.detailed-stat-card.critical {
    border-left-color: var(--critical-color);
}

.detailed-stat-card.warning {
    border-left-color: var(--warning-color);
}

.detailed-stat-card.danger {
    border-left-color: var(--danger-color);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.stat-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.stat-trend {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.stat-trend.up {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.stat-trend.down {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.stat-main {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.stat-number-large {
    font-size: 4rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-context p {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.stat-detail {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Democracy Comparison */
.democracy-comparison {
    background: var(--bg-secondary);
    padding: 4rem 0;
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.comparison-card {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    border-top: 4px solid;
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.comparison-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.comparison-card.democracy {
    border-top-color: var(--success-color);
}

.comparison-card.dictatorship {
    border-top-color: var(--danger-color);
}

.comparison-header {
    text-align: center;
    margin-bottom: 2rem;
}

.comparison-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.comparison-subtitle {
    color: var(--text-secondary);
    font-weight: 500;
}

.comparison-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.comparison-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.comparison-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.comparison-item h4 {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.comparison-item p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* FAQ Styles */
.faq-categories {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.faq-category-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-secondary);
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.faq-category-btn.active,
.faq-category-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.faq-item {
    background: var(--bg-primary);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: 1.5rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: background-color 0.2s;
}

.faq-question:hover {
    background: var(--bg-tertiary);
}

.faq-icon {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    transition: transform 0.2s;
}

.faq-item.open .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-answer div {
    padding: 0 1.5rem 1.5rem 1.5rem;
}

.faq-answer p {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Sources Styles */
.sources-grid.detailed {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.source-detailed-card {
    background: var(--bg-primary);
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.source-detailed-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.source-detailed-card.primary {
    border-left: 4px solid var(--primary-color);
}

.source-header {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.source-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.source-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.source-badge.main {
    background: var(--primary-color);
    color: white;
}

.source-content {
    padding: 1.5rem;
}

/* Contact Section */
.contact-section {
    padding: 4rem 0;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 3rem;
}

.contact-method {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 0.5rem;
}

.contact-icon {
    font-size: 1.5rem;
}

.contact-method h4 {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.contact-method a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.contact-method a:hover {
    text-decoration: underline;
}

/* Responsive pour les pages détaillées */
@media (max-width: 768px) {
    .page-title {
        font-size: 2rem;
    }
    
    .stats-detailed-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-main {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .stat-number-large {
        font-size: 3rem;
    }
    
    .comparison-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .faq-categories {
        flex-direction: column;
        align-items: center;
    }
    
    .faq-category-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .sources-grid.detailed {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 2rem 0;
    }
    
    .global-stats,
    .democracy-comparison,
    .contact-section {
        padding: 2rem 0;
    }
    
    .detailed-stat-card,
    .comparison-card,
    .source-detailed-card {
        padding: 1.5rem;
    }
    
    .stat-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .comparison-item {
        gap: 0.75rem;
    }
    
    .comparison-icon {
        font-size: 1.25rem;
    }
    
    .contact-method {
        padding: 0.75rem;
    }
    
    .faq-question {
        padding: 1rem;
        font-size: 1rem;
    }
    
    .faq-answer div {
        padding: 0 1rem 1rem 1rem;
    }
}