Epilepsy, Seizure Definition Epidemiology Pathophysiology Investigation Management Prevention Give me 50 slide power point ppt

Reading File
Reading File
Reading File
Finding Sources
Reading File
Finding Sources
Reading File
Finding Sources
Finding Sources
Finding Sources
Reading File
Finding Sources
Running Command

ls /home/daytona/workspace/ 2>/dev/null && echo "---" && ls /home/daytona/workspace/

Running Command

mkdir -p /home/daytona/workspace/epilepsy-pptx

Writing File

~/epilepsy-pptx/build.js

const pptxgen = require("pptxgenjs");

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Epilepsy & Seizure Disorders";
pres.author = "Orris Medical Education";

// ─── COLOUR PALETTE ───────────────────────────────────────────────
const C = {
  deep:    "0D1B2A",   // near-black navy  (dark slides bg)
  navy:    "1B3A5C",   // section header bg
  mid:     "1D4E89",   // accent bar
  teal:    "0A7373",   // highlight
  amber:   "E07B39",   // warm accent
  gold:    "F2B705",   // bullet accent
  light:   "EAF2FB",   // content slide bg
  white:   "FFFFFF",
  offwhite:"F0F4F8",
  muted:   "5D7B99",
  red:     "C0392B",
  green:   "1A7A4A",
  text:    "1A2A3A",
};

// ─── MASTER HELPERS ───────────────────────────────────────────────

function darkTitleSlide(slide, title, subtitle) {
  slide.background = { color: C.deep };
  // top accent bar
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.08, fill: { color: C.gold }, line: { type: "none" } });
  // left vertical stripe
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.12, h: 5.625, fill: { color: C.mid }, line: { type: "none" } });
  // bottom accent bar
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 5.45, w: 10, h: 0.175, fill: { color: C.teal }, line: { type: "none" } });

  slide.addText(title, {
    x: 0.3, y: 1.4, w: 9.4, h: 1.6,
    fontSize: 40, bold: true, color: C.white,
    fontFace: "Calibri", align: "center", valign: "middle",
    shadow: { type: "outer", blur: 6, offset: 3, angle: 45, color: "000000", opacity: 0.5 }
  });
  if (subtitle) {
    slide.addText(subtitle, {
      x: 0.3, y: 3.2, w: 9.4, h: 0.7,
      fontSize: 18, color: C.gold, fontFace: "Calibri",
      align: "center", italic: true
    });
  }
}

function sectionDivider(slide, num, title) {
  slide.background = { color: C.navy };
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.08, fill: { color: C.gold }, line: { type: "none" } });
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 5.45, w: 10, h: 0.175, fill: { color: C.teal }, line: { type: "none" } });
  slide.addShape(pres.ShapeType.rect, { x: 3.5, y: 1.2, w: 3, h: 0.06, fill: { color: C.gold }, line: { type: "none" } });
  slide.addText(`0${num}`, {
    x: 0, y: 0.6, w: 10, h: 1.2,
    fontSize: 72, bold: true, color: "FFFFFF12",
    fontFace: "Calibri", align: "center"
  });
  slide.addText(title, {
    x: 0.5, y: 1.5, w: 9, h: 2.0,
    fontSize: 32, bold: true, color: C.white,
    fontFace: "Calibri", align: "center", valign: "middle"
  });
}

function contentSlide(slide, title, bullets, opts = {}) {
  slide.background = { color: opts.bg || C.light };
  // header bar
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 1.0, fill: { color: C.mid }, line: { type: "none" } });
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0.9, w: 10, h: 0.1, fill: { color: C.gold }, line: { type: "none" } });
  slide.addText(title, {
    x: 0.3, y: 0.08, w: 9.4, h: 0.84,
    fontSize: 22, bold: true, color: C.white,
    fontFace: "Calibri", valign: "middle"
  });

  // build bullet array
  const items = bullets.map((b, i) => {
    if (typeof b === "string") {
      return { text: b, options: { bullet: { code: "25B8" }, color: C.text, fontSize: opts.fs || 16, fontFace: "Calibri", breakLine: i < bullets.length - 1 } };
    }
    // { text, sub } for sub-bullets
    return { text: b.text, options: { bullet: { code: "25B8" }, color: C.text, fontSize: opts.fs || 16, bold: b.bold || false, fontFace: "Calibri", breakLine: true } };
  });

  slide.addText(items, {
    x: 0.35, y: 1.1, w: 9.3, h: 4.35,
    valign: "top", lineSpacingMultiple: 1.25
  });
}

function twoColSlide(slide, title, leftBullets, rightBullets, leftHead, rightHead) {
  slide.background = { color: C.light };
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 1.0, fill: { color: C.navy }, line: { type: "none" } });
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0.9, w: 10, h: 0.1, fill: { color: C.amber }, line: { type: "none" } });
  slide.addText(title, {
    x: 0.3, y: 0.08, w: 9.4, h: 0.84,
    fontSize: 22, bold: true, color: C.white, fontFace: "Calibri", valign: "middle"
  });

  // left column header
  slide.addShape(pres.ShapeType.rect, { x: 0.3, y: 1.1, w: 4.4, h: 0.42, fill: { color: C.teal }, line: { type: "none" }, rounding: true });
  slide.addText(leftHead, { x: 0.3, y: 1.1, w: 4.4, h: 0.42, fontSize: 14, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle" });

  // right column header
  slide.addShape(pres.ShapeType.rect, { x: 5.3, y: 1.1, w: 4.4, h: 0.42, fill: { color: C.amber }, line: { type: "none" }, rounding: true });
  slide.addText(rightHead, { x: 5.3, y: 1.1, w: 4.4, h: 0.42, fontSize: 14, bold: true, color: C.white, fontFace: "Calibri", align: "center", valign: "middle" });

  // divider
  slide.addShape(pres.ShapeType.line, { x: 4.98, y: 1.1, w: 0, h: 4.35, line: { color: C.muted, width: 1, dashType: "dash" } });

  const makeBullets = (arr) => arr.map((b, i) => ({
    text: typeof b === "string" ? b : b.text,
    options: { bullet: { code: "25CF" }, color: C.text, fontSize: 14, fontFace: "Calibri", breakLine: i < arr.length - 1 }
  }));

  slide.addText(makeBullets(leftBullets), { x: 0.35, y: 1.62, w: 4.45, h: 3.85, valign: "top", lineSpacingMultiple: 1.3 });
  slide.addText(makeBullets(rightBullets), { x: 5.35, y: 1.62, w: 4.45, h: 3.85, valign: "top", lineSpacingMultiple: 1.3 });
}

function tableSlide(slide, title, headers, rows, colW) {
  slide.background = { color: C.offwhite };
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 1.0, fill: { color: C.mid }, line: { type: "none" } });
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0.9, w: 10, h: 0.1, fill: { color: C.gold }, line: { type: "none" } });
  slide.addText(title, {
    x: 0.3, y: 0.08, w: 9.4, h: 0.84,
    fontSize: 22, bold: true, color: C.white, fontFace: "Calibri", valign: "middle"
  });

  const tableData = [
    headers.map(h => ({ text: h, options: { bold: true, color: C.white, fill: C.navy, align: "center", fontSize: 13, fontFace: "Calibri" } })),
    ...rows.map((row, ri) => row.map(cell => ({
      text: cell,
      options: { color: C.text, fill: ri % 2 === 0 ? "DDEEFF" : C.white, fontSize: 12, fontFace: "Calibri" }
    })))
  ];

  slide.addTable(tableData, {
    x: 0.3, y: 1.1, w: 9.4, colW: colW || Array(headers.length).fill(9.4 / headers.length),
    border: { type: "solid", color: C.muted, pt: 0.5 },
    rowH: 0.45
  });
}

