/* ============================================
   STYLE PÉDAGOGIQUE POUR EBOOK FLUTTER & DART
   ============================================ */

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.8;
    color: #2c3e50;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Style spécifique pour la page d'accueil */
body:has(.home-container) {
    background: #f8f9fa;
}

/* Style pour les pages de chapitre - background cohérent avec la page d'accueil */
body:has(.chapter-nav) {
    background: #f8f9fa;
    background-attachment: fixed;
}

/* === CONTAINER PRINCIPAL === */
.container {
   
    margin: 0 auto;
    background: white;
    
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

/* === HEADER === */
.header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.06) 100%);
    color: #2c3e50;
    padding: 50px 40px;
    text-align: center;
    position: relative;
    border-bottom: 1px solid rgba(102, 126, 234, 0.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(102, 126, 234, 0.25) 20%, 
        rgba(102, 126, 234, 0.35) 50%, 
        rgba(118, 75, 162, 0.25) 80%, 
        transparent 100%);
    opacity: 0.8;
}

.chapter-number {
    font-size: 12px;
    letter-spacing: 3px;
    color: #667eea;
    margin-bottom: 12px;
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0.85;
    position: relative;
    display: inline-block;
    padding: 6px 16px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.chapter-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #667eea;
    line-height: 1.2;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    /* Fallback pour les navigateurs qui ne supportent pas background-clip: text */
    @supports not (background-clip: text) {
        color: #667eea;
    }
}

.chapter-subtitle {
    font-size: 17px;
    color: #5a6c7d;
    font-weight: 400;
    line-height: 1.5;
    max-width: 700px;
    margin: 0 auto;
    opacity: 0.9;
}

/* === CONTENU === */
.content {
    padding: 50px;
    max-width: 1000px;
    margin: 0 auto;
    min-height: calc(100vh - 340px);
}

/* === TYPOGRAPHIE === */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
}

h2 {
    color: #667eea;
    font-size: 24px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
    padding-left: 15px;
}

h3 {
    color: #764ba2;
    font-size: 20px;
    margin-top: 25px;
    margin-bottom: 15px;
}

p {
    margin-bottom: 15px;
    text-align: justify;
    font-size: 16px;
}

ul, ol {
    margin: 15px 0;
    padding-left: 25px;
}

li {
    margin-bottom: 10px;
    line-height: 1.6;
}

h4 {
    color: #667eea;
    font-size: 18px;
    margin-top: 12px;
    margin-bottom: 10px;
}

/* Code inline (sans Prism) */
code:not([class*="language-"]) {
    background: #f5f5f5;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Fira Code', 'Consolas', 'Courier New', monospace;
    color: #e83e8c;
    font-size: 0.9em;
    border: 1px solid #e0e0e0;
}

/* === INTRODUCTION === */
.intro {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    font-style: italic;
    border-left: 5px solid #667eea;
}

/* === ENCADRÉS PÉDAGOGIQUES === */
.box {
    margin: 25px 0;
    padding: 20px;
    border-radius: 12px;
    border-left: 5px solid;
}

/* Astuce (vert) */
.astuce {
    background: #e8f5e9;
    border-color: #4caf50;
}

.astuce::before {
    content: "💡 Astuce";
    display: block;
    font-weight: bold;
    color: #4caf50;
    margin-bottom: 10px;
    font-size: 18px;
}

/* Attention (orange) */
.attention {
    background: #fff3e0;
    border-color: #ff9800;
}

.attention::before {
    content: "⚠️ Attention";
    display: block;
    font-weight: bold;
    color: #ff9800;
    margin-bottom: 10px;
    font-size: 18px;
}

/* Exemple (bleu) */
.exemple {
    background: #e3f2fd;
    border-color: #2196f3;
}

.exemple::before {
    content: "📋 Exemple";
    display: block;
    font-weight: bold;
    color: #2196f3;
    margin-bottom: 10px;
    font-size: 18px;
}

/* === FIGURES === */
.figure {
    background: #f8f9fa;
    padding: 15px;
    margin: 35px 0;
    border-radius: 15px;
    text-align: center;
    color: #555;
    font-style: italic;
    border: 3px solid #dee2e6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    position: relative;
}



