:root {
    /* Couleurs SEO "Tech" */
    --bg-light: #ffffff;
    --bg-off: #f4f6f8;
    --text-main: #1e293b;
    --text-light: #64748b;
    --accent: #3b82f6; /* Bleu tech */
    --accent-dark: #1e40af;
    --dark-slide-bg: #0f172a;
    
    /* Variables UI */
    --card-radius: 16px;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    --transition-smooth: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Reset basique */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; color: var(--text-main); background: var(--bg-light); overflow: hidden; }

/* ===============================
   SCROLL SYSTEM
   =============================== */
.slides-container {
    height: 100vh;
    width: 100vw;
    overflow-y: scroll;
    scroll-snap-type: y mandatory; /* Le cœur du système slide */
    scroll-behavior: smooth;
}

.slide {
    height: 100vh;
    width: 100%;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow: hidden;
}

/* Animation d'entrée du contenu */
.content {
    max-width: 900px;
    width: 100%;
    opacity: 0;
    transform: translateY(40px);
    transition: var(--transition-smooth);
    z-index: 2;
}
.slide.visible .content { opacity: 1; transform: translateY(0); }



/* =========================================
   NOUVEAU : STYLES DES CHAPITRES & HIERARCHIE
   ========================================= */


/* Style de la description dans les pages Chapitres */
.chapter-description {
    font-size: 1.25rem;   /* Un peu plus grand que le texte normal */
    line-height: 1.6;
    max-width: 700px;     /* Pour ne pas que les lignes soient trop longues */
    margin: 1.5rem auto;  /* Centré horizontalement avec espacement vertical */
    color: rgba(255, 255, 255, 0.9); /* Blanc légèrement transparent */
    font-weight: 300;     /* Police fine pour l'élégance */
}

/* Si tu as mis des paragraphes <p> dans ton contenu */
.chapter-description p {
    margin-bottom: 1rem;
}


/* 1. Design de la Slide "Titre de Chapitre" */
.slide.chapter-header {
    background-color: var(--accent); /* Fond Bleu (ou ta couleur principale) */
    color: white;
    text-align: center;
}

.slide.chapter-header h1 {
    color: white;
    font-size: clamp(3rem, 8vw, 5rem); /* Très gros titre */
    margin-bottom: 1rem;
}

.slide.chapter-header p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.5rem;
    max-width: 600px;
    margin: 0 auto;
}

.chapter-number {
    display: block;
    font-family: monospace; /* Look un peu "code" */
    letter-spacing: 4px;
    text-transform: uppercase;
    opacity: 0.6;
    margin-bottom: 1rem;
}

.divider-line {
    width: 80px;
    height: 4px;
    background: white;
    margin: 2rem auto 0;
    border-radius: 2px;
}


/* Images insérées dans le contenu */
.slide-img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 1.5rem 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: block;
}

/* Si l'image est seule dans une slide, on peut limiter sa hauteur */
.slide-body-content img {
    max-height: 60vh; /* Évite qu'elle dépasse l'écran */
    object-fit: contain;
}



/* ===============================
   SLIDE 1: HERO & IMAGE BACKGROUND amelioré à version v0.3
   =============================== */
.hero-slide {
    /* 1. Couleur de fond de base (Bleu nuit très sombre) */
    background-color: #0f172a;
    
    /* 2. Le "Cool Pattern" par défaut (Si pas d'image) */
    /* On superpose une grille subtile et deux spots de lumière colorés */
    background-image: 
        /* Grille fine */
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        
        /* Spot Bleu/Violet en haut à gauche */
        radial-gradient(circle at 0% 0%, rgba(59, 130, 246, 0.4) 0%, transparent 50%),
        
        /* Spot Rose/Violet en bas à droite */
        radial-gradient(circle at 100% 100%, rgba(139, 92, 246, 0.4) 0%, transparent 50%);
        
    background-size: 50px 50px, 100% 100%, 100% 100%; /* Taille de la grille vs taille des spots */
    background-position: center;
    background-repeat: repeat, no-repeat, no-repeat;
    
    /* Propriétés pour quand il y a une vraie image (écrasera le pattern) */
    background-size: cover; 
    color: white;
}