function keyFactBox(slide, title, facts, color) {
  slide.background = { color: C.deep };
  slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.08, fill: { color: C.gold }, line: { type: "none" } });
  slide.addText(title, {
    x: 0.3, y: 0.18, w: 9.4, h: 0.8,
    fontSize: 24, bold: true, color: C.gold, fontFace: "Calibri", valign: "middle"
  });

  facts.forEach((f, i) => {
    const row = Math.floor(i / 2);
    const col = i % 2;
    const x = col === 0 ? 0.3 : 5.2;
    const y = 1.1 + row * 1.35;
    slide.addShape(pres.ShapeType.roundRect, {
      x, y, w: 4.55, h: 1.15,
      fill: { color: color || C.mid },
      line: { color: C.gold, pt: 1.5 }
    });
    slide.addText(f, {
      x: x + 0.12, y: y + 0.08, w: 4.3, h: 1.0,
      fontSize: 13, color: C.white, fontFace: "Calibri", valign: "middle", align: "left"
    });
  });
}

// ─── SLIDES START ─────────────────────────────────────────────────

// Slide 1 – Main Title
let s = pres.addSlide();
darkTitleSlide(s, "EPILEPSY & SEIZURE DISORDERS", "Definition · Epidemiology · Pathophysiology · Investigation · Management · Prevention");
s.addText("A Comprehensive Medical Review", {
  x: 0.3, y: 3.9, w: 9.4, h: 0.5, fontSize: 14, color: C.muted, fontFace: "Calibri", align: "center", italic: true
});
s.addText("Source: Adams & Victor's Neurology | Harrison's | Bradley & Daroff's | Katzung Pharmacology", {
  x: 0.3, y: 5.0, w: 9.4, h: 0.35, fontSize: 10, color: C.muted, fontFace: "Calibri", align: "center"
});

// Slide 2 – Table of Contents
s = pres.addSlide();
s.background = { color: C.light };
slide_toc(s);

function slide_toc(sl) {
  sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 1.0, fill: { color: C.mid }, line: { type: "none" } });
  sl.addShape(pres.ShapeType.rect, { x: 0, y: 0.9, w: 10, h: 0.1, fill: { color: C.gold }, line: { type: "none" } });
  sl.addText("Table of Contents", { x: 0.3, y: 0.08, w: 9.4, h: 0.84, fontSize: 22, bold: true, color: C.white, fontFace: "Calibri", valign: "middle" });

  const sections = [
    ["01", "Definition & Terminology", "Slides 3–6"],
    ["02", "Epidemiology", "Slides 7–10"],
    ["03", "Pathophysiology", "Slides 11–16"],
    ["04", "Classification", "Slides 17–21"],
    ["05", "Investigation", "Slides 22–27"],
    ["06", "Management", "Slides 28–38"],
    ["07", "Prevention", "Slides 39–43"],
    ["08", "Special Situations & Summary", "Slides 44–50"],
  ];
  sections.forEach(([num, sec, range], i) => {
    const col = i % 2;
    const row = Math.floor(i / 2);
    const x = col === 0 ? 0.3 : 5.2;
    const y = 1.2 + row * 1.05;
    sl.addShape(pres.ShapeType.rect, { x, y, w: 0.55, h: 0.65, fill: { color: C.navy }, line: { type: "none" } });
    sl.addText(num, { x, y, w: 0.55, h: 0.65, fontSize: 16, bold: true, color: C.gold, fontFace: "Calibri", align: "center", valign: "middle" });
    sl.addText(sec, { x: x + 0.65, y: y + 0.02, w: 3.6, h: 0.35, fontSize: 14, bold: true, color: C.text, fontFace: "Calibri" });
    sl.addText(range, { x: x + 0.65, y: y + 0.32, w: 3.6, h: 0.3, fontSize: 11, color: C.muted, fontFace: "Calibri", italic: true });
  });
}

// ═══════════════════ SECTION 1 – DEFINITION ═══════════════════════

// Slide 3 – Section Divider
s = pres.addSlide();
sectionDivider(s, 1, "Definition & Terminology");

// Slide 4 – What is a Seizure?
s = pres.addSlide();
contentSlide(s, "What is a Seizure?", [
  "A seizure is a paroxysmal event caused by abnormal, excessive, and hypersynchronous electrical discharge of a population of cortical neurons",
  "May manifest as: alteration of consciousness, involuntary movements, sensory disturbances, autonomic dysfunction, or psychic phenomena",
  "The term 'convulsion' refers specifically to intense, involuntary repetitive muscular contractions — not all seizures are convulsive",
  "'Seizure' is the preferred generic term because it embraces all paroxysmal electrical discharges of the brain",
  "A 'nonconvulsive seizure' may impair consciousness without any abnormal motor activity — clinically underrecognized",
  "Seizure ≠ Epilepsy: a single isolated seizure does not constitute epilepsy",
]);

// Slide 5 – What is Epilepsy?
s = pres.addSlide();
contentSlide(s, "What is Epilepsy?", [
  "Epilepsy = a chronic neurological condition characterized by recurrent unprovoked seizures",
  "ILAE 2014 Operational Definition: at least two unprovoked seizures >24 hours apart, OR one unprovoked seizure with ≥60% risk of recurrence over the next 10 years",
  "The word derives from Greek — 'to seize upon' or 'taking hold of'; historically called the 'falling sickness'",
  "Hughlings Jackson (1870): seizures result from 'an excessive and disorderly discharge of cerebral nervous tissue on muscles'",
  "Epilepsy Resolved: a patient is seizure-free for the last 10 years, with no AEDs for the last 5 years",
  "Must be distinguished from provoked/acute symptomatic seizures (fever, toxins, acute CNS injury)",
]);

// Slide 6 – Key Terminology
s = pres.addSlide();
tableSlide(s, "Key Terminology", ["Term", "Old Term", "Definition"], [
  ["Focal aware seizure", "Simple partial seizure", "Focal onset, consciousness preserved"],
  ["Focal impaired awareness", "Complex partial seizure", "Focal onset, consciousness impaired"],
  ["Focal to bilateral tonic-clonic", "Secondarily generalized", "Focal onset evolving to bilateral convulsion"],
  ["Absence seizure", "Petit mal", "Brief lapse of consciousness, 3 Hz spike-wave"],
  ["Tonic-clonic seizure", "Grand mal", "Bilateral tonic then clonic phases with LOC"],
  ["Status epilepticus", "—", "Seizure ≥5 min or ≥2 seizures without recovery"],
  ["Aura", "Aura", "Subjective initial phase of a focal seizure"],
  ["Todd's paralysis", "Todd's palsy", "Transient post-ictal focal motor deficit"],
], [2.5, 2.5, 4.4]);

// ═══════════════════ SECTION 2 – EPIDEMIOLOGY ══════════════════════

// Slide 7 – Section Divider
s = pres.addSlide();
sectionDivider(s, 2, "Epidemiology");