.figure-description {
    background: white;
    padding: 20px;
    border-radius: 8px;
    line-height: 1.8;
    font-size: 15px;
    border-left: 4px solid #6c757d;
    margin-top: 15px;
}

/* === RÉSUMÉ === */
.summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin-top: 40px;
}

.summary h3 {
    color: white;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 22px;
}

.summary p {
    margin-bottom: 10px;
}

/* === TIMELINE === */
.timeline {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin: 25px 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.timeline-item {
    padding: 15px 0;
    border-left: 3px solid #667eea;
    padding-left: 20px;
    margin-left: 10px;
}

.timeline-year {
    font-weight: bold;
    color: #667eea;
    font-size: 18px;
}

/* === GRILLE AVANTAGES/LIMITES === */
.pros-cons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin: 30px 0;
}

.pros-section {
    background: #e8f5e9;
    padding: 25px;
    border-radius: 12px;
    border: 3px solid #4caf50;
}

.pros-section h3 {
    color: #2e7d32;
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cons-section {
    background: #ffebee;
    padding: 25px;
    border-radius: 12px;
    border: 3px solid #f44336;
}

.cons-section h3 {
    color: #c62828;
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.advantage-item, .limit-item {
    background: white;
    padding: 15px;
    margin: 15px 0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.advantage-item strong, .limit-item strong {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
}

/* === TABLEAU COMPARATIF === */
.comparison-table {
    background: white;
    border-radius: 12px;
   
    margin: 25px 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.comparison-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 10px;
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    align-items: center;
    font-size: 14px;
}

.comparison-row:first-child {
    background: #f8f9fa;
    font-weight: bold;
    border-radius: 8px;
    padding: 10px;
    font-size: 15px;
}

.comparison-row:last-child {
    border-bottom: none;
}

.check {
    color: #4caf50;
    font-size: 18px;
    text-align: center;
}

.cross {
    color: #f44336;
    font-size: 18px;
    text-align: center;
}

.partial {
    color: #ff9800;
    font-size: 18px;
    text-align: center;
}

/* === FOOTER === */
.footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* === ANIMATIONS === */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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



/* ============================================
   SECTION ABOUT
   ============================================ */
.about-section {
    padding: 60px 20px;
    background: #ffffff;
    margin-top: 0;
    position: relative;
    overflow: hidden;
}

.about-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        url('data:image/svg+xml,<svg width="60" height="60" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="dots" x="0" y="0" width="60" height="60" patternUnits="userSpaceOnUse"><circle cx="30" cy="30" r="1.5" fill="rgba(118,75,162,0.08)"/></pattern></defs><rect width="100%" height="100%" fill="url(%23dots)"/></svg>'),
        radial-gradient(circle at 20% 30%, rgba(118, 75, 162, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(118, 75, 162, 0.03) 0%, transparent 50%);
    opacity: 1;
    pointer-events: none;
}

.about-section::after {
    content: '';
    position: absolute;
    top: -200px;
    right: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(118, 75, 162, 0.04) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: floatCircle 20s ease-in-out infinite;
}

@keyframes floatCircle {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(-50px, 50px) scale(1.2);
    }
}

.about-content {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    padding: 0 10px;
}

.about-title {
    text-align: center;
    font-size: 48px;
    font-weight: 800;
    color: #2c3e50;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
    line-height: 1.2;
}

.about-subtitle {
    text-align: center;
    font-size: 18px;
    color: #666;
    max-width: 700px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.about-item {
    text-align: center;
    padding: 25px 20px;
    border-radius: 20px;
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(102, 126, 234, 0.1);
    position: relative;
    overflow: hidden;
}

.about-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.about-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
}

.about-item:hover::before {
    transform: scaleX(1);
}

.about-icon-wrapper {
    width: 70px;
    height: 70px;
    margin: 0 auto 15px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s ease;
    position: relative;
}

.about-item:hover .about-icon-wrapper {
    transform: scale(1.1) rotate(5deg);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.about-icon {
    font-size: 42px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    transition: transform 0.4s ease;
}

.about-item:hover .about-icon {
    transform: scale(1.1);
}

.about-item h3 {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 12px;
    transition: color 0.3s ease;
}

.about-item:hover h3 {
    color: #667eea;
}

.about-item p {
    color: #666;
    line-height: 1.6;
    font-size: 14px;
    margin: 0;
}

@media (max-width: 768px) {
    .about-section {
        padding: 40px 15px;
    }
    
    .about-content {
        padding: 0 5px;
    }
    
    .about-title {
        font-size: 32px;
        margin-bottom: 10px;
    }
    
    .about-subtitle {
        font-size: 15px;
        margin-bottom: 30px;
    }
    
    .about-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .about-item {
        padding: 20px 15px;
    }
    
    .about-icon-wrapper {
        width: 60px;
        height: 60px;
        margin-bottom: 12px;
    }
    
    .about-icon {
        font-size: 32px;
    }
    
    .about-item h3 {
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    .about-item p {
        font-size: 13px;
        line-height: 1.5;
    }
}

@media (max-width: 600px) {
    .about-grid {
        grid-template-columns: 1fr;
    }
    
    .section-title {
        font-size: 32px;
    }
    
    .section-description {
        font-size: 16px;
    }
    
    .domains-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .domain-card {
        padding: 25px;
    }
    
    .chapter-nav {
        padding: 10px;
    }

    .nav-list {
        flex-direction: column;
    }

    .nav-group {
        margin-bottom: 8px;
    }
}

/* === UTILITAIRES === */
.text-center {
    text-align: center;
}

.text-italic {
    font-style: italic;
}

.text-muted {
    color: #666;
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

/* ============================================
   HEADER GLOBAL (Menu horizontal)
   ============================================ */
.site-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    margin-bottom: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Hide header in fullscreen mode by default */
body.fullscreen-mode .site-header {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

/* Show header when mouse is near top in fullscreen */
body.fullscreen-mode .site-header.header-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* Switch sidebar to mobile mode in fullscreen */
body.fullscreen-mode .chapter-nav {
    position: fixed;
    left: -300px; /* Hidden by default */
    transition: left 0.3s ease;
    z-index: 1001;
}

body.fullscreen-mode .chapter-nav.mobile-open {
    left: 0;
}

/* Show toggle button in fullscreen */
body.fullscreen-mode .chapter-nav-toggle {
    display: block !important;
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1002;
    background: #fff;
    box-shadow: 0 4px 20px 0 #e9edfb, 0 1.5px 6px rgba(102,126,234,0.10);
    border: 1px solid #e3e8f0;
    border-radius: 50vh;
    width: 48px;
    height: 48px;
    padding: 0;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    color: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.fullscreen-mode .chapter-nav-toggle:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    box-shadow: 
        0 6px 25px rgba(102, 126, 234, 0.5),
        0 4px 12px rgba(0,0,0,0.2);
    transform: translateY(-3px) scale(1.05);
}

body.fullscreen-mode .chapter-nav-toggle:active {
    transform: translateY(-1px) scale(0.98);
}

/* Hide toggle when sidebar is open in fullscreen */
body.fullscreen-mode:has(.chapter-nav.mobile-open) .chapter-nav-toggle {
    display: none !important;
}

/* Adjust container and footer margins in fullscreen */
body.fullscreen-mode:has(.chapter-nav) .container {
    margin-left: 0;
    width: 100%;
}

body.fullscreen-mode:has(.chapter-nav) .site-footer {
    margin-left: 0;
    width: 100%;
}

body:has(.home-container) .site-header {
    margin-bottom: 0;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 8px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 50px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    position: relative;
}

.header-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(102, 126, 234, 0.2) 20%, 
        rgba(102, 126, 234, 0.3) 50%, 
        rgba(102, 126, 234, 0.2) 80%, 
        transparent 100%);
    opacity: 0.6;
}

.logo a {
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo a:hover {
    color: #764ba2;
}

.main-nav {
    display: flex;
    align-items: center;
    position: relative;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    margin: 0;
}

.nav-domain {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.nav-domain:hover {
    background: #f5f7fa;
    color: #667eea;
}

.nav-domain.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    position: relative;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: #667eea;
    border-radius: 2px;
    transition: all 0.3s ease;
    display: block;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Fullscreen Toggle Button */
.fullscreen-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-right: 10px;
    color: #667eea;
    transition: all 0.3s ease;
    border-radius: 6px;
    width: 36px;
    height: 36px;
}

.fullscreen-toggle:hover {
    background: #f5f7fa;
    color: #764ba2;
    transform: scale(1.1);
}

.fullscreen-toggle:active {
    transform: scale(0.95);
}

.fullscreen-toggle svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    transition: all 0.3s ease;
}

.fullscreen-toggle.fullscreen-active .fullscreen-icon {
    display: none;
}

.fullscreen-toggle.fullscreen-active .fullscreen-exit-icon {
    display: block !important;
}

/* Footer global */
.site-footer {
    background: #2c3e50;
    padding: 0 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
   
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
    z-index: 1;
}

body:has(.home-container) .site-footer {
    margin-top: 0;
    background: #2c3e50;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.footer-container p {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
}

.footer-separator {
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
}

/* ============================================
   PAGE D'ACCUEIL
   ============================================ */
.home-container {
    
    margin: 0 auto;
    padding: 0;
    background: transparent;
}

.hero-section {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #667eea 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
    padding: 120px 20px 100px;
    margin-bottom: 80px;
    overflow: hidden;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.03)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 50px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    letter-spacing: 1px;
    text-transform: uppercase;
    animation: fadeInDown 0.8s ease;
}

.hero-title {
    margin-bottom: 25px;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-title-main {
    display: block;
    font-size: 64px;
    font-weight: 900;
    color: white;
    margin-bottom: 15px;
    letter-spacing: -2px;
    line-height: 1.1;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.hero-title-accent {
    display: block;
    font-size: 28px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 1px;
    margin-top: 10px;
}

.hero-subtitle {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 45px;
    line-height: 1.8;
    font-weight: 300;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 0.8s ease 0.4s both;
}

.hero-cta {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease 0.6s both;
}

.btn-hero-primary {
    display: inline-block;
    background: white;
    color: #667eea;
    font-size: 16px;
    font-weight: 700;
    padding: 16px 40px;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
}

.btn-hero-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
    background: #f8f9fa;
}

.btn-hero-secondary {
    display: inline-block;
    background: transparent;
    color: white;
    font-size: 16px;
    font-weight: 600;
    padding: 16px 40px;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    letter-spacing: 0.5px;
}

.btn-hero-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-3px);
}

.hero-decoration {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.decoration-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    animation: float 20s ease-in-out infinite;
}

.circle-1 {
    width: 300px;
    height: 300px;
    top: -100px;
    right: -50px;
    animation-delay: 0s;
}

.circle-2 {
    width: 200px;
    height: 200px;
    bottom: -50px;
    left: 10%;
    animation-delay: 5s;
}

.circle-3 {
    width: 150px;
    height: 150px;
    top: 50%;
    right: 15%;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

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

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

.domains-section {
    padding: 0 20px 80px;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-size: 42px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-description {
    font-size: 18px;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
    text-align: center;
}

.domains-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.domain-card {
    background: white;
    border-radius: 20px;
    padding: 35px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.domain-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.domain-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.3);
}

.domain-card:hover::before {
    transform: scaleX(1);
}

.domain-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.domain-icon {
    font-size: 56px;
    line-height: 1;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
    transition: transform 0.3s ease;
}

.domain-card:hover .domain-icon {
    transform: scale(1.1) rotate(5deg);
}

.domain-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.domain-title {
    color: #2c3e50;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.2;
}

.domain-description {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.7;
    font-size: 15px;
}

.domain-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 25px;
}

.feature-tag {
    background: #f5f7fa;
    color: #667eea;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
}

.domain-card:hover .feature-tag {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
}

.domain-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    padding: 12px 0;
}

.domain-link svg {
    transition: transform 0.3s ease;
}

.domain-link:hover {
    color: #764ba2;
    gap: 12px;
}

.domain-link:hover svg {
    transform: translateX(4px);
}

.domain-link span {
    position: relative;
}

.domain-link span::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

.domain-link:hover span::after {
    width: 100%;
}

.chapters-list {
    display: grid;
    gap: 30px;
    margin-top: 30px;
}

.chapter-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-left: 4px solid #667eea;
}

