/* ==========================================================================
   1. RESET & CORE ENGINE
   ========================================================================== */
* { box-sizing: border-box; }
body { margin: 0; overflow: hidden; background: #020617; color: #cbd5e1; font-family: 'Inter', sans-serif; display: flex; justify-content: center; align-items: center; height: 100vh; width: 100vw; }

#deck-container { position: relative; width: 1280px; height: 720px; transform-origin: center center; box-shadow: 0 0 50px rgba(16, 185, 129, 0.05); background: #0f172a; border-radius: 12px; overflow: hidden; }

.slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; padding: 50px; display: flex; flex-direction: column; opacity: 0; visibility: hidden; transform: scale(0.95); transition: all 0.5s ease; z-index: 1; }
.slide.active { opacity: 1; visibility: visible; transform: scale(1); z-index: 10; }

h1, h2, h3 { color: #f8fafc; font-family: 'Poppins', sans-serif; margin: 0; }
h1 { font-size: 55px; line-height: 1.2; text-align: center; } h1 span { color: #facc15; }
h2 { font-size: 38px; color: #10b981; margin-bottom: 20px; border-bottom: 2px solid #334155; padding-bottom: 10px; }
p { font-size: 18px; line-height: 1.5; margin-bottom: 15px; }

.code-block { background: #020617; border: 1px solid #334155; padding: 15px; border-radius: 8px; font-family: 'Fira Code', monospace; color: #94a3b8; font-size: 15px; line-height: 1.4; overflow-x: auto; }
.code-highlight { color: #10b981; } .code-red { color: #ef4444; } .code-blue { color: #38bdf8; }

/* Tableaux */
table { width: 100%; border-collapse: collapse; margin-top: 15px; background: #1e293b; border-radius: 8px; overflow: hidden; }
th, td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #334155; font-size: 16px; }
th { background: #020617; color: #facc15; font-family: 'Poppins', sans-serif; }

/* Layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; height: 100%; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.scene { width: 100%; height: 350px; background: #1e293b; border-radius: 12px; position: relative; overflow: hidden; border: 2px solid #334155; margin-bottom: 20px; display: flex; align-items: center; justify-content: center; }

/* ==========================================================================
   2. ANIMATIONS & SCENERY ASSETS
   ========================================================================== */
/* Backgrounds */
.bg-jungle { background: linear-gradient(to bottom, #064e3b, #022c22); }
.bg-night { background: linear-gradient(to bottom, #0f172a, #020617); }
.bg-cave { background: linear-gradient(to bottom, #292524, #0c0a09); }
.bg-red { background: linear-gradient(to bottom, #450a0a, #2a0404); }
.bg-blue { background: linear-gradient(to bottom, #0c4a6e, #082f49); }

/* Elements */
.warehouse { 
    width: 90px; height: 75px; 
    background: linear-gradient(135deg, #451a03, #78350f); 
    border: 1px solid #92400e; 
    position: relative; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: flex-end;
    z-index: 5; 
    box-shadow: 0 15px 35px rgba(0,0,0,0.6), inset 0 0 15px rgba(0,0,0,0.3);
    border-radius: 8px 8px 2px 2px;
}
/* Toit stylisé - Aspect paille/bois tressé */
.warehouse::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -5px;
    width: calc(100% + 10px);
    height: 25px;
    background: linear-gradient(to bottom, #b45309, #78350f);
    clip-path: polygon(10% 0%, 90% 0%, 100% 100%, 0% 100%);
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}
/* Porte sécurisée avec lueur néon */
.warehouse::after {
    content: '';
    width: 45px;
    height: 40px;
    background: repeating-linear-gradient(to bottom, #1e293b, #1e293b 2px, #0f172a 2px, #0f172a 4px);
    border: 2px solid #38bdf8; /* Lueur Wazuh par défaut */
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
    margin-bottom: 0;
}

/* Colonnes latérales pour le relief */
.warehouse-pillar {
    position: absolute;
    width: 8px;
    height: 100%;
    background: #3a1502;
    top: 0;
    border-radius: 2px;
}
.warehouse-pillar.left { left: 5px; }
.warehouse-pillar.right { right: 5px; }

/* Adaptation pour les petites tailles */
.warehouse.small { 
    width: 35px; height: 30px; 
    border-width: 1px;
}
.warehouse.small::before { top: -10px; height: 12px; left: -2px; width: calc(100% + 4px); }
.warehouse.small::after { width: 18px; height: 15px; border-width: 1px; }

body.light-mode .warehouse { background: linear-gradient(135deg, #fcd34d, #fbbf24); border-color: #d97706; }
body.light-mode .warehouse::before { background: linear-gradient(to bottom, #d97706, #b45309); }
body.light-mode .warehouse::after { background: repeating-linear-gradient(to bottom, #cbd5e1, #cbd5e1 2px, #94a3b8 2px, #94a3b8 4px); border-color: #0369a1; }

.fort { position: relative; display: flex; flex-direction: column; align-items: center; z-index: 5; }
.neon { font-family: 'Poppins'; font-size: 12px; font-weight: bold; background: #000; border: 2px solid #facc15; color: #facc15; padding: 4px 10px; border-radius: 6px; box-shadow: 0 0 10px #facc15; margin-bottom: 5px; text-align: center; }
.monkey { font-size: 40px; position: absolute; z-index: 6; }
.banana { font-size: 30px; position: absolute; z-index: 7; }
.cage { position: absolute; width: 120px; height: 140px; border: 6px solid #94a3b8; border-bottom: none; border-radius: 20px 20px 0 0; background: repeating-linear-gradient(90deg, transparent, transparent 20px, #94a3b8 20px, #94a3b8 26px); z-index: 10; opacity: 0; }
.plasma-wall { position: absolute; width: 150px; height: 180px; border: 4px solid #0ea5e9; border-radius: 50%; box-shadow: 0 0 30px #0ea5e9, inset 0 0 20px #0ea5e9; background: rgba(14, 165, 233, 0.2); z-index: 8; opacity: 0; }

/* Keyframes */
@keyframes walkRight { 0% { left: -10%; } 45% { left: 45%; } 50% { left: 45%; transform: scaleX(-1); } 95% { left: -10%; transform: scaleX(-1); } 100% { left: -10%; transform: scaleX(1); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Act I Specifics */
.active .anim-sunrise { animation: sunrise 8s forwards; }
@keyframes sunrise {
    0%, 65% { background: linear-gradient(to bottom, #0f172a, #020617); }
    80%, 100% { background: linear-gradient(to bottom, #064e3b, #022c22); }
}

.active .anim-moon-set { animation: moonSet 8s forwards; }
@keyframes moonSet { 
    0%, 55% { opacity: 1; transform: translateY(0); } 
    75%, 100% { opacity: 0; transform: translateY(50px); } 
}

.active .anim-sun-rise { animation: sunRise 8s forwards; }
@keyframes sunRise { 
    0%, 65% { opacity: 0; transform: translateY(50px); } 
    85%, 100% { opacity: 1; transform: translateY(0); } 
}

.active .anim-night-steal { animation: stealAction 8s forwards; }
@keyframes stealAction { 
    0% { left: -10%; opacity:1; } 
    15%, 55% { left: 40%; opacity:1; transform: translateY(-50%) scaleX(1); }
    58%, 70% { left: 40%; transform: translateY(-50%) scaleX(-1); opacity:1; }
    80%, 100% { left: -20%; transform: translateY(-50%) scaleX(-1); opacity:1; } 
}

.active .key-tester { animation: showKeyTester 8s forwards; }
@keyframes showKeyTester {
    0%, 18% { opacity: 0; }
    20%, 55% { opacity: 1; }
    56%, 100% { opacity: 0; }
}

.active .key-icon { animation: keyTry 0.3s infinite; }
@keyframes keyTry { 
    0%, 100% { transform: rotate(0deg) scale(1); color: #94a3b8; } 
    50% { transform: rotate(45deg) scale(1.2); color: #facc15; } 
}

.active .key-result::after { animation: bruteForceText 8s forwards; content: ""; }
@keyframes bruteForceText {
    0%, 20% { content: ""; }
    22%, 28% { content: "❌ root"; color: #ef4444; }
    30%, 36% { content: "❌ admin"; color: #ef4444; }
    38%, 44% { content: "❌ 1234"; color: #ef4444; }
    46%, 100% { content: "✅ banane"; color: #10b981; }
}

.active .stolen-bananas { animation: grabBananas 8s forwards; }
@keyframes grabBananas {
    0%, 48% { opacity: 0; transform: scale(0.5); }
    50%, 100% { opacity: 1; transform: scale(1); }
}

.door-open { opacity: 0; transition: 0.5s; } 
.active .door-open { animation: doorBreak 8s forwards; }
@keyframes doorBreak { 
    0%, 48% { opacity: 0; color: #94a3b8; transform: scale(1); } 
    50%, 100% { opacity: 1; color: #ef4444; transform: scale(1.2); } 
}

.active .anim-panic-1 { animation: panicInLeft 8s forwards, panicJitter 0.3s infinite 6.5s; }
.active .anim-panic-2 { animation: panicInRight 8s forwards, panicJitter 0.3s infinite 6.5s; }
.active .anim-panic-3 { animation: panicInLeft2 8s forwards, panicJitter 0.3s infinite 6.5s; }

@keyframes panicInLeft {
    0%, 65% { left: -10%; opacity: 0; }
    75%, 100% { left: 30%; opacity: 1; transform: translateY(-50%) rotate(-10deg); }
}
@keyframes panicInRight {
    0%, 65% { left: 110%; opacity: 0; }
    75%, 100% { left: 70%; opacity: 1; transform: translateY(-50%) scaleX(-1) rotate(-10deg); }
}
@keyframes panicInLeft2 {
    0%, 68% { left: -10%; opacity: 0; }
    78%, 100% { left: 45%; opacity: 1; transform: translateY(-50%) rotate(10deg); }
}
@keyframes panicJitter {
    0%, 100% { margin-top: 0; margin-left: 0; }
    25% { margin-top: -3px; margin-left: -3px; }
    75% { margin-top: 3px; margin-left: 3px; }
}

/* Oracle / Fail2ban / Cave Atmosphere */
.active .cave-torch { 
    position: absolute; width: 100%; height: 100%; 
    background: radial-gradient(circle at 50% 50%, rgba(251, 191, 36, 0.1) 0%, transparent 70%);
    animation: torchFlicker 2s infinite; 
}
@keyframes torchFlicker {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.stalactite { position: absolute; top: 0; color: #444; font-size: 40px; transform: translateY(-10px); }

.oracle-card {
    background: #000; border: 1px solid #10b981; border-radius: 8px; padding: 15px;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.active .typing { overflow: hidden; white-space: nowrap; border-right: 2px solid #10b981; animation: typing 3s steps(40, end), blink-caret .75s step-end infinite; }
@keyframes typing { from { width: 0 } to { width: 100% } }
@keyframes blink-caret { from, to { border-color: transparent } 50% { border-color: #10b981; } }

.active .fail2ban-awakening {
    animation: mysticGlow 4s forwards 3s;
    opacity: 0;
}
@keyframes mysticGlow {
    0% { opacity: 0; transform: scale(0.8) translateY(-50%); filter: blur(10px); }
    100% { opacity: 1; transform: scale(1) translateY(-50%); filter: blur(0); }
}

.terminal-text { font-family: 'Fira Code'; color: #10b981; }

/* Victory Specifics (Slide 6) */
.active .anim-victory-steal { animation: stealCapture 8s forwards; }
@keyframes stealCapture { 
    0% { left: -10%; opacity:1; } 
    15%, 100% { left: 40%; opacity:1; transform: translateY(-50%); }
}

.active .victory-key-result::after { animation: bruteForceFail 8s forwards; content: ""; }
@keyframes bruteForceFail {
    0%, 20% { content: ""; }
    22%, 28% { content: "❌ root"; color: #ef4444; }
    30%, 36% { content: "❌ admin"; color: #ef4444; }
    38%, 44% { content: "❌ 1234"; color: #ef4444; }
    46%, 100% { content: "🚫 BANNED"; color: #ef4444; font-weight: 800; }
}

.active .cage-capture { animation: cageDropCapture 8s forwards; opacity: 0; }
@keyframes cageDropCapture {
    0%, 50% { top: -200px; opacity: 0; }
    55%, 100% { top: 50%; opacity: 1; transform: translate(-50%, -50%); }
}

.active .anim-celebrate-1 { animation: celebrateInLeft 8s forwards, float 2s infinite 6.5s; }
.active .anim-celebrate-2 { animation: celebrateInRight 8s forwards, float 2s infinite 6.8s; }

@keyframes celebrateInLeft {
    0%, 65% { left: -10%; opacity: 0; }
    75%, 100% { left: 25%; opacity: 1; transform: translateY(-50%); }
}
@keyframes celebrateInRight {
    0%, 65% { left: 110%; opacity: 0; }
    75%, 100% { left: 75%; opacity: 1; transform: translateY(-50%) scaleX(-1); }
}

/* Act II / Scaling & Overload */
.overload-alert {
    position: absolute; top: 10px; color:red; font-size: 28px; font-weight: 800;
    opacity: 0; transform: scale(0.5); transition: all 0.5s;
    background: rgba(0,0,0,0.9); padding: 10px 20px; border-radius: 8px; border: 2px solid red;
    z-index: 100; white-space: nowrap; box-shadow: 0 0 20px rgba(255,0,0,0.5);
}
.overload-alert.trigger {
    opacity: 1; transform: scale(1); animation: pulse 0.5s infinite;
}

.active .scale-out { animation: scaleAnim 4s forwards; }
@keyframes scaleAnim { 0%, 20% { transform: scale(1) translateX(0); } 25%, 30% { transform: translateX(-5px); } 35%, 40% { transform: translateX(5px); } 50% { opacity: 0; } 100% { opacity: 0; } }

/* Load Balancer Flow */
.lb-flow-container {
    position: absolute; width: 100%; height: 100%; top: 0; left: 0; pointer-events: none; z-index: 4;
}
.lb-particle {
    position: absolute; background: #10b981; border-radius: 50%; box-shadow: 0 0 10px #10b981;
}

/* Act III / IPS */
.radar-scan { width: 400px; height: 400px; border-radius: 50%; border: 10px solid #475569; position: absolute; }
.radar-beam { width: 200px; height: 200px; background: conic-gradient(from 0deg, transparent 70%, rgba(16, 185, 129, 0.5) 100%); border-radius: 100% 0 0 0; position: absolute; top: 0; left: 0; transform-origin: bottom right; }
.active .spin { animation: spin 4s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }
.active .botnet-attack { animation: botnetFlash 0.5s infinite; }
@keyframes botnetFlash { 0%, 100% { opacity: 0; left: 10%; top: 40%; } 50% { opacity: 1; left: 45%; top: 50%; } }

/* Act IV / Wazuh Global Defense */
.beam-line { position: absolute; border-top: 2px dashed #38bdf8; width: 200px; z-index: 2; opacity: 0.3; }

/* Telemetry Flow */
.data-packet {
    position: absolute; width: 8px; height: 8px; background: #facc15; border-radius: 50%;
    box-shadow: 0 0 10px #facc15, 0 0 20px #facc15; z-index: 3; opacity: 0;
}

.active .telemetry-1 { animation: flowToCenter1 2s linear infinite 4s; }
.active .telemetry-2 { animation: flowToCenter2 2.5s linear infinite 4.5s; }
.active .telemetry-3 { animation: flowToCenter3 1.8s linear infinite 5s; }

@keyframes flowToCenter1 { 0% { left: 80%; top: 20%; opacity: 1; } 90% { opacity: 1; } 100% { left: 50%; top: 50%; opacity: 0; } }
@keyframes flowToCenter2 { 0% { left: 80%; top: 80%; opacity: 1; } 90% { opacity: 1; } 100% { left: 50%; top: 50%; opacity: 0; } }
@keyframes flowToCenter3 { 0% { left: 20%; top: 50%; opacity: 1; } 90% { opacity: 1; } 100% { left: 50%; top: 50%; opacity: 0; } }

.active .manager-brain { animation: brainPulse 2s infinite 4s; }
@keyframes brainPulse {
    0%, 100% { box-shadow: 0 0 50px #38bdf8; border-color: #38bdf8; }
    50% { box-shadow: 0 0 80px #facc15, inset 0 0 20px #facc15; border-color: #facc15; }
}

.active .plasma-activate { animation: plasmaUp 1.5s forwards 1.5s; opacity: 0; }
@keyframes plasmaUp { 
    0% { opacity: 0; transform: scale(0.8) translate(-50%, -50%); } 
    50% { opacity: 1; transform: scale(1.1) translate(-50%, -50%); filter: brightness(200%); }
    100% { opacity: 1; transform: scale(1) translate(-50%, -50%); filter: brightness(100%); } 
}

.active .wazuh-broadcast { animation: broadcastPulse 2s ease-out forwards; }
@keyframes broadcastPulse {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(3); opacity: 0; }
}

/* Final Battle (Slide 17) */
.active .thief-bounce-final { animation: finalBounce 6s infinite; }
@keyframes finalBounce { 
    0% { left: 0%; top: 50%; opacity: 0; }
    10% { left: 10%; top: 50%; opacity: 1; transform: translateY(-50%) rotate(0deg); } 
    40% { left: 60%; top: 20%; opacity: 1; transform: translateY(-50%) rotate(0deg); } /* Hit Reserve A */
    45% { left: 55%; top: 25%; opacity: 1; transform: translateY(-50%) rotate(-45deg); filter: sepia(1) hue-rotate(300deg) saturate(5); } /* Rebond */
    60% { left: 80%; top: 80%; opacity: 1; transform: translateY(-50%) rotate(-90deg); filter: sepia(1) hue-rotate(300deg) saturate(5); } /* Hit Reserve C */
    65% { left: 75%; top: 75%; opacity: 1; transform: translateY(-50%) rotate(-135deg); filter: sepia(1) hue-rotate(300deg) saturate(10); } /* Rebond */
    85% { left: -10%; top: -10%; opacity: 1; transform: translateY(-50%) rotate(-180deg); } /* Fuite */
    100% { left: -10%; opacity: 0; }
}

/* Act III / IPS Failures (Slide 12) */
.ssl-tunnel {
    width: 200px; height: 60px; background: rgba(16, 185, 129, 0.1);
    border: 2px dashed #10b981; border-radius: 30px; position: relative;
    display: flex; align-items: center; justify-content: center;
}
.active .ssl-ninja { animation: tunnelPass 4s infinite linear; }
@keyframes tunnelPass {
    0% { left: -50px; opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { left: 250px; opacity: 0; }
}

.detection-gauge {
    width: 20px; height: 150px; background: #020617; border: 2px solid #334155;
    position: relative; border-radius: 10px; overflow: hidden;
}
.gauge-fill {
    width: 100%; height: 0%; background: linear-gradient(to top, #10b981, #facc15, #ef4444);
    position: absolute; bottom: 0; transition: height 0.2s;
}

.active .botnet-drop { animation: botnetRain 2s infinite ease-in; }
@keyframes botnetRain {
    0% { transform: translateY(-100px) scale(0.5); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateY(150px) scale(0.5); opacity: 0; }
}

.active .blink-fast { animation: blink 0.2s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Final Battle (Slide 18) */
.active .plasma-hit { animation: plasmaFlare 0.4s ease-out; }
@keyframes plasmaFlare {
    0% { filter: brightness(1) contrast(1); transform: translate(-50%, -50%) scale(1); }
    50% { filter: brightness(3) contrast(2); transform: translate(-50%, -50%) scale(1.1); box-shadow: 0 0 50px #38bdf8; }
    100% { filter: brightness(1) contrast(1); transform: translate(-50%, -50%) scale(1); }
}

.spark {
    position: absolute; width: 4px; height: 4px; background: white; border-radius: 50%;
    box-shadow: 0 0 10px #38bdf8; pointer-events: none; z-index: 20;
}

/* Helpers */
.fade-in { opacity: 0; } .active .fade-in { animation: fadeIn 1s forwards; }
.d-1 { animation-delay: 0.5s !important; } .d-2 { animation-delay: 1.5s !important; } .d-3 { animation-delay: 2.5s !important; } .d-4 { animation-delay: 3.5s !important; }

/* ==========================================================================
   3. UI CONTROLS & SPEAKER NOTES
   ========================================================================== */
#ui-layer { position: fixed; bottom: 15px; left: 0; width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 0 30px; z-index: 100; }
.btn { background: #1e293b; border: 1px solid #334155; color: #f8fafc; padding: 10px 15px; border-radius: 6px; cursor: pointer; font-family: 'Inter'; font-weight: 600; display: flex; align-items: center; gap: 8px; transition: 0.2s; }
.btn:hover { background: #10b981; color: #020617; }
#progress { flex-grow: 1; height: 6px; background: #334155; margin: 0 20px; border-radius: 3px; overflow: hidden; }
#progress-bar { height: 100%; background: #10b981; width: 0%; transition: 0.3s; }

/* Theme Button Visibility */
.btn-theme-toggle { display: none !important; }
body.presenter-mode .btn-theme-toggle { display: flex !important; }

/* ==========================================================================
   LIGHT MODE (THEME CLAIR)
   ========================================================================== */
body.light-mode { background: #f8fafc; color: #334155; }
body.light-mode #deck-container { background: #ffffff; box-shadow: 0 0 40px rgba(0, 0, 0, 0.1); }
body.light-mode h1, body.light-mode h2, body.light-mode h3 { color: #0f172a; }
body.light-mode h1 span { color: #d97706; }
body.light-mode h2 { border-bottom-color: #cbd5e1; }
body.light-mode .code-block { background: #f1f5f9 !important; border-color: #cbd5e1 !important; color: #334155 !important; }
body.light-mode table { background: #ffffff; border: 1px solid #e2e8f0; }
body.light-mode th { background: #f1f5f9; color: #0f172a; }
body.light-mode td { border-bottom-color: #e2e8f0; }
body.light-mode .scene { border-color: #cbd5e1; }

/* Custom light backgrounds */
body.light-mode .bg-jungle { background: linear-gradient(to bottom, #d1fae5, #a7f3d0) !important; }
body.light-mode .bg-night { background: linear-gradient(to bottom, #e0e7ff, #c7d2fe) !important; }
body.light-mode .bg-cave { background: linear-gradient(to bottom, #f5f5f4, #e7e5e4) !important; }
body.light-mode .bg-blue { background: linear-gradient(to bottom, #e0f2fe, #bae6fd) !important; }

/* Elements adaptations */
body.light-mode .neon { background: #fff !important; color: #d97706 !important; border-color: #d97706 !important; box-shadow: 0 0 10px rgba(217,119,6,0.3) !important; }
body.light-mode .oracle-card { background: #fff !important; border-color: #10b981 !important; box-shadow: 0 0 15px rgba(16,185,129,0.1) !important; }
body.light-mode .oracle-card [style*="color: #facc15"] { color: #b45309 !important; } /* Darker yellow/orange for readability */
body.light-mode .cave-torch { background: radial-gradient(circle at 50% 50%, rgba(251, 191, 36, 0.3) 0%, transparent 70%) !important; }
body.light-mode .terminal-text { color: #059669 !important; }
body.light-mode p { color: #334155 !important; }
body.light-mode p span { color: #d97706 !important; }
body.light-mode .fort { color: #92400e !important; text-shadow: 2px 2px 0px #fcd34d !important; }
body.light-mode .code-block span.code-highlight { color: #059669 !important; }
body.light-mode .code-block span.code-blue { color: #0369a1 !important; border-color: #0369a1 !important; }

/* Legende and dark blocks in slides */
body.light-mode [style*="background: #1e293b"], 
body.light-mode [style*="background: rgba(0,0,0,0.5)"],
body.light-mode [style*="background: rgba(14, 165, 233, 0.2)"] { 
    background: #f1f5f9 !important; 
    color: #334155 !important; 
    border-color: #cbd5e1 !important;
}

body.light-mode .btn { background: #e2e8f0 !important; color: #0f172a !important; border-color: #cbd5e1 !important; }
body.light-mode .btn i { color: #0f172a !important; }

body.light-mode .slack-mockup { background: #ffffff !important; border-color: #ef4444 !important; }
body.light-mode .slack-mockup strong { color: #0f172a !important; }
body.light-mode .slack-mockup div { color: #334155 !important; }

body.light-mode .overload-alert { background: #fff !important; border-color: #ef4444 !important; color: #ef4444 !important; }

body.light-mode [style*="color: white"],
body.light-mode [style*="color: #f8fafc"],
body.light-mode [style*="color: #cbd5e1"],
body.light-mode [style*="color: #94a3b8"] {
    color: #334155 !important;
}

/* Fix for HA diagram Master/Worker text */
body.light-mode small { color: #0f172a !important; }
body.light-mode .arch-node { background: #f1f5f9 !important; border-color: #cbd5e1 !important; box-shadow: 0 0 10px rgba(0,0,0,0.05) !important; }
body.light-mode .arch-node small { color: #334155 !important; }
body.light-mode .conclusion-footer { background: #f1f5f9 !important; border-color: #cbd5e1 !important; box-shadow: 0 5px 15px rgba(0,0,0,0.05) !important; }
body.light-mode .conclusion-footer div[style*="color: #facc15"] { color: #b45309 !important; }
body.light-mode .location-block { background: #f1f5f9 !important; color: #334155 !important; border: 1px solid #cbd5e1; }
body.light-mode .location-block span[style*="color: #fb923c"] { color: #c2410c !important; }

/* Presenter Mode adaptions for Light Theme */
body.presenter-mode.light-mode { background: #f1f5f9; }
body.presenter-mode.light-mode #ui-layer { background: #f1f5f9; }
body.presenter-mode.light-mode #speaker-notes { background: #ffffff; border-left-color: #cbd5e1; }
body.presenter-mode.light-mode #speaker-notes p { color: #1e293b; }
body.presenter-mode.light-mode #speaker-notes h3 { color: #0f172a; border-bottom-color: #cbd5e1; }
body.presenter-mode.light-mode .btn { background: #e2e8f0; color: #0f172a; border-color: #cbd5e1; }
body.presenter-mode.light-mode .btn:hover { background: #cbd5e1; }


/* Modes de présentation */
body.is-fullscreen:not(.presenter-mode) #ui-layer,
body.presentation-mode #ui-layer,
body.presentation-mode #speaker-notes {
    display: none !important;
}

body.presenter-mode {
    display: grid;
    grid-template-columns: 400px 1fr;
    grid-template-rows: 1fr auto;
    gap: 0;
    padding: 0;
    overflow: hidden;
    background: #020617;
}

body.presenter-mode #deck-container {
    grid-column: 1;
    grid-row: 1;
    width: 380px !important;
    height: 214px !important;
    margin: 10px;
    align-self: start;
    transform: none !important;
    border: 2px solid #334155;
}

body.presenter-mode #speaker-notes {
    grid-column: 2;
    grid-row: 1 / span 2;
    position: static;
    width: 100%;
    height: 100vh;
    bottom: 0;
    display: block !important;
    border: none;
    border-left: 2px solid #334155;
    background: #0f172a;
    padding: 40px;
    border-radius: 0;
}

body.presenter-mode #speaker-notes p {
    font-size: 24px;
    line-height: 1.5;
}

body.presenter-mode #ui-layer {
    grid-column: 1;
    grid-row: 2;
    position: static;
    padding: 20px;
    background: #020617;
    flex-direction: column;
    gap: 20px;
    height: auto;
}

body.presenter-mode #ui-layer button {
    width: 100%;
    padding: 15px;
}

body.presenter-mode .close-notes,
body.presenter-mode #progress,
body.presenter-mode [onclick="toggleNotes()"],
body.presenter-mode [onclick="openPresenterMode()"] {
    display: none !important;
}

/* Speaker Notes Panel */
#speaker-notes { position: fixed; bottom: -100%; left: 10%; width: 80%; height: 40vh; background: rgba(2, 6, 23, 0.95); border: 2px solid #10b981; border-radius: 12px 12px 0 0; padding: 30px; z-index: 200; transition: bottom 0.4s ease; overflow-y: auto; box-shadow: 0 -10px 50px rgba(0,0,0,0.5); backdrop-filter: blur(10px); }
#speaker-notes.open { bottom: 0; }
#speaker-notes h3 { color: #facc15; border-bottom: 1px solid #334155; padding-bottom: 10px; margin-bottom: 15px; }
#speaker-notes p { font-size: 16px; color: #e2e8f0; line-height: 1.6; }
.close-notes { position: absolute; top: 15px; right: 20px; background: none; border: none; color: #ef4444; font-size: 24px; cursor: pointer; }

/* Slide 12 : Ansible Scroll */
.ansible-scroll {
    position: absolute; font-size: 24px; z-index: 5;
    filter: drop-shadow(0 0 10px #facc15);
}
.ansible-target { transition: all 0.3s; }
.ansible-target.hit { transform: scale(1.2); filter: drop-shadow(0 0 15px #10b981); }
.perm-tag { transition: opacity 0.3s, transform 0.3s; transform: translateY(10px); }
.perm-tag.show { opacity: 1 !important; transform: translateY(0); }

/* Slide 13 : FIM Laser */
.active .fim-laser-beam {
    animation: laserSweep 4s infinite ease-in-out;
}
@keyframes laserSweep {
    0%, 100% { left: 30%; opacity: 0; }
    10%, 90% { opacity: 1; }
    50% { left: 70%; }
}
.active .poison-banana.detected {
    animation: poisonGlow 1s infinite alternate;
}
@keyframes poisonGlow {
    from { filter: drop-shadow(0 0 5px #ef4444) hue-rotate(90deg); transform: scale(1); }
    to { filter: drop-shadow(0 0 20px #ef4444) hue-rotate(120deg); transform: scale(1.2); }
}

/* Slide 14 : VT Oracle improved */
.vt-oracle.pulse {
    animation: oraclePulse 0.5s infinite alternate;
}
@keyframes oraclePulse {
    from { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 30px rgba(16,185,129,0.3); }
    to { transform: translate(-50%, -50%) scale(1.1); box-shadow: 0 0 50px rgba(16,185,129,0.6); border-color: #facc15; }
}

/* Slide 16 : Zero Touch improved */
.active .plasma-net { animation: dropNetImproved 2s forwards 0.5s; }
@keyframes dropNetImproved {
    0% { opacity: 0; top: 0; transform: translate(-50%, -50%) scale(3) rotate(45deg); }
    50% { opacity: 1; top: 58%; transform: translate(-50%, -50%) scale(1) rotate(0deg); }
    100% { opacity: 1; top: 58%; transform: translate(-50%, -50%) scale(1); background: rgba(239,68,68,0.4); box-shadow: 0 0 40px #ef4444; }
}
.active #slide16-scene .monkey { animation: caughtShake 0.2s infinite; animation-delay: 1.5s; opacity: 0; }
@keyframes caughtShake {
    0%, 100% { transform: translateX(-50%) rotate(0deg); }
    25% { transform: translateX(-55%) rotate(-5deg); }
    75% { transform: translateX(-45%) rotate(5deg); }
}
.active #slide16-scene .monkey.show { opacity: 1; }

/* ==========================================================================
   VOIE B - NEW ANIMATIONS
   ========================================================================== */

/* Slide 5 : FIM */
.active .anim-stealth-ninja { animation: stealthWalk 6s forwards; }
@keyframes stealthWalk {
    0% { left: -10%; opacity: 0; }
    20%, 40% { left: 40%; opacity: 1; transform: scaleX(1); }
    45% { left: 40%; opacity: 1; transform: scaleX(-1); }
    60%, 100% { left: -10%; opacity: 1; transform: scaleX(-1); }
}
.active .poison-banana { animation: dropBanana 6s forwards; }
@keyframes dropBanana {
    0%, 30% { opacity: 0; transform: translateY(-20px) scale(0.5); }
    35%, 100% { opacity: 1; transform: translateY(0) scale(1); }
}
.active .fim-scanner { animation: fimScan 6s forwards; }
@keyframes fimScan {
    0%, 40% { opacity: 0; transform: scale(0.5); }
    45%, 55% { opacity: 1; transform: scale(1.5); border-color: #ef4444; box-shadow: 0 0 20px #ef4444; }
    60%, 100% { opacity: 0; transform: scale(2); }
}
.active .fim-alert { animation: fimAlertPop 6s forwards; }
@keyframes fimAlertPop {
    0%, 45% { opacity: 0; transform: translateY(20px); }
    50%, 100% { opacity: 1; transform: translateY(0); }
}

/* Slide 6 : Pigeons */
.pigeon-fly {
    position: absolute; font-size: 24px; z-index: 10;
    filter: drop-shadow(0 0 5px white);
}
.active .vt-verdict { animation: showVerdict 4s forwards 2.5s; }
@keyframes showVerdict {
    0% { opacity: 0; transform: translateX(-50%) translateY(20px); }
    100% { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Slide 8 : Zero Touch Remediation */
.active .plasma-net { animation: dropNet 2s forwards 0.5s; }
@keyframes dropNet {
    0% { opacity: 0; top: 0; transform: translate(-50%, -50%) scale(2); }
    50% { opacity: 1; top: 60%; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 1; top: 60%; transform: translate(-50%, -50%) scale(1); background: rgba(239,68,68,0.4); }
}
.active .zt-text { animation: ztBlink 2s forwards 1.5s; }
@keyframes ztBlink {
    0%, 20%, 40%, 60%, 80% { opacity: 1; }
    10%, 30%, 50%, 70% { opacity: 0; }
    100% { opacity: 1; }
}