// Slide 8 – Global Burden
s = pres.addSlide();
contentSlide(s, "Global Burden of Epilepsy", [
  "~50 million people worldwide have epilepsy — one of the most common neurological disorders",
  "Incidence: ~44 new cases per 100,000 persons per year (USA); ~68–190/100,000 in low-income countries",
  "Prevalence: ~1% of the general population; ~2 million individuals in the United States",
  "Slightly less than 1% of all persons will develop epilepsy by age 20 years (Hauser & Annegers, 1992)",
  "Over two-thirds of all epileptic seizures begin in childhood — most in the first year of life",
  "Second peak: incidence rises again after age 60 years — strongly associated with cerebrovascular disease",
  "Epilepsy treatment gap: >75% of people with epilepsy in low-income countries never receive treatment",
]);

// Slide 9 – Age & Sex Distribution
s = pres.addSlide();
twoColSlide(s,
  "Age & Sex Distribution",
  [
    "Bimodal age distribution: peaks in infancy/childhood and >60 years",
    "First year of life: highest incidence of any age group",
    "Children: widest array of seizure forms",
    "Adults 20–60 yrs: lower incidence period",
    "Elderly: second incidence peak — stroke is leading cause",
    "Pediatric epilepsy: major cause in pediatric neurology practice",
  ],
  [
    "Overall: slightly higher in males",
    "Genetic epilepsies: often female predominance (e.g., Dravet, JME)",
    "Childhood absence epilepsy: 2:1 female:male",
    "Tuberous sclerosis: equal sex distribution",
    "Pregnancy: seizure frequency may increase due to hormonal & pharmacokinetic changes",
    "Catamenial epilepsy: seizure exacerbation at specific menstrual cycle phases",
  ],
  "Age Patterns", "Sex Patterns"
);

// Slide 10 – Etiology Overview
s = pres.addSlide();
contentSlide(s, "Etiology of Epilepsy", [
  "STRUCTURAL: cortical dysplasia, hippocampal sclerosis, post-traumatic scar, tumor, vascular malformation",
  "GENETIC: ion channel mutations (SCN1A, KCNQ2, CHRNA4), syndromic epilepsies — majority of idiopathic epilepsy",
  "INFECTIOUS: encephalitis (HSV, CMV), neurocysticercosis (leading cause globally), cerebral abscess, HIV",
  "METABOLIC: hypoglycemia, hyponatremia, hypocalcemia, uremia, pyridoxine deficiency, mitochondrial disease",
  "IMMUNE: anti-NMDAR encephalitis, LGI1, GABA-B antibodies — increasingly recognized",
  "UNKNOWN: ~30% of epilepsy cases remain without identifiable cause after thorough investigation",
  "Note: 'idiopathic' now increasingly equated with genetic etiology (ILAE 2017)",
], { fs: 14 });

// ═══════════════════ SECTION 3 – PATHOPHYSIOLOGY ═══════════════════

// Slide 11 – Section Divider
s = pres.addSlide();
sectionDivider(s, 3, "Pathophysiology");

// Slide 12 – Basic Mechanisms
s = pres.addSlide();
contentSlide(s, "Cellular Mechanisms of Seizure Generation", [
  "Seizures result from an imbalance between EXCITATORY (glutamatergic) and INHIBITORY (GABAergic) neurotransmission",
  "Normal: GABA-mediated Cl⁻ influx hyperpolarizes neurons → inhibition",
  "Pathological: excess glutamate (AMPA, NMDA receptors) → sustained depolarization → paroxysmal depolarization shift (PDS)",
  "PDS: hallmark of ictal neuronal firing — a large all-or-none depolarization followed by prolonged hyperpolarization",
  "Voltage-gated Na⁺ channels: rapid repetitive firing is normally limited by fast inactivation — AEDs target this",
  "Voltage-gated Ca²⁺ channels (T-type): low-threshold T-channels in thalamus generate 3 Hz spike-wave (absence seizures)",
  "K⁺ channels: reduced outward K⁺ current → increased excitability (KCNQ mutations)",
]);

// Slide 13 – Network Mechanisms
s = pres.addSlide();
contentSlide(s, "Network & Synaptic Mechanisms", [
  "Seizure requires failure of BOTH cellular control AND network inhibition",
  "Inhibitory interneurons (PV+ basket cells, SST+ cells) normally terminate excessive firing via GABA-A and GABA-B receptors",
  "Recruitment: focal ictal discharge recruits adjacent neurons via recurrent collaterals → focal spread",
  "Generalization: via thalamocortical loops and corpus callosum → bilateral seizure propagation",
  "Afterdischarge: neuronal firing outlasts the initial stimulus due to reverberant circuits",
  "Synaptic vesicle protein SV2A: involved in vesicle docking and modulating neurotransmitter release — target of levetiracetam",
  "mTOR pathway: overactivation causes cortical dysplasia and epileptogenesis (tuberous sclerosis, FMRP loss)",
]);

// Slide 14 – Epileptogenesis
s = pres.addSlide();
contentSlide(s, "Epileptogenesis", [
  "Epileptogenesis = the process by which the brain is transformed from normal to one capable of generating spontaneous recurrent seizures",
  "Latent period after brain injury (trauma, ischemia, encephalitis) precedes first spontaneous seizure — days to years",
  "Hippocampal sclerosis: loss of CA1 and CA3 neurons, mossy fiber sprouting → re-entrant excitatory circuits",
  "Cortical dysplasia: abnormal lamination, balloon cells — inherently hyperexcitable due to dysmature neurons with persistent NR2B",
  "Ion channel remodeling: downregulation of inhibitory Kv4.2 K⁺ channels; upregulation of HCN channels (Ih)",
  "Neuroinflammation: IL-1β, TNF-α, COX-2 → increased neuronal excitability; blood-brain barrier disruption",
  "Genetic epilepsies: ion channel mutations → persistent Na⁺ channel opening (gain-of-function) or reduced GABA-A function (loss-of-function)",
]);

// Slide 15 – Generalized vs Focal Mechanisms
s = pres.addSlide();
twoColSlide(s,
  "Focal vs Generalized Seizure Mechanisms",
  [
    "Originates in localized cortical region (seizure focus)",
    "Often structural cause: scar, dysplasia, tumor, hippocampal sclerosis",
    "Focal EEG onset: spike / sharp wave at specific electrode",
    "Jacksonian march: seizure spreads along motor homunculus",
    "May generalize via commissural pathways",
    "Todd's paralysis reflects focal cortical exhaustion",
    "Surgery more applicable if focus well-defined",
  ],
  [
    "Involves both hemispheres simultaneously from onset",
    "Usually genetic/idiopathic; thalamocortical network",
    "Thalamus drives cortical synchrony (spike-wave bursts)",
    "T-type Ca²⁺ channels: key in absence seizures (3 Hz)",
    "Reticular thalamic nucleus: pacemaker of absence",
    "Generalized EEG: bilateral synchronous discharge",
    "Responds to broad-spectrum AEDs (valproate, lamotrigine)",
  ],
  "Focal Seizures", "Generalized Seizures"
);

// Slide 16 – Status Epilepticus Mechanisms
s = pres.addSlide();
contentSlide(s, "Pathophysiology of Status Epilepticus", [
  "Status Epilepticus (SE): seizure lasting ≥5 minutes OR ≥2 seizures without full consciousness recovery between",
  "Mechanism: failure of seizure termination — downregulation and internalization of GABA-A receptors during prolonged seizure",
  "Progressive pharmacoresistance: GABA-A receptor subunit composition shifts → reduced benzodiazepine efficacy over time",
  "NMDA receptors increase on cell surface — further excitation",
  "Systemic consequences: hyperthermia, hypoxia, lactic acidosis, rhabdomyolysis, aspiration",
  "Neuronal injury: sustained glutamate release → Ca²⁺ influx → caspase activation → apoptosis (CA1 most vulnerable)",
  "Time-sensitive: treat within 5 min; irreversible injury accelerates after 30 min of convulsive SE",
]);