.chapter-card h2 {
    color: #667eea;
    margin-bottom: 10px;
}

.chapter-card h3 {
    color: #764ba2;
    margin-bottom: 15px;
}

.chapter-card p {
    margin-bottom: 20px;
}

.btn-primary {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Styles améliorés pour les cartes de chapitres */
.chapter-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.chapter-card-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    font-size: 24px;
    font-weight: 700;
    flex-shrink: 0;
}

.chapter-card h2 {
    margin: 0;
    flex: 1;
}

.chapter-topics {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chapter-topics li {
    background: #f7f9fc;
    color: #667eea;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid #e0e7ff;
    transition: all 0.3s ease;
}

.chapter-topics li:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* ============================================
   STYLES SPÉCIFIQUES AU CHAPITRE 1
   (Menu de navigation, sous-chapitres, etc.)
   ============================================ */

/* Menu de navigation latéral - Fixe à gauche avec design professionnel */
.chapter-nav {
    position: fixed;
    left: 0;
    top: 50px; /* Positionné juste après le header sticky */
    width: 280px;
    height: calc(100vh - 50px);
    overflow-y: auto;
    overflow-x: hidden;
    background: #667eea;
    padding: 0;
    box-shadow: 
        2px 0 20px rgba(102, 126, 234, 0.3),
        0 0 0 1px rgba(102, 126, 234, 0.2);
    z-index: 998; /* Sous le header sticky mais au-dessus du contenu */
    border-right: 1px solid rgba(118, 75, 162, 0.3);
    backdrop-filter: blur(10px);
}

/* Scrollbar personnalisée pour le menu - Design moderne */
.chapter-nav::-webkit-scrollbar {
    width: 8px;
}

.chapter-nav::-webkit-scrollbar-track {
    background: transparent;
    margin: 4px 0;
}

.chapter-nav::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
    transition: all 0.3s ease;
}