/* Ajustement de l'overlay */
.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.65); /* Sombre par défaut pour les images */
    z-index: 1;
    pointer-events: none; /* Laisse passer les clics */
}

/* Si pas d'image de fond définie (donc pas de style inline),
   on réduit l'opacité du filtre noir pour profiter des couleurs du CSS */
.hero-slide:not([style*="background-image"]) .hero-overlay {
    background: rgba(0, 0, 0, 0.2); /* Beaucoup plus léger */
    backdrop-filter: blur(2px); /* Léger flou pour un effet "Glass" sur le fond */
}



.hero-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-content h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    margin: 0.5rem 0;
    font-weight: 800;
    letter-spacing: -1px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 2rem;
}

.badge-new {
    background: var(--accent);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Carte sommaire transparente (Glassmorphism) */
.summary-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--card-radius);
    padding: 2rem;
    text-align: left;
    max-width: 600px;
    width: 100%;
    margin-top: 1rem;
}

.summary-list { list-style: none; margin-top: 1rem; }
.summary-list li { margin-bottom: 0.8rem; font-size: 1.1rem; display: flex; align-items: center; gap: 10px; }
.scroll-hint { text-align: center; margin-top: 1.5rem; font-size: 0.9rem; opacity: 0.7; animation: bounce 2s infinite; }

@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }


/* Style du résumé riche (HTML) */
.summary-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

.summary-text p {
    margin-bottom: 0.8rem; /* Espacement entre les paragraphes */
}

.summary-text ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.summary-text li {
    list-style: disc;
    margin-bottom: 0.3rem;
}

.summary-text strong {
    color: #fff;
    font-weight: 700;
}


/* ===============================
   CARDS & DESIGN GENERAL
   =============================== */
h2 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 2rem; color: var(--text-main); font-weight: 700; }
.topic { color: var(--accent); font-weight: 700; text-transform: uppercase; font-size: 0.85rem; display: block; margin-bottom: 0.5rem; }

/* --- TAG / BADGE --- */
.topic {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
}

/* --- LAYOUTS --- */

/* 1. Grille de Cartes (2 colonnes) */
.layout-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    width: 100%;
}

/* Design de la Carte (Card) */
.card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    border-left: 4px solid var(--accent); /* Petite touche de couleur */
    transition: transform 0.3s ease;
}

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

.card h3 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
    color: var(--text-main);
}

/* 2. Split Layout (Texte Gauche / Média Droite) */
.layout-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

@media (max-width: 768px) {
    .layout-split { grid-template-columns: 1fr; } /* Mobile : retour en colonne */
}

/* --- MODE FONCÉ (Dark Mode) --- */
.slide.dark-mode {
    background-color: #111827; /* Gris très foncé */
    color: #f3f4f6;
}

.slide.dark-mode h2 {
    color: white;
}

.slide.dark-mode .breadcrumb {
    color: #9ca3af;
    border-bottom-color: #3b82f6;
}

/* Adaptation des cartes en mode sombre */
.slide.dark-mode .card {
    background: #1f2937; /* Gris un peu plus clair que le fond */
    border-left-color: #60a5fa;
}

.slide.dark-mode .card h3 {
    color: white;
}

.slide.dark-mode p {
    color: #d1d5db;
}







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

/* Design des cartes (SANS bordure bleue) */
.card {
    background: white;
    padding: 2.5rem;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow); /* Ombre douce au lieu de bordure */
    transition: transform 0.3s ease;
}
.card:hover { transform: translateY(-5px); } /* Petit effet levitation */

.card h3 { margin-bottom: 1rem; font-size: 1.3rem; }
.card p { color: var(--text-light); line-height: 1.6; }

/* Liste propre */
.clean-list { list-style: none; }
.clean-list li {
    display: flex;
    gap: 1.5rem;
    background: rgba(255,255,255,0.05);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}