// ═══════════════════ SECTION 4 – CLASSIFICATION ════════════════════

// Slide 17 – Section intro within classification
s = pres.addSlide();
s.background = { color: C.light };
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 1.0, fill: { color: C.mid }, line: { type: "none" } });
s.addShape(pres.ShapeType.rect, { x: 0, y: 0.9, w: 10, h: 0.1, fill: { color: C.gold }, line: { type: "none" } });
s.addText("ILAE 2017 Seizure Classification", { x: 0.3, y: 0.08, w: 9.4, h: 0.84, fontSize: 22, bold: true, color: C.white, fontFace: "Calibri", valign: "middle" });
s.addText("The ILAE 2017 operational classification maintains focal vs generalized onset but replaces 'partial' with 'focal' and introduces 'unknown onset' category.", {
  x: 0.35, y: 1.1, w: 9.3, h: 0.8, fontSize: 15, color: C.text, fontFace: "Calibri", italic: true
});

const classRows = [
  ["FOCAL ONSET", "Aware", "Motor: automatisms, clonic, tonic, myoclonic, spasms / Non-motor: autonomic, cognitive, sensory, emotional"],
  ["FOCAL ONSET", "Impaired Awareness", "Focal impaired awareness seizure (formerly complex partial)"],
  ["FOCAL ONSET", "→ Bilateral T-C", "Focal to bilateral tonic-clonic (formerly secondary generalized)"],
  ["GENERALIZED", "Motor", "Tonic-clonic, clonic, tonic, myoclonic, myoclonic-tonic-clonic, atonic, epileptic spasms"],
  ["GENERALIZED", "Non-motor", "Absence (typical, atypical, myoclonic), eyelid myoclonia"],
  ["UNKNOWN ONSET", "Motor", "Tonic-clonic, epileptic spasms"],
  ["UNKNOWN ONSET", "Non-motor", "Behavior arrest"],
];
s.addTable(
  [
    [
      { text: "Onset Type", options: { bold: true, color: C.white, fill: C.navy, fontSize: 13, fontFace: "Calibri" } },
      { text: "Awareness", options: { bold: true, color: C.white, fill: C.navy, fontSize: 13, fontFace: "Calibri" } },
      { text: "Subtypes", options: { bold: true, color: C.white, fill: C.navy, fontSize: 13, fontFace: "Calibri" } }
    ],
    ...classRows.map((row, ri) => row.map(cell => ({
      text: cell,
      options: { color: C.text, fill: ri % 2 === 0 ? "DDEEFF" : C.white, fontSize: 11, fontFace: "Calibri" }
    })))
  ],
  { x: 0.3, y: 1.95, w: 9.4, colW: [1.8, 1.8, 5.8], border: { type: "solid", color: C.muted, pt: 0.5 }, rowH: 0.42 }
);

// Slide 18 – Focal Seizures Detail
s = pres.addSlide();
contentSlide(s, "Focal Seizures — Clinical Features", [
  "AURA: subjective initial phase — epigastric rising (TL), flashing lights (occipital), tingling (parietal), deja vu (TL amygdala)",
  "Focal aware motor: Jacksonian march — clonic jerking spreads from hand → arm → face over 20–30s",
  "Adversive/versive seizure: forced head and eye deviation, usually contralateral to focus",
  "Temporal lobe (most common focal epilepsy): staring, oral automatisms (lip smacking, chewing), manual automatisms",
  "Frontal lobe: brief, hypermotor (cycling leg movements), nocturnal, bizarre postures; supplementary motor area = tonic fencing posture",
  "Parietal: contralateral tingling, numbness, rarely pain; positive or negative sensory phenomena",
  "Occipital: elementary visual hallucinations (colored circles/lines), ictal blindness, eye deviation",
], { fs: 14 });

// Slide 19 – Generalized Seizures Detail
s = pres.addSlide();
contentSlide(s, "Generalized Seizures — Clinical Features", [
  "TONIC-CLONIC (Grand Mal): tonic phase (10–20s stiffening, cry, apnea) → clonic phase (rhythmic jerks, 1–2 min) → post-ictal confusion/Todd's",
  "ABSENCE (Petit Mal): abrupt-onset staring, cessation of activity, 5–15 seconds, eyelid flickering, no post-ictal; hallmark 3 Hz spike-and-wave on EEG",
  "MYOCLONIC: sudden, brief bilateral muscle jerks — arms > legs; typically in morning; preserved consciousness; associated with JME",
  "TONIC: sustained stiffening (1–20s) — axial > limb; nocturnal; associated with Lennox-Gastaut syndrome",
  "ATONIC (Drop attacks): sudden loss of muscle tone → fall injury; seen in Lennox-Gastaut and Dravet syndrome",
  "CLONIC: rhythmic jerking without preceding tonic phase — less common; may be asymmetric",
  "EPILEPTIC SPASMS: sudden axial flexion/extension — infantile spasms (West syndrome); peak onset 3–12 months",
]);

// Slide 20 – Epilepsy Syndromes
s = pres.addSlide();
tableSlide(s, "Common Epilepsy Syndromes", ["Syndrome", "Age Onset", "Seizure Type", "EEG", "Prognosis"],
[
  ["Childhood Absence", "4–12 yrs", "Absence", "3 Hz spike-wave", "Remits in adolescence"],
  ["Juvenile Myoclonic (JME)", "12–18 yrs", "Myoclonic + T-C", "4–6 Hz polyspike-wave", "Lifelong; responds to VPA"],
  ["Benign Rolandic (BECTS)", "4–10 yrs", "Focal motor/oral", "Centrotemporal spikes", "Remits by age 16"],
  ["West Syndrome", "3–12 mo", "Infantile spasms", "Hypsarrhythmia", "Poor; underlying disease"],
  ["Dravet Syndrome", "<1 yr", "Febrile/multifocal", "Generalized spike-wave", "Severe; SCN1A mutation"],
  ["Lennox-Gastaut", "1–8 yrs", "Mixed (tonic, atonic)", "Slow spike-wave <2.5 Hz", "Poor; drug-resistant"],
], [2.0, 1.2, 1.8, 2.0, 2.4]);

// Slide 21 – Status Epilepticus Classification
s = pres.addSlide();
contentSlide(s, "Status Epilepticus — Classification", [
  "CONVULSIVE SE (CSE): generalized tonic-clonic; medical emergency with highest morbidity/mortality",
  "NONCONVULSIVE SE (NCSE): impaired consciousness/confusion without prominent motor signs — only diagnosable by EEG",
  "FOCAL SE (Epilepsia Partialis Continua): continuous focal motor activity without loss of consciousness",
  "ABSENCE SE: prolonged absence state — twilight consciousness, responsive to IV benzodiazepine",
  "REFRACTORY SE: failure to respond to adequate doses of ≥2 AEDs including a benzodiazepine",
  "SUPER-REFRACTORY SE: SE continuing ≥24 hours despite anesthetic treatment; mortality ~30–40%",
  "Time thresholds: operational (treat at 5 min) vs conceptual (possible neuronal injury at 30 min)",
]);

// ═══════════════════ SECTION 5 – INVESTIGATION ═════════════════════

// Slide 22 – Section Divider
s = pres.addSlide();
sectionDivider(s, 5, "Investigation");