.chapter-nav::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #764ba2 0%, #667eea 100%);
    border: 1px solid transparent;
}

.chapter-nav h4 {
    color: rgba(255, 255, 255, 0.95);
    font-size: 10px;
    margin: 0;
    padding: 12px 12px 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.12);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.nav-item {
    margin-bottom: 4px;
}

.nav-link {
    display: block;
    padding: 6px 8px;
    color: #2c3e50;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 13px;
    border-left: 2px solid transparent;
    line-height: 1.3;
}

.nav-link span {
    display: inline;
}

.nav-link:hover {
    background: #f5f7fa;
    border-left-color: #667eea;
    padding-left: 10px;
}

.nav-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    border-left-color: #764ba2;
}

.nav-number {
    font-weight: bold;
    color: #667eea;
    margin-right: 6px;
    font-size: 12px;
}

.nav-link.active .nav-number {
    color: white;
}

/* Groupes de navigation - Style accordéon */
.nav-group {
    margin-bottom: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.nav-group:last-child {
    border-bottom: none;
}

.nav-group:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Header du groupe (cliquable pour accordéon) */
.nav-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    user-select: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.03);
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nav-group-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    transition: width 0.3s ease;
    z-index: 1;
}

.nav-group-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.25) 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-group-header:hover::before {
    width: 4px;
}