.clean-list .icon { font-size: 2rem; }

/* Slide sombre */
.slide.dark-mode { background: var(--dark-slide-bg); color: white; }
.slide.dark-mode h2 { color: white; }
.slide.dark-mode .card, .slide.dark-mode .topic { color: inherit; }

/* Highlight Card */
.highlight-card { text-align: center; border: 1px solid #e2e8f0; }
.big-text { font-size: 1.5rem; font-weight: 600; color: var(--text-main); margin-bottom: 1rem; font-style: italic; }

/* ===============================
   NAVIGATION & SOMMAIRE INTERACTIF
   =============================== */
.presentation-nav {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    left: 2rem; /* Largeur fluide */
    z-index: 100;
    display: flex;
    justify-content: flex-end; /* Aligné à droite */
    pointer-events: none; /* Laisse passer les clics en dehors des boutons */
}

.nav-container {
    background: white;
    padding: 0.5rem;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    pointer-events: auto; /* Réactive les clics sur la nav */
    position: relative;
}

/* Bouton Compteur & Menu Trigger */
.page-indicator {
    background: var(--bg-off);
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 30px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}
.page-indicator:hover { background: #e2e8f0; }
.icon-menu { font-size: 1.2rem; margin-left: 5px; color: var(--text-light); }


/* 2. Le "Breadcrumb" (Petit fil d'ariane sur les slides de contenu) */
.breadcrumb {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-light);
    letter-spacing: 1px;
    margin-bottom: 1rem;
    font-weight: 600;
    display: inline-block;
    border-bottom: 1px solid var(--accent); /* Petit soulignement discret */
    padding-bottom: 3px;
}


/* Le Menu Sommaire (Drop-up) */
.menu-wrapper { position: relative; }



/* 3. Mise à jour du Menu (Sommaire) pour gérer les sous-niveaux */
.toc-section {
    margin-top: 10px;
    border-top: 1px solid #eee; /* Séparation entre les grands chapitres */
    padding-top: 10px;
}

.toc-chapter-title {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-light);
    font-weight: 700;
    letter-spacing: 1px;
}

.toc-sub-menu {
    list-style: none;
    padding-left: 0.5rem; /* Léger décalage */
}

.toc-sub-menu .toc-link {
    font-size: 0.9rem; /* Un peu plus petit que les liens principaux */
    padding-left: 1.5rem;
    border-left: 2px solid transparent;
    border-radius: 0 8px 8px 0;
}

.toc-sub-menu .toc-link:hover {
    border-left-color: var(--accent); /* Barre colorée au survol */
}


.toc-menu {
    position: absolute;
    bottom: 140%; /* Au dessus du bouton */
    right: 0;
    width: 260px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 1rem;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    transform-origin: bottom right;
}

/* Affichage du menu au survol du wrapper OU si classe .active (pour mobile) */
.menu-wrapper:hover .toc-menu,
.menu-wrapper.active .toc-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.toc-link {
    display: block;
    padding: 0.6rem 1rem;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.95rem;
    border-radius: 8px;
    transition: background 0.2s;
}
.toc-link:hover { background: var(--bg-off); color: var(--accent); }

/* Bouton Next */
.nav-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--text-main);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}
.nav-btn:hover { background: var(--accent); transform: scale(1.05); }

/* Barre de progression */
.progress-track {
    position: absolute;
    bottom: 0; left: 2rem; width: 150px; height: 4px; background: rgba(0,0,0,0.1);
    border-radius: 10px;
    display: none; /* Caché par défaut, on peut l'activer si voulu */
}

/* CTA Final */
.cta-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 2rem;
    font-weight: 600;
}
.cta-primary:hover { background: var(--accent-dark); }

/* Mobile Adjustments */
@media (max-width: 768px) {
    .presentation-nav { justify-content: center; bottom: 1.5rem; }
    .hero-content h1 { font-size: 2.2rem; }
    .toc-menu { right: -50px; width: 220px; } /* Ajustement position mobile */
}