// Slide 23 – Initial Assessment
s = pres.addSlide();
contentSlide(s, "Initial Assessment After First Seizure", [
  "HISTORY: detailed description from witness — onset, duration, aura, postictal state, past episodes",
  "Key questions: provoked (fever, drugs, alcohol withdrawal, metabolic) vs unprovoked? First ever or recurrence?",
  "PHYSICAL EXAM: vital signs, tongue bite, incontinence, focal deficits (Todd's palsy), meningism",
  "Immediate bloods: glucose (STAT), Na⁺, K⁺, Ca²⁺, Mg²⁺, urea, creatinine, LFTs, FBC, CRP",
  "Arterial or venous blood gas: check pH, lactate (post-ictal acidosis is supportive but non-specific)",
  "Urine/serum toxicology: rule out drug intoxication or withdrawal",
  "Prolactin: elevated 10–20 min post-ictal in ~60% of GTC seizures; useful adjunct but not diagnostic",
]);

// Slide 24 – EEG
s = pres.addSlide();
contentSlide(s, "Electroencephalography (EEG)", [
  "EEG is the primary investigation for seizure characterization and epilepsy diagnosis",
  "Epilepsy is a CLINICAL diagnosis — EEG cannot confirm or exclude it with certainty",
  "Interictal EEG: epileptiform discharges (spikes, sharp waves, spike-wave complexes) support diagnosis",
  "Normal interictal EEG does NOT exclude epilepsy — sensitivity ~50% for single routine recording",
  "Repeat EEG or sleep-deprived EEG increases sensitivity to ~80–90%",
  "Ictal EEG (recording during seizure): definitively confirms and classifies seizure type",
  "Continuous EEG monitoring (cEEG): essential in ICU for nonconvulsive SE, post-cardiac arrest, comatose patients",
  "Video-EEG telemetry: gold standard for pre-surgical evaluation and distinguishing epileptic from non-epileptic events",
], { fs: 14 });

// Slide 25 – EEG Patterns
s = pres.addSlide();
tableSlide(s, "Key EEG Patterns in Epilepsy", ["Condition", "Characteristic EEG Pattern"],
[
  ["Childhood Absence Epilepsy", "3 Hz generalized spike-and-wave; paroxysmal; abrupt onset/offset"],
  ["Juvenile Myoclonic Epilepsy", "4–6 Hz polyspike-wave complexes; photosensitivity common"],
  ["Temporal Lobe Epilepsy", "Interictal: anterior temporal spikes/sharp waves; ictal: rhythmic theta"],
  ["West Syndrome", "Hypsarrhythmia — chaotic high-amplitude slow waves with multifocal spikes"],
  ["Lennox-Gastaut", "Slow (<2.5 Hz) spike-wave complexes; paroxysmal fast activity in sleep"],
  ["Benign Rolandic (BECTS)", "High-amplitude centrotemporal spikes; normal background; sleep-activated"],
  ["Generalized Tonic-Clonic", "Ictal: 10 Hz fast activity → polyspikes → post-ictal generalized slowing"],
  ["Nonconvulsive SE", "Continuous or near-continuous spike-wave, rhythmic delta, or PDs on EEG"],
], [4.5, 4.9]);

// Slide 26 – Neuroimaging
s = pres.addSlide();
contentSlide(s, "Neuroimaging in Epilepsy", [
  "MRI BRAIN (preferred): indicated in all new-onset epilepsy except classic idiopathic syndromes (JME, CAE)",
  "Epilepsy protocol MRI: thin-slice T1 (volumetric), FLAIR, T2, coronal hippocampal sequences",
  "Key findings: hippocampal sclerosis (T2 hyperintensity + atrophy), focal cortical dysplasia (transmantle sign), tumors, AVM",
  "CT BRAIN: fast, available — for acute settings (post-ictal, head trauma, suspected intracranial hemorrhage)",
  "CT may miss subtle dysplasia, small cavernomas, low-grade tumors — MRI is superior for epilepsy workup",
  "FDG-PET: hypometabolism at seizure focus (interictal) — useful when MRI is negative in pre-surgical eval",
  "SPECT (ictal): hyperperfusion at seizure focus; subtraction ictal SPECT co-registered to MRI (SISCOM) increases accuracy",
]);

// Slide 27 – Additional Investigations
s = pres.addSlide();
contentSlide(s, "Additional Investigations", [
  "LUMBAR PUNCTURE: if CNS infection suspected (fever, meningism, immunocompromised); send CSF for cells, protein, glucose, culture, HSV PCR",
  "AUTOIMMUNE PANEL: anti-NMDAR, LGI1, CASPR2, GABA-B antibodies — for new-onset refractory epilepsy or encephalitis",
  "GENETIC TESTING: gene panel or WES for early-onset epilepsy, suspected genetic syndrome (Dravet: SCN1A mutation)",
  "METABOLIC SCREEN (pediatric): amino acids, organic acids, lactate, ammonia, biotinidase, GLUT1 deficiency",
  "NEUROPSYCHOLOGICAL ASSESSMENT: cognitive mapping prior to surgery; identifies language/memory lateralization",
  "CARDIAC ECG/HOLTER: exclude channelopathies (LQTS) causing syncopal events mimicking seizures",
  "THERAPEUTIC DRUG MONITORING: AED levels help assess compliance, toxicity, and pharmacokinetic interactions",
]);

// ═══════════════════ SECTION 6 – MANAGEMENT ═══════════════════════

// Slide 28 – Section Divider
s = pres.addSlide();
sectionDivider(s, 6, "Management");

// Slide 29 – General Principles
s = pres.addSlide();
contentSlide(s, "General Principles of Management", [
  "Goal: COMPLETE SEIZURE FREEDOM with minimal or no adverse effects from treatment",
  "Treat after second unprovoked seizure; consider after first if recurrence risk ≥60% (structural lesion, abnormal EEG, abnormal MRI)",
  "Monotherapy preferred initially — ~47% achieve seizure freedom with first AED",
  "Second AED monotherapy (after first failure): additional ~14% become seizure-free",
  "~30% of patients are drug-resistant (failure of ≥2 tolerated, appropriately dosed AEDs)",
  "Drug-resistant epilepsy: refer to epilepsy specialist/center for re-evaluation; surgical assessment if focal",
  "Lifestyle counseling: sleep hygiene, alcohol avoidance, photosensitivity precautions, driving restrictions",
]);

// Slide 30 – AED Mechanisms of Action
s = pres.addSlide();
tableSlide(s, "AED Mechanisms of Action", ["Drug", "Primary Mechanism(s)", "Main Indications"],
[
  ["Carbamazepine / Oxcarbazepine", "Na⁺ channel blockade (use-dependent)", "Focal seizures; TN"],
  ["Valproate (VPA)", "Na⁺ block, GABA↑, T-Ca²⁺ block", "Broad-spectrum (GTC, absence, myoclonic)"],
  ["Lamotrigine", "Na⁺ channel, Ca²⁺ channel block", "Focal, GTC; safe in pregnancy"],
  ["Levetiracetam", "SV2A modulation (vesicle release)", "Broad-spectrum; IV available; well tolerated"],
  ["Phenytoin / Fosphenytoin", "Na⁺ channel blockade", "SE, acute management; TDM needed"],
  ["Ethosuximide", "T-type Ca²⁺ channel block (thalamus)", "Childhood absence ONLY"],
  ["Phenobarbital", "GABA-A potentiation (barbiturate)", "Broad-spectrum; SE; neonatal seizures"],
  ["Topiramate", "Na⁺ block, AMPA↓, GABA↑, CA inhibit", "Focal, GTC, migraine"],
  ["Lacosamide", "Slow Na⁺ channel inactivation", "Focal seizures (adjunct / IV)"],
  ["Perampanel", "AMPA receptor antagonist", "Focal + GTC adjunct"],
], [2.8, 3.4, 3.2]);