.nav-group-header:hover::after {
    opacity: 1;
}

.nav-group-header:hover {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.04) 100%);
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.15),
        0 2px 6px rgba(0, 0, 0, 0.1);
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.nav-group-header.active {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
    box-shadow: 
        inset 4px 0 0 rgba(255, 255, 255, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.15),
        0 1px 2px rgba(0, 0, 0, 0.1);
    border-bottom-color: rgba(255, 255, 255, 0.25);
}

.nav-group-header.active::after {
    opacity: 1;
    background: linear-gradient(90deg, transparent 0%, rgba(102, 126, 234, 0.25) 50%, transparent 100%);
}

/* Bouton toggle pour l'accordéon */
.nav-group-toggle {
    background: none;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    min-width: 32px;
    min-height: 32px;
}

.nav-group-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

.nav-group-toggle:active {
    transform: scale(0.95);
}

/* Icône de chevron pour l'accordéon */
.nav-group-chevron {
    width: 14px;
    height: 14px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.nav-group-header.active .nav-group-chevron {
    transform: rotate(90deg);
    color: rgba(255, 255, 255, 1);
}

/* Contenu du groupe (liste) - Masqué par défaut en accordéon */
.nav-group-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s ease,
                padding 0.3s ease;
    opacity: 0;
    padding: 0;
}

.nav-group-content.expanded {
    max-height: 2000px; /* Valeur suffisamment grande */
    opacity: 1;
    padding: 2px 0 4px;
}

.nav-group-title {
    font-weight: bold;
    color: #764ba2;
    font-size: 12px;
    margin-bottom: 4px;
    padding: 5px 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: block;
    text-decoration: none;
}

.nav-group-title:hover {
    background: #f5f7fa;
    color: #667eea;
}

.nav-group .nav-item {
    margin-left: 6px;
}

/* Navigation à 3 niveaux */
.nav-link-level-1 {
    display: block;
    padding: 10px 12px;
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    border-left: 3px solid rgba(255, 255, 255, 0.4);
    margin: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    letter-spacing: 0.2px;
    line-height: 1.4;
}

.nav-link-level-1::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    
    transition: width 0.3s ease;
}

.nav-link-level-1:hover {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    border-left-color: rgba(255, 255, 255, 0.6);
    padding-left: 15px;
    transform: translateX(2px);
    color: rgba(255, 255, 255, 1);
}

.nav-link-level-1:hover::before {
    width: 100%;
}

.nav-link-level-1.active {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%);
    border-left-color: rgba(255, 255, 255, 0.7);
    color: rgba(255, 255, 255, 1);
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.1);
}

.nav-link-level-2 {
    display: block;
    padding: 8px 12px 8px 2px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    border-left: 2px solid transparent;
    margin: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    letter-spacing: 0.1px;
    line-height: 1.4;
}

.nav-link-level-2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.15) 0%, transparent 100%);
    transition: width 0.3s ease;
}

.nav-link-level-2:hover {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0%, transparent 100%);
    border-left-color: rgba(255, 255, 255, 0.5);
    padding-left: 7px;
    transform: translateX(2px);
    color: rgba(255, 255, 255, 1);
}

.nav-link-level-2:hover::before {
    width: 100%;
}

.nav-link-level-2.active {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.1) 100%);
    border-left-color: rgba(255, 255, 255, 0.6);
    color: rgba(255, 255, 255, 1);
    font-weight: 700;
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.12);
}

.nav-sublist {
    list-style: none;
    padding: 2px 0;
    margin: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.03) 100%);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    
}

.nav-link-level-3 {
    display: block;
    padding: 6px 12px 6px 16px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 12px;
    border-left: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    font-weight: 500;
    line-height: 1.4;
}

.nav-link-level-3::before {
    content: '\2022';
    position: absolute; 
    left: 4px;
    top:0px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 18px;
    transition: all 0.3s ease;
}

.nav-link-level-3:hover {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    border-left-color: rgba(255, 255, 255, 0.5);
    padding-left: 19px;
    color: rgba(255, 255, 255, 1);
    transform: translateX(2px);
}

.nav-link-level-3:hover::before {
    color: rgba(255, 255, 255, 0.8);
    transform: scale(1.3);
}

.nav-link-level-3.active {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.12) 100%);
    color: rgba(255, 255, 255, 1);
    border-left-color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.12);
}

.nav-link-level-3.active::before {
    color: rgba(255, 255, 255, 0.9);
    font-weight: bold;
}