// Slide 31 – First-Line AED Selection
s = pres.addSlide();
twoColSlide(s,
  "First-Line AED Selection by Seizure Type",
  [
    "FOCAL SEIZURES:",
    "→ Lamotrigine (first line — good tolerability)",
    "→ Levetiracetam (broad-spectrum, IV available)",
    "→ Carbamazepine / Oxcarbazepine",
    "→ Lacosamide (adjunct / monotherapy)",
    "",
    "GENERALIZED TONIC-CLONIC:",
    "→ Valproate (most effective — teratogenic risk)",
    "→ Lamotrigine, Levetiracetam (women/girls)",
    "→ Topiramate (alternative)",
  ],
  [
    "ABSENCE SEIZURES:",
    "→ Ethosuximide (first line — NLST trial)",
    "→ Valproate (if GTC coexist)",
    "→ Lamotrigine (less effective, second line)",
    "",
    "MYOCLONIC (JME):",
    "→ Valproate (most effective)",
    "→ Levetiracetam, Lamotrigine (women)",
    "→ AVOID: carbamazepine, oxcarbazepine (may worsen)",
  ],
  "Focal & GTC", "Absence & Myoclonic"
);

// Slide 32 – Treatment of Status Epilepticus
s = pres.addSlide();
s.background = { color: C.offwhite };
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 1.0, fill: { color: C.red }, line: { type: "none" } });
s.addShape(pres.ShapeType.rect, { x: 0, y: 0.9, w: 10, h: 0.1, fill: { color: C.gold }, line: { type: "none" } });
s.addText("Management of Convulsive Status Epilepticus", { x: 0.3, y: 0.08, w: 9.4, h: 0.84, fontSize: 20, bold: true, color: C.white, fontFace: "Calibri", valign: "middle" });

const seRows = [
  ["0–5 min", "STABILIZE", "ABC, O₂, IV access, glucose, bloods, ECG monitoring"],
  ["5–20 min", "1st LINE: Benzodiazepine", "IV lorazepam 0.1 mg/kg (max 4 mg) × 2\nOR IV diazepam 10–20 mg\nOR IM midazolam 10 mg (if no IV)"],
  ["20–40 min", "2nd LINE: AED", "IV levetiracetam 60 mg/kg (max 4500 mg)\nOR IV valproate 40 mg/kg\nOR IV fosphenytoin 20 mg PE/kg"],
  ["40–60 min", "REFRACTORY SE", "Repeat 2nd line OR try alternative 2nd line AED"],
  [">60 min", "ANESTHESIA (ICU)", "Propofol, midazolam, or thiopental infusion + continuous EEG monitoring"],
];
s.addTable(
  [
    [
      { text: "Time", options: { bold: true, color: C.white, fill: C.red, fontSize: 12, fontFace: "Calibri" } },
      { text: "Stage", options: { bold: true, color: C.white, fill: C.red, fontSize: 12, fontFace: "Calibri" } },
      { text: "Treatment", options: { bold: true, color: C.white, fill: C.red, fontSize: 12, fontFace: "Calibri" } }
    ],
    ...seRows.map((row, ri) => row.map(cell => ({
      text: cell,
      options: { color: C.text, fill: ri % 2 === 0 ? "FFE6E6" : C.white, fontSize: 11, fontFace: "Calibri" }
    })))
  ],
  { x: 0.3, y: 1.1, w: 9.4, colW: [1.2, 2.2, 6.0], border: { type: "solid", color: C.muted, pt: 0.5 }, rowH: 0.6 }
);

// Slide 33 – Surgical Management
s = pres.addSlide();
contentSlide(s, "Surgical Management of Epilepsy", [
  "Indicated in drug-resistant focal epilepsy after failure of ≥2 adequately dosed AEDs",
  "~30% of patients are drug-resistant; surgery offers 50–90% seizure-free rates for well-selected candidates",
  "Pre-surgical evaluation: video-EEG, high-resolution MRI, neuropsychology, FDG-PET, ictal SPECT, fMRI (language/memory)",
  "RESECTIVE SURGERY: temporal lobectomy (most common) — 60–70% seizure freedom at 2 years",
  "LESIONECTOMY: removal of identified structural lesion (cavernoma, low-grade tumor, focal dysplasia)",
  "CORPUS CALLOSOTOMY: for drop attacks (atonic seizures) in LGS; reduces injury from falls; palliative",
  "HEMISPHERECTOMY / HEMISPHEROTOMY: for catastrophic unihemispheric epilepsy (Rasmussen, hemiplegia)",
  "LASER INTERSTITIAL THERMAL THERAPY (LITT): minimally invasive; for mesial TLE, hypothalamic hamartoma",
]);

// Slide 34 – Neurostimulation
s = pres.addSlide();
contentSlide(s, "Neurostimulation & Dietary Therapies", [
  "VAGUS NERVE STIMULATION (VNS): FDA approved; implanted device; reduces seizure frequency ~50% in ~50% of patients; not curative",
  "RESPONSIVE NEUROSTIMULATION (RNS): detects and aborts seizures via closed-loop stimulation at focus; good for bilateral or eloquent-cortex foci",
  "DEEP BRAIN STIMULATION (DBS): anterior nucleus of thalamus (SANTE trial); ~40% median seizure reduction; approved by FDA 2018",
  "TRANSCRANIAL MAGNETIC STIMULATION (TMS): investigational; may reduce cortical excitability",
  "KETOGENIC DIET: high-fat, low-carbohydrate; metabolic adaptation → ketosis inhibits seizures; 50% reduction in >50% of patients",
  "Modified Atkins Diet / Low Glycemic Index: more tolerable alternatives for older children and adults",
  "Dietary therapies: especially effective in GLUT1 deficiency, pyruvate dehydrogenase deficiency, Dravet syndrome",
]);

// Slide 35 – Women & Epilepsy
s = pres.addSlide();
contentSlide(s, "Epilepsy in Women — Special Considerations", [
  "Catamenial epilepsy: seizure exacerbation at perimenstrual or periovulatory phase; progesterone withdrawal increases neuronal excitability",
  "Enzyme-inducing AEDs (carbamazepine, phenytoin, oxcarbazepine) reduce OCP efficacy → contraceptive failure",
  "PREGNANCY: ~1–3% risk of major fetal malformations overall; HIGHEST with valproate (6–10%) — teratogen of first choice avoidance",
  "Valproate risks: neural tube defects, cleft palate, neurodevelopmental delay (impaired IQ) — avoid in women of child-bearing age",
  "Preferred in pregnancy: lamotrigine, levetiracetam — lowest teratogenic risk; monitor serum levels (clearance increases in pregnancy)",
  "Folic acid 5 mg/day: recommended pre-conception and throughout pregnancy for all women on AEDs",
  "Breastfeeding: most AEDs compatible (levetiracetam, lamotrigine, carbamazepine); avoid phenobarbital, benzodiazepines",
]);