/* Titre de sous-chapitre */
.sub-chapter-title {
    font-size: 32px;
    font-weight: 700;
    color: #764ba2;
    margin: 60px 0 40px 0;
    padding-bottom: 15px;
    border-bottom: 3px solid #667eea;
    text-align: left;
    scroll-margin-top: 20px;
}

.sub-chapter-title .number {
    color: #667eea;
    font-weight: 800;
    margin-right: 15px;
}

/* Première section d'un sous-chapitre */
.first-section {
    margin-top: 30px;
}

/* Ajustement du container pour le menu - Occupe le reste de l'espace */
body:has(.chapter-nav) {
    display: flex;
    flex-direction: column;
}

body:has(.chapter-nav) .container {
    margin-left: 280px;
    width: calc(100% - 280px);
    max-width: none;
    
    background: white;
    border-radius: 0;
    box-shadow: none;
    min-height: calc(100vh - 50px);
    
}

/* Header du chapitre - amélioration du design */
body:has(.chapter-nav) .header {
    margin: 0;
    border-radius: 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border-bottom: 1px solid rgba(102, 126, 234, 0.15);
}

/* Footer pour les pages de cours */
body:has(.chapter-nav) .site-footer {
    margin-left: 280px;
    width: calc(100% - 280px);
    clear: both;
    margin-top: 0;
}

/* Container par défaut (sans chapter-nav) */
body:not(:has(.chapter-nav)) .container {
  
    margin: 0 auto;
    background: white;
    
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    min-height: calc(100vh - 50px);
    
}

/* Section avec ID pour scroll */
.chapter-section {
    scroll-margin-top: 20px;
    padding-top: 20px;
}

/* Séparateur entre sections */
.section-divider {
    border: none;
    height: 2px;
    background: linear-gradient(to right, transparent, #667eea, transparent);
    margin: 50px 0 20px 0;
}

/* Responsive pour le menu de navigation */
@media (max-width: 1200px) {
    .chapter-nav {
        position: fixed;
        left: -300px; /* Caché par défaut */
        transition: left 0.3s ease;
        z-index: 1001;
    }
    
    .chapter-nav.mobile-open {
        left: 0;
    }
    
    /* Cacher le bouton toggle quand le menu est ouvert */
    body:has(.chapter-nav.mobile-open) .chapter-nav-toggle {
        display: none;
    }
    
    /* Bouton pour ouvrir/fermer le menu sur mobile */
    .chapter-nav-toggle {
        display: block;
        position: fixed;
        bottom: 20px;
        left: 20px;
        z-index: 1002;
        background: #fff;
        box-shadow: 0 4px 20px 0 #e9edfb, 0 1.5px 6px rgba(102,126,234,0.10);
        border: 1px solid #e3e8f0;
        border-radius: 50%;
        width: 48px;
        height: 48px;
        padding: 0;
        cursor: pointer;
      
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        color: #667eea;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .chapter-nav-toggle:hover {
        background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
        box-shadow: 
            0 6px 25px rgba(102, 126, 234, 0.5),
            0 4px 12px rgba(0,0,0,0.2);
        transform: translateY(-3px) scale(1.05);
    }
    
    .chapter-nav-toggle:active {
        transform: translateY(-1px) scale(0.98);
    }
    
    .chapter-nav-toggle svg {
        filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
    }
    
    .chapter-nav {
        box-shadow: 2px 0 30px rgba(0,0,0,0.15);
    }

    body:has(.chapter-nav) .container {
        margin-left: 0;
        width: 100%;
       
    }
    
    body:has(.chapter-nav) .site-footer {
        margin-left: 0;
        width: 100%;
    }
}

@media (min-width: 1201px) {
    .chapter-nav-toggle {
        display: none;
    }
}

@media (max-width: 800px) {
    .fullscreen-toggle {
        display: none;
    }
    
    /* Show fullscreen toggle in fullscreen mode even on mobile */
    body.fullscreen-mode .fullscreen-toggle {
        display: flex !important;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 50px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 0;
        box-shadow: 0 4px 20px rgba(0,0,0,0.15);
        display: none;
        max-height: calc(100vh - 50px);
        overflow-y: auto;
        z-index: 1000;
        transform: translateY(-20px);
        opacity: 0;
        transition: all 0.3s ease;
    }
    
    .nav-menu.active {
        display: flex;
        transform: translateY(0);
        opacity: 1;
    }
    
    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .nav-menu li:last-child {
        border-bottom: none;
    }
    
    .nav-domain {
        display: block;
        width: 100%;
        padding: 16px 20px;
        text-align: left;
        border-radius: 0;
        transition: all 0.3s ease;
    }
    
    .nav-domain:hover {
        background: #f5f7fa;
        color: #667eea;
        padding-left: 25px;
    }
    
    .main-nav {
        position: relative;
    }
    
    .header-container {
        position: relative;
    }
}

@media (max-width: 768px) {
    .chapter-nav {
        padding: 0px;
    }

    .nav-list {
        flex-direction: column;
    }

    .nav-group {
        margin-bottom: 8px;
    }

    .logo a {
        font-size: 18px;
    }
}

/* Bouton retour en haut */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    text-decoration: none;
    font-size: 24px;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}