// Slide 36 – Elderly & Pediatric
s = pres.addSlide();
twoColSlide(s,
  "Epilepsy in Special Populations",
  [
    "ELDERLY PATIENTS:",
    "→ Most common new-onset epilepsy in >60 yrs",
    "→ Stroke is #1 cause; also AD, tumor, SDH",
    "→ Start low, go slow — drug interactions, falls risk",
    "→ Lamotrigine, levetiracetam preferred",
    "→ Avoid carbamazepine (hyponatremia, cardiac)",
    "→ AED-osteoporosis interaction: Ca + Vit D supplementation",
  ],
  [
    "PEDIATRIC PATIENTS:",
    "→ Febrile seizures: benign in most; 2–5% risk of epilepsy",
    "→ Infantile spasms (West): ACTH or vigabatrin first-line",
    "→ Neonatal seizures: phenobarbital first-line",
    "→ Valproate: avoid <2 yrs (hepatotoxicity risk)",
    "→ Behavioral/cognitive side effects important",
    "→ Many childhood epilepsies are self-limited",
  ],
  "Elderly", "Pediatric"
);

// Slide 37 – Drug-Resistant Epilepsy
s = pres.addSlide();
contentSlide(s, "Drug-Resistant Epilepsy", [
  "Definition (ILAE): failure of adequate trials of ≥2 tolerated, appropriately chosen and dosed AED schedules",
  "~30% of patients with epilepsy are drug-resistant",
  "Before labeling drug-resistant: confirm diagnosis (rule out PNES), check compliance, optimize current therapy",
  "Investigation: repeat MRI (3T), video-EEG, metabolic/genetic re-evaluation, autoimmune panel",
  "Surgical evaluation: referral to epilepsy center — 50–90% seizure-free rates with resective surgery in selected patients",
  "Novel therapies: mTOR inhibitors (everolimus for TSC), quinidine (KCNT1 mutations), CBD (Epidiolex — Dravet, LGS)",
  "Cannabidiol (CBD): FDA-approved for Dravet and Lennox-Gastaut; reduces seizures by ~40%",
]);

// Slide 38 – AED Side Effects & Monitoring
s = pres.addSlide();
tableSlide(s, "AED Side Effects & Monitoring", ["Drug", "Key Adverse Effects", "Monitoring"],
[
  ["Valproate", "Weight gain, tremor, alopecia, PCOS, hepatotoxicity (rare), pancreatitis, teratogen", "LFTs, NH₃, FBC; avoid pregnancy"],
  ["Carbamazepine", "Diplopia, ataxia, hyponatremia, rash, SJS (HLA-B*1502)", "Na⁺, FBC, LFTs, ECG; HLA test"],
  ["Lamotrigine", "Rash (2–3%), SJS risk with rapid titration; insomnia, dizziness", "Slow titration (esp. with VPA)"],
  ["Phenytoin", "Nystagmus, ataxia, gingival hyperplasia, hirsutism, cerebellar atrophy", "Levels, FBC, LFTs"],
  ["Levetiracetam", "Irritability, aggression, depression (10–15%); generally well tolerated", "Renal function (renally cleared)"],
  ["Topiramate", "Cognitive slowing ('dopamax'), kidney stones, metabolic acidosis, weight loss, glaucoma", "Bicarbonate, eye exam"],
  ["Phenobarbital", "Sedation, cognitive slowing, dependence, paradoxical hyperactivity in children", "Levels; liver enzymes"],
], [1.8, 4.2, 3.4]);

// ═══════════════════ SECTION 7 – PREVENTION ═══════════════════════

// Slide 39 – Section Divider
s = pres.addSlide();
sectionDivider(s, 7, "Prevention");

// Slide 40 – Primary Prevention
s = pres.addSlide();
contentSlide(s, "Primary Prevention of Epilepsy", [
  "ADDRESS MODIFIABLE CAUSES: ~25% of epilepsy is potentially preventable through known risk factor reduction",
  "PERINATAL CARE: skilled birth attendance, prevention of birth asphyxia, neonatal jaundice management",
  "IMMUNIZATION: prevent encephalitis (measles, JE, meningitis vaccines); neurocysticercosis prevention via sanitation",
  "TRAUMATIC BRAIN INJURY: helmet use (cycling, motorcycle), seatbelts, fall prevention in elderly",
  "CEREBROVASCULAR DISEASE: control of hypertension, diabetes, hyperlipidemia, AF — reduces post-stroke epilepsy risk",
  "SUBSTANCE ABUSE: alcohol cessation (withdrawal seizures), avoid illicit drugs",
  "INTRAUTERINE: folic acid pre-conception reduces NTDs; avoid teratogenic drugs; adequate nutrition",
]);

// Slide 41 – Secondary Prevention (after first seizure)
s = pres.addSlide();
contentSlide(s, "Secondary Prevention — After First Seizure", [
  "Decision to treat after first seizure based on recurrence risk assessment:",
  "HIGH RISK (treat): structural brain lesion, abnormal MRI, epileptiform EEG, focal deficit, nocturnal seizure, family history",
  "LOW RISK (observe): normal MRI, normal EEG, provoked seizure, no family history",
  "ECLAM score / other risk tools: quantify recurrence probability to guide individualized treatment",
  "Lifestyle modifications: regular sleep schedule, limit alcohol, avoid flashing lights (photosensitive), stress reduction",
  "DRIVING RESTRICTIONS: seizure-free period required (6 months–2 years depending on jurisdiction) — counsel all patients",
  "Patient education: recognize seizure triggers, medication compliance, first aid for bystanders",
]);

// Slide 42 – Prevention of Seizure-Related Injury
s = pres.addSlide();
contentSlide(s, "Prevention of Seizure-Related Injury", [
  "FIRST AID: stay calm, protect head, do NOT restrain, do NOT put anything in mouth, position on side",
  "Call emergency services if: seizure >5 min, no recovery, injury, first-ever seizure, second seizure soon after, in water",
  "WATER SAFETY: supervision during bathing and swimming; prefer showers; never swim alone",
  "HEIGHTS & MACHINERY: avoid working at heights, operating heavy machinery or power tools until well-controlled",
  "KITCHEN SAFETY: use back burners, microwave cooking, avoid open flames where possible",
  "SPORTS: most sports permitted with supervision; contact sports — individual risk assessment; no solo diving/rock climbing",
  "RESCUE MEDICATION: prescribe buccal/nasal midazolam or rectal diazepam for prolonged seizure management at home",
]);

// Slide 43 – Prevention of SUDEP
s = pres.addSlide();
contentSlide(s, "Prevention of SUDEP (Sudden Unexpected Death in Epilepsy)", [
  "SUDEP: leading cause of epilepsy-related premature death; incidence ~1:1000 patient-years",
  "Highest risk: drug-resistant epilepsy, frequent nocturnal GTC seizures, males, early onset, GABAergic medications",
  "MECHANISM: postictal cardiorespiratory depression — laryngospasm, central apnea, cardiac arrhythmia",
  "PROVEN PROTECTIVE FACTOR: seizure freedom (especially GTC seizures) dramatically reduces SUDEP risk",
  "Nocturnal supervision: bed sensors/monitors alert caregivers to nocturnal seizures",
  "SMART: monitor devices (Emfit, EarlySense, SmartWatch) — FDA cleared; detect convulsive seizures",
  "Prone position post-ictally is a RISK FACTOR — advise lateral/supine positioning after seizure",
  "Counsel patients and families openly about SUDEP risk — evidence-based and recommended by ILAE",
]);

// ═══════════════════ SECTION 8 – SPECIAL / SUMMARY ════════════════

// Slide 44 – Section Divider
s = pres.addSlide();
sectionDivider(s, 8, "Special Situations & Summary");