/* === RESPONSIVE === */
@media (max-width: 768px) {
    .content {
        padding: 30px 20px;
    }
    
    .chapter-title {
        font-size: 24px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    .site-footer {
        height: auto;
        min-height: 65px;
        padding: 12px 15px;
    }
    
    .footer-container {
        flex-direction: column;
        gap: 8px;
    }
    
    .footer-separator {
        display: none;
    }
    
    .footer-container p {
        font-size: 12px;
    }

    .pros-cons-grid {
        grid-template-columns: 1fr;
    }

    .comparison-row {
        grid-template-columns: 2fr 1fr 1fr 1fr;
        font-size: 14px;
    }

    .figure {
        padding: 25px 15px;
    }

    .figure::before {
        margin: -25px -15px 15px -15px;
    }
    
    .hero-section {
        padding: 80px 20px 60px;
        min-height: 400px;
    }
    
    .hero-badge {
        font-size: 12px;
        padding: 8px 20px;
        margin-bottom: 20px;
    }
    
    .hero-title-main {
        font-size: 40px;
        letter-spacing: -1px;
    }
    
    .hero-title-accent {
        font-size: 18px;
    }
    
    .hero-subtitle {
        font-size: 16px;
        margin-bottom: 35px;
    }
    
    .hero-cta {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .btn-hero-primary,
    .btn-hero-secondary {
        width: 100%;
        text-align: center;
        padding: 14px 30px;
        font-size: 15px;
    }
    
    .circle-1,
    .circle-2,
    .circle-3 {
        display: none;
    }
}


.nav-sublist li {
    margin-bottom: 0px;
}

figcaption {
    font-size: 14px;
    font-style: italic;
    color: #707680;
    text-align: center;
    margin-top: 8px;
    margin-bottom: 0;
    line-height: 1.4;
}


.image-figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 700px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.image-figure img {
    width: auto;
    max-width: 100%;
    display: block;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    margin-left: auto;
    margin-right: auto;
    /* Enhanced box-shadow for better image depth */
    box-shadow: 0 4px 30px 0 #00000036, 0 1.5px 6px #667eea30;
    transition: box-shadow 0.22s cubic-bezier(.4,0,.2,1);
}

.image-figure figcaption {
    font-size: 15px;
    color: #707680;
    margin-top: 8px;
    text-align: center;
    font-style: italic;
}

/* Lecteur audio */
.audio-player audio {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.plyr--audio .plyr__controls {
    border-radius: 16px;
    border: 1px solid #ccc;
    box-shadow: 4px 4px 11px #00000030;
    
}

::-webkit-scrollbar {
    width: 10px;
    background: #f4f4f7;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #e8eaf1 0%, #c5ccdb 100%);
    border-radius: 6px;
    border: 2px solid #f4f4f7;
    box-shadow: 0 2px 8px #0001;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #bdc7d9 0%, #b0aee8 100%);
}

::-webkit-scrollbar-track {
    background: #f4f4f7;
    border-radius: 6px;
}

html {
    scrollbar-color: #c5ccdb #f4f4f7;
    scrollbar-width: thin;
}