// Slide 45 – Febrile Seizures
s = pres.addSlide();
contentSlide(s, "Febrile Seizures", [
  "Most common seizure type in children — 2–5% of all children aged 6 months to 5 years",
  "SIMPLE febrile seizure: <15 min, generalized, single episode in 24 hours, normal development — NO investigation or AED required",
  "COMPLEX febrile seizure: focal, prolonged (>15 min), recurs within 24 hours — investigate and consider LP",
  "Risk of recurrence: ~30% overall; higher if onset <12 months, low-grade fever, family history",
  "Risk of developing epilepsy: ~2–3% after simple febrile seizure; ~10% after complex febrile seizure",
  "Prolonged febrile seizure (>30 min): febrile status epilepticus — risk factor for subsequent mesial TLE and hippocampal sclerosis",
  "Treatment: antipyretics reduce discomfort but do NOT prevent febrile seizures; rectal diazepam for prolonged attacks",
]);

// Slide 46 – Epilepsy Mimics
s = pres.addSlide();
contentSlide(s, "Epilepsy Mimics — Differential Diagnosis", [
  "SYNCOPE: most common mimic — pallor, sweating, nausea before episode; brief tonic jerks can occur post-syncope (convulsive syncope)",
  "PSYCHOGENIC NON-EPILEPTIC SEIZURES (PNES): prolonged duration, variable semiology, eyes closed, no post-ictal, often witnessed; video-EEG diagnostic",
  "TRANSIENT ISCHAEMIC ATTACK (TIA): negative symptoms (weakness, numbness) vs seizure (positive: jerks, tingling)",
  "MIGRAINE WITH AURA: visual aura spreads slowly (15–20 min); seizure aura is brief (seconds to minutes)",
  "HYPOGLYCAEMIA: check glucose; focal deficits, behavioral change; resolves with glucose",
  "SLEEP DISORDERS: parasomnias (REM behavior disorder, night terrors, sleepwalking) — EEG normal during episodes",
  "CARDIAC ARRHYTHMIA: Stokes-Adams attacks, LQTS — cardiac monitoring essential in unexplained LOC",
]);

// Slide 47 – Antiepileptogenesis & Emerging Therapies
s = pres.addSlide();
contentSlide(s, "Emerging & Future Therapies", [
  "GENE THERAPY: antisense oligonucleotides (ASOs) for Dravet (SCN1A), Angelman (UBE3A) — early trials",
  "PRECISION MEDICINE: genotype-directed therapy (quinidine for KCNT1 gain-of-function; mTOR inhibitors for TSC)",
  "CLOSED-LOOP STIMULATION: next-gen RNS with AI-driven seizure prediction and pre-emptive stimulation",
  "OPTOGENETICS: light-activated inhibitory opsins to silence seizure focus — currently pre-clinical",
  "STEM CELL THERAPY: GABAergic interneuron transplantation into seizure focus — promising in animal models",
  "ANTIEPILEPTOGENESIS TRIALS: rapamycin (mTOR inhibitor) — PREVENT trial; losartan; minocycline",
  "WEARABLES: continuous ECG/EEG/actigraphy smartwatches for seizure detection and SUDEP prevention",
]);

// Slide 48 – Key Clinical Pearls
s = pres.addSlide();
keyFactBox(s, "Key Clinical Pearls", [
  "1. Absence vs complex partial: absence — abrupt onset/offset, brief (5–15s), EEG 3 Hz spike-wave; complex partial — gradual onset/offset, longer, post-ictal",
  "2. Valproate: most effective broad-spectrum AED but AVOID in women of childbearing age — teratogen",
  "3. Status epilepticus: treat at 5 minutes — do NOT wait for '30 minutes'",
  "4. ~30% of epilepsy is drug-resistant; refer early to specialist and consider surgery",
  "5. Todd's palsy: post-ictal focal weakness resolving in hours; must rule out stroke in new presentations",
  "6. PNES (psychogenic seizures): up to 20–30% of patients referred to epilepsy centers — diagnose with video-EEG",
], C.mid);

// Slide 49 – Summary Table
s = pres.addSlide();
tableSlide(s, "Epilepsy Management Summary", ["Domain", "Key Points"],
[
  ["Definition", "Epilepsy = ≥2 unprovoked seizures OR 1 seizure + ≥60% recurrence risk (ILAE 2014)"],
  ["Epidemiology", "~50M worldwide; 44/100,000 incidence; bimodal: infancy + >60 yrs; 30% drug-resistant"],
  ["Pathophysiology", "Excitation/inhibition imbalance; paroxysmal depolarization shift; ion channel dysfunction"],
  ["Classification", "Focal / Generalized / Unknown onset; awareness status; motor vs non-motor (ILAE 2017)"],
  ["Investigation", "EEG (essential), MRI brain (epilepsy protocol), bloods, autoimmune/genetic workup"],
  ["Management", "Monotherapy first; drug selection by seizure type; surgery for drug-resistant focal epilepsy"],
  ["Prevention", "Address risk factors; post-1st seizure risk assessment; SUDEP prevention; patient education"],
], [2.0, 7.4]);

// Slide 50 – Closing / Thank You
s = pres.addSlide();
darkTitleSlide(s, "Thank You", "Epilepsy & Seizure Disorders — A Comprehensive Review");
s.addShape(pres.ShapeType.rect, { x: 2.0, y: 3.0, w: 6.0, h: 0.05, fill: { color: C.gold }, line: { type: "none" } });
s.addText([
  { text: "Adams & Victor's Principles of Neurology, 12th Ed  ", options: { breakLine: true } },
  { text: "Harrison's Principles of Internal Medicine, 22nd Ed  ", options: { breakLine: true } },
  { text: "Bradley & Daroff's Neurology in Clinical Practice  ", options: { breakLine: true } },
  { text: "Katzung Basic & Clinical Pharmacology, 16th Ed  ", options: { breakLine: true } },
  { text: "ILAE 2017 Seizure Classification (Fisher et al.)  ", options: {} },
], {
  x: 0.5, y: 3.2, w: 9.0, h: 1.8,
  fontSize: 13, color: C.muted, fontFace: "Calibri", align: "center", lineSpacingMultiple: 1.5
});
s.addText("Prepared with Orris Medical Education AI • 2026", {
  x: 0.3, y: 5.1, w: 9.4, h: 0.35, fontSize: 10, color: "444444", fontFace: "Calibri", align: "center"
});

// ─── WRITE ────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/epilepsy-pptx/Epilepsy_Seizure_50_Slides.pptx" })
  .then(() => console.log("SUCCESS: Epilepsy_Seizure_50_Slides.pptx created"))
  .catch(err => { console.error("ERROR:", err); process.exit(1); });
Running Command

cd /home/daytona/workspace/epilepsy-pptx && node build.js 2>&1

Running Command

ls -lh /home/daytona/workspace/epilepsy-pptx/Epilepsy_Seizure_50_Slides.pptx

Your credits are exhausted. You can purchase a top-up or subscribe to a plan to continue using Orris. If you're already subscribed, your daily credits will reset tomorrow.

Create a printable study guide PDF from this presentation

Your credits are exhausted. You can purchase a top-up or subscribe to a plan to continue using Orris. If you're already subscribed, your daily credits will reset tomorrow.

Epilepsy, Seizure Definition Epidemiology Pathophysiology Investigation Management Prevention Give me 50 slide power point ppt

Your credits are exhausted. You can purchase a top-up or subscribe to a plan to continue using Orris. If you're already subscribed, your daily credits will reset tomorrow.
This is a shared conversation. Sign in to Orris to start your own chat.