attachment
attachment

Answer these on 2nd year mbbs level with reference to kdt pharmacology

Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Note: KDT (K.D. Tripathi's "Essentials of Medical Pharmacology") is not available in the textbook library here, but its content is well-established from training. All answers below follow KDT chapter structure and page references are approximated to the 8th edition. Supporting confirmation was drawn from Katzung 16th Ed. and Goodman & Gilman available in the library.

ANSWERS - 2nd Year MBBS Pharmacology (KDT Reference)


Q1(i) - Drugs Used in Parkinson's Disease

(KDT Ch. 32 - Drugs for Parkinsonism)
Parkinson's disease involves degeneration of dopaminergic neurons in the substantia nigra, leading to a dopamine (DA) deficiency and relative cholinergic excess in the striatum. Drugs aim to restore this DA/ACh balance.

Classification of Antiparkinson Drugs (KDT)

A. Dopaminergic drugs (restore DA activity)
  1. Levodopa (L-DOPA) - DA precursor; most effective
  2. Levodopa + Carbidopa (Syndopa, Sinemet) - preferred combination
  3. Levodopa + Carbidopa + Entacapone (Stalevo)
  4. DA agonists - Bromocriptine, Pramipexole, Ropinirole, Cabergoline
  5. MAO-B inhibitors - Selegiline (Deprenyl), Rasagiline
  6. COMT inhibitors - Entacapone, Tolcapone
  7. Amantadine - increases DA release, blocks NMDA receptors
B. Anticholinergic drugs (reduce cholinergic overactivity)
  • Trihexyphenidyl (Benzhexol), Biperiden, Procyclidine, Orphenadrine

Q1(ii) - Mechanism of Action of Levodopa & Rationale for Levodopa-Carbidopa Combination

(KDT Ch. 32, ~p. 424)

Mechanism of Levodopa

Dopamine itself cannot cross the blood-brain barrier (BBB). Levodopa (L-DOPA), the immediate precursor of dopamine, uses the large neutral amino acid transporter (LNAT) to cross the BBB. Inside the brain (particularly in the striatum and substantia nigra), it is decarboxylated by DOPA decarboxylase (aromatic L-amino acid decarboxylase, AADC) to form dopamine, which then acts on D1 and D2 receptors to produce its therapeutic effect.
Levodopa --[AADC in brain]--> Dopamine (in striatum) --[D1, D2 receptors]--> motor benefit
However, when given alone, ~95-99% of levodopa is decarboxylated peripherally (in gut wall, liver, kidneys) to dopamine, which cannot cross the BBB. This peripheral dopamine causes:
  • Nausea, vomiting (stimulation of CTZ)
  • Postural hypotension
  • Cardiac arrhythmias
Only ~1-3% of oral levodopa actually reaches the brain.

Rationale for Levodopa + Carbidopa Combination

Carbidopa is a DOPA decarboxylase (DDC) inhibitor that does not cross the BBB (due to a hydrazine group that makes it polar).
EffectLevodopa AloneLevodopa + Carbidopa
Peripheral decarboxylationHigh (~97%)Blocked
Brain availability~1-3%~10x more
Dose of levodopa requiredHigh (3-8 g/day)Low (300-800 mg/day)
Nausea/vomitingSevereGreatly reduced
Cardiovascular side effectsCommonReduced
Onset of benefitSlowerFaster
In combination, carbidopa inhibits peripheral DDC, so more levodopa reaches the brain intact and is then decarboxylated there to dopamine. This increases efficacy and reduces peripheral side effects. The ratio used is typically 4:1 (levodopa:carbidopa) in standard preparations.

Q1(ii continued) - MAO Inhibitors in Parkinson's Disease

(KDT Ch. 32)
Selegiline (Deprenyl) and Rasagiline are selective, irreversible MAO-B inhibitors.
  • MAO-B is the predominant isoform responsible for dopamine breakdown in the brain (striatum).
  • By inhibiting MAO-B, these drugs reduce catabolism of dopamine in the striatum, prolonging and increasing dopamine availability.
  • Selegiline does not inhibit MAO-A at therapeutic doses, so the "cheese reaction" (tyramine interaction seen with non-selective MAO inhibitors) does not occur.
  • Selegiline is also said to have a potential neuroprotective effect by reducing oxidative stress from DA metabolism (though this is debated).
  • Used as: (a) adjunct to levodopa to smooth out "wearing off" fluctuations, (b) early monotherapy in mild disease.

Q1(ii continued) - Dopamine Agonists in Parkinson's Disease

(KDT Ch. 32)
These act directly on striatal dopamine receptors (D2 mainly, also D3) without requiring conversion, so they:
  • Do not depend on surviving dopaminergic neurons
  • Have longer duration of action than levodopa
  • Cause fewer motor fluctuations ("on-off", dyskinesias)
DrugReceptorRouteNotes
BromocriptineD2 agonistOralErgot-derived; older
PramipexoleD2, D3 agonistOralNon-ergot; preferred
RopiniroleD2, D3 agonistOralNon-ergot; preferred
CabergolineD2 agonistOralLong t1/2; once weekly
ApomorphineD1+D2 agonistSC injectionFor acute "off" episodes
Adverse effects: Nausea, postural hypotension, hallucinations, impulse control disorders (gambling, hypersexuality - especially pramipexole/ropinirole).

Q1(ii continued) - Anticholinergic Drugs in Parkinson's Disease

(KDT Ch. 32)
Rationale: In PD, dopamine deficiency leads to relative excess of acetylcholine (ACh) activity in the corpus striatum. Anticholinergics restore the DA/ACh balance by blocking muscarinic receptors.
Drugs used: Trihexyphenidyl (Benzhexol), Biperiden, Procyclidine, Orphenadrine.
Benefits:
  • Reduce tremor and rigidity (moderately effective)
  • Especially useful for drug-induced parkinsonism (e.g., antipsychotic-induced)
  • Useful when levodopa is contraindicated
Limitations/Side effects: Dry mouth, blurred vision, urinary retention, constipation, memory impairment, confusion (especially in elderly) - limits use in older patients.
KDT Key Point: Anticholinergics are more effective for tremor and rigidity than for bradykinesia.


Q2. SHORT ANSWER QUESTIONS


Q2(a) - Advantages of Non-Benzodiazepines Over Benzodiazepines (2 drugs)

(KDT Ch. 27 - Sedative-Hypnotics)
Non-benzodiazepine hypnotics (Z-drugs): Zolpidem, Zaleplon, Eszopiclone
Though they act at the same GABA-A receptor as BDZs (at the BDZ binding site), they bind selectively to the BZ1 (omega-1) subunit (alpha-1 subunit-containing receptors), unlike BDZs which bind non-selectively.

Advantages over Benzodiazepines:

FeatureBenzodiazepinesZ-drugs (Zolpidem, Zaleplon)
Receptor selectivityNon-selective (BZ1 + BZ2)Selective for BZ1 (omega-1)
Anxiolytic effectYesMinimal/None
Muscle relaxant effectYes (problematic)Minimal
Anticonvulsant effectYesMinimal
Sleep architectureSuppresses deep NREM, REMPreserves normal sleep architecture
Dependence potentialHighLower
Rebound insomniaMore pronouncedLess pronounced
DurationLonger (residual sedation)Short t1/2 (Zolpidem: 2-3h; Zaleplon: 1h)
Next-day hangoverCommonMinimal
AmnesiaMoreLess
ToleranceDevelops fasterSlower
Zolpidem: Preferred for sleep-onset insomnia; short t1/2 of 2-3 hours. Zaleplon: Ultra-short t1/2 (~1 hour); can even be taken in the middle of the night.
KDT Key Point: Z-drugs are preferred for insomnia because they selectively promote sleep without the full spectrum of BDZ side effects, especially in the elderly.

Q2(b) - Short Note on Triptans

(KDT Ch. 15 - Drugs for Migraine)

Triptans - Selective 5-HT1B/1D Agonists

Prototype: Sumatriptan. Others: Rizatriptan, Zolmitriptan, Naratriptan, Eletriptan, Almotriptan, Frovatriptan.

Mechanism of Action (Dual)

  1. Cranial vasoconstriction (5-HT1B): Triptans act on 5-HT1B receptors on intracranial (meningeal/dural) blood vessels, causing vasoconstriction and reversing the abnormal vasodilation that occurs in migraine.
  2. Neuronal inhibition (5-HT1D): Act on presynaptic 5-HT1D receptors on trigeminal nerve terminals - inhibit release of pro-inflammatory neuropeptides (substance P, CGRP) from trigeminal endings, thereby interrupting the trigemino-vascular inflammation cascade.
  3. 5-HT1D on brainstem - inhibit central sensitization at the trigeminal nucleus caudalis.

Pharmacokinetics

DrugRoutet1/2Onset
SumatriptanSC, oral, nasal~2 hFast (SC fastest)
RizatriptanOral (wafer)~2 hFast
NaratriptanOral~6 hSlower, less headache recurrence
FrovatriptanOral~26 hSlowest; used for menstrual migraine
ZolmitriptanOral, nasal~3 hModerate

Uses

  • Acute treatment of moderate-to-severe migraine attacks (drug of choice)
  • Cluster headache (sumatriptan SC)

Adverse Effects

  • Chest tightness/pressure (coronary vasospasm - most important)
  • Flushing, tingling, dizziness
  • Triptan sensations (pressure, heaviness)

Contraindications

  • Ischemic heart disease, uncontrolled hypertension, Prinzmetal angina, stroke, severe hepatic disease
  • Concurrent use with MAO inhibitors (for rizatriptan, zolmitriptan)
  • Concurrent ergotamine (within 24 hours)

Q2(c) - Three Major Drugs Used as Pre-anaesthetic Medications

(KDT Ch. 25 - General Anesthesia)
Pre-anaesthetic medication (premedication): Drugs given 1-2 hours before induction of anaesthesia to prepare the patient.

Objectives of Premedication (KDT mnemonic: RAISE-S)

Relief of anxiety, Analgesia, Inhibit secretions, Sedation, Emesis prevention, Smooth induction

Three Major Drugs:

1. Benzodiazepines - Diazepam/Midazolam (Sedative-Anxiolytic)
  • Mechanism: Enhance GABA-A receptor activity
  • Purpose: Allays anxiety and apprehension; produces anterograde amnesia (patient doesn't remember unpleasant events), mild sedation
  • Advantage of Midazolam: Water-soluble, IV compatible, shorter acting, profound amnesia; most commonly used premedication today
  • Dose: Midazolam 0.05-0.1 mg/kg IV/IM
2. Opioid Analgesics - Morphine/Pethidine (Analgesic-Sedative)
  • Mechanism: Act on mu-opioid receptors; central analgesia + sedation
  • Purpose: Preoperative pain relief, potentiate anaesthetic agents (reduces MAC of volatile anaesthetics), reduce intraoperative opioid requirements
  • Disadvantage: Can cause respiratory depression, PONV (post-operative nausea/vomiting), histamine release (morphine)
  • Pethidine is preferred as it has less emetic effect, but has shorter duration
3. Anticholinergics - Atropine/Glycopyrrolate (Antisecretory)
  • Mechanism: Block muscarinic receptors
  • Purpose:
    • Reduce secretions (salivary, bronchial) - prevents airway obstruction
    • Prevent bradycardia from vagal stimulation during intubation/surgery
    • Reduce risk of laryngospasm
    • Prevent neostigmine-induced bradycardia during reversal of NMB
  • Glycopyrrolate is preferred over atropine: does not cross BBB (no CNS effects), longer antisecretory action, less tachycardia
Additional agents used in premedication: H2 blockers/PPIs (to reduce aspiration pneumonitis risk), antiemetics (ondansetron/metoclopramide).

Q2(d) - Rationale for Use of Fixed Dose Combination Cotrimoxazole

(KDT Ch. 48 - Sulfonamides)
Cotrimoxazole = Trimethoprim + Sulfamethoxazole (TMP + SMX) in ratio 1:5

Rationale (Sequential Blockade of Folate Synthesis)

Both drugs act on the folate synthesis pathway, but at different steps, producing a sequential blockade:
PABA
  |
  | ← Sulfamethoxazole inhibits Dihydropteroate synthase (DHPS)
  ↓
Dihydrofolic acid
  |
  | ← Trimethoprim inhibits Dihydrofolate reductase (DHFR)
  ↓
Tetrahydrofolic acid (THF)
  |
  ↓
Purines → DNA synthesis
Why this combination works:
  1. Synergistic effect: The two-step sequential blockade produces a synergistic bactericidal effect; inhibiting both steps together is far more effective than either drug alone (10-100x more potent)
  2. Broader spectrum: TMP + SMX covers organisms that may be resistant to sulfonamide alone
  3. Reduced resistance: Since resistance to both drugs simultaneously is less likely, the combination reduces emergence of resistance
  4. Bactericidal activity: Though each is bacteriostatic alone, together they are bactericidal
  5. Selective toxicity: Human cells cannot synthesize folate (we obtain it from diet), so DHPS inhibition (step 1) does not affect human cells. DHFR inhibition (step 2) - trimethoprim has ~50,000x more affinity for bacterial DHFR than human DHFR, ensuring selective toxicity.
Fixed ratio 1:5 (TMP:SMX): This maintains plasma concentrations in a 1:20 ratio, which is the optimal ratio for synergy against most organisms.
Uses: UTI, PCP (Pneumocystis jirovecii pneumonia - drug of choice), typhoid, traveler's diarrhea, MRSA (soft tissue infections), nocardiosis.

Q2(e) - Role of Disulfiram in Treatment of Alcohol Addiction

(KDT Ch. 30 - Drugs and Alcohol)

Mechanism

Alcohol is metabolized by:
Ethanol --[ADH]--> Acetaldehyde --[Aldehyde dehydrogenase (ALDH)]--> Acetate --> CO2 + H2O
Disulfiram irreversibly inhibits ALDH (aldehyde dehydrogenase). This causes accumulation of acetaldehyde (toxic metabolite) when alcohol is consumed.

Disulfiram-Ethanol Reaction (DER)

Within 10-30 minutes of alcohol intake, acetaldehyde accumulates causing:
  • Severe flushing (face, neck, chest)
  • Throbbing headache
  • Nausea and vomiting (projectile)
  • Tachycardia, palpitations
  • Hypotension (peripheral vasodilation)
  • Breathlessness, chest pain
  • Sense of impending doom, anxiety
In severe cases: arrhythmias, MI, respiratory depression, convulsions, death.

Therapeutic Role

  • Acts as an aversion/deterrent therapy - the unpleasant reaction conditions the patient to avoid alcohol (conditioned aversion)
  • Given to motivated patients only who are aware of the reaction
  • It does not treat craving; it is a psychological deterrent
  • Dose: 250-500 mg/day orally; given after at least 12 hours of abstinence

Precautions

  • Patient must be fully informed and consenting
  • Avoid in cardiac, liver, or renal disease
  • Avoid in pregnancy
  • Drug interactions: disulfiram inhibits CYP450 and increases levels of warfarin, phenytoin
Other drugs for alcohol dependence (KDT): Naltrexone (reduces craving), Acamprosate (anti-craving), Chlordiazepoxide (for acute withdrawal)

Q2(f) - Role of Any Three Drugs of Different Categories in Treatment of Mania

(KDT Ch. 33 - Drugs for Bipolar Disorder)

Three Drugs from Different Categories:


1. Lithium Carbonate (Mood Stabilizer - Ion)
  • Mechanism: Multiple proposed mechanisms:
    • Inhibits phosphoinositide (PI) signaling by blocking inositol monophosphatase (IMPase) - reduces DAG/IP3 formation
    • Inhibits glycogen synthase kinase-3 (GSK-3beta)
    • Modulates glutamate (NMDA receptor) activity
    • Reduces norepinephrine turnover
  • Role in Mania: Drug of choice for acute mania and long-term prophylaxis of bipolar disorder; effective in 70-80% of cases
  • Monitoring: Narrow therapeutic index (0.8-1.2 mEq/L for acute mania; 0.6-0.8 for maintenance). Regular serum lithium, renal function, thyroid function monitoring required
  • Adverse effects: Tremor, polyuria, polydipsia (nephrogenic DI), hypothyroidism, weight gain, teratogenicity (Ebstein's anomaly)
  • Toxicity signs: Coarse tremor, ataxia, confusion, convulsions

2. Valproate (Sodium Valproate) (Antiepileptic - Mood Stabilizer)
  • Mechanism:
    • Enhances GABA-ergic activity (increases GABA synthesis/release, inhibits GABA transaminase)
    • Blocks voltage-gated Na+ channels
    • Blocks T-type Ca2+ channels
  • Role in Mania: Used for acute mania (faster onset than lithium), mixed episodes, rapid cycling, and lithium-resistant mania; increasingly preferred over lithium for mixed/rapid cycling states
  • Advantages over lithium: Broader spectrum of action in bipolar, effective in rapid cycling, better tolerated in acute settings
  • Adverse effects: GI upset, weight gain, tremor, hair loss, hepatotoxicity (rare, dose-dependent), teratogenicity (neural tube defects - avoid in women of childbearing age)

3. Antipsychotics - Haloperidol/Olanzapine/Risperidone (Antipsychotic - Mood Stabilizer)
  • Mechanism:
    • Typical (Haloperidol): D2 receptor blockade in mesolimbic/mesocortical pathways - rapidly controls psychomotor agitation
    • Atypical (Olanzapine, Risperidone): D2 + 5-HT2A blockade
  • Role in Mania:
    • Acute control: Haloperidol/Olanzapine IM for rapid control of severe agitation, aggressive behavior, psychotic features in acute mania (onset within hours)
    • Olanzapine is FDA-approved for acute mania and is often combined with lithium/valproate
    • Useful when manic patient is too agitated to take oral medication
  • Adverse effects: Haloperidol - EPS (dystonia, akathisia, parkinsonism), tardive dyskinesia; Olanzapine - weight gain, metabolic syndrome, sedation

Q3(a) - First Line Drugs and Alternative Drugs Used in Generalized Tonic-Clonic Seizures (GTCS)

(KDT Ch. 29 - Antiepileptic Drugs)

Pathophysiology of GTCS

GTCS arises from excessive, synchronous discharge of cortical neurons involving both hemispheres. The mechanism involves: increased Na+ channel opening (repetitive firing), decreased GABAergic inhibition, increased glutamatergic excitation.

First-Line Drugs for GTCS:

1. Sodium Valproate (Drug of Choice - KDT)
  • Mechanism: Multiple - enhances GABA (inhibits GABA transaminase + increases synthesis), blocks Na+ channels, T-type Ca2+ channels
  • Dose: 20-30 mg/kg/day orally
  • Advantage: Broad spectrum - effective in all seizure types; drug of choice for generalized epilepsies
  • Side effects: Weight gain, hair loss, tremor, teratogenicity (spina bifida), hepatotoxicity
2. Phenytoin (Diphenylhydantoin)
  • Mechanism: Blocks frequency-dependent voltage-gated Na+ channels (membrane stabilization); delays Na+ channel recovery from inactivation
  • Dose: 4-6 mg/kg/day orally
  • Side effects: Gingival hyperplasia, hirsutism, coarsening of facial features, ataxia, nystagmus, megaloblastic anemia, teratogenicity (fetal hydantoin syndrome), zero-order kinetics (saturation pharmacokinetics - narrow TI)
3. Carbamazepine
  • Mechanism: Blocks Na+ channels (similar to phenytoin); also has antidiuretic effect (ADH-like action)
  • Dose: 10-20 mg/kg/day orally
  • Side effects: Diplopia, ataxia, hyponatremia (SIADH), rash (Stevens-Johnson syndrome - especially in HLA-B*1502 carriers), aplastic anemia (rare)
  • Drug interactions: CYP450 inducer - reduces efficacy of OCP, warfarin, etc.

Alternative / Second-Line Drugs:

4. Phenobarbitone (Phenobarbital)
  • Mechanism: Enhances GABA-A receptor (increases Cl- channel opening duration - distinct from BDZs which increase frequency)
  • Still widely used in developing countries; cheap and effective
  • Side effects: Sedation, cognitive impairment, dependence, enzyme induction, paradoxical hyperactivity in children
5. Levetiracetam (Newer AED)
  • Mechanism: Binds SV2A (synaptic vesicle protein 2A), modulating synaptic vesicle fusion and neurotransmitter release
  • No significant drug interactions; no enzyme induction/inhibition
  • Well tolerated; IV form available for status epilepticus
  • Side effects: Irritability, behavioral changes, somnolence
6. Lamotrigine
  • Mechanism: Blocks Na+ channels; also inhibits glutamate release
  • Broad spectrum; good for women (less teratogenic than valproate/phenytoin)
  • Side effects: Rash (including SJS) - requires slow titration
DrugMechanismKey Adverse Effect
Sodium ValproateNa+, GABA, Ca2+Weight gain, teratogen
PhenytoinNa+ channelsGingival hyperplasia, zero-order kinetics
CarbamazepineNa+ channelsHyponatremia, SJS, enzyme inducer
PhenobarbitoneGABA-A (Cl- duration)Sedation, dependence
LevetiracetamSV2ABehavioral changes
LamotrigineNa+ channels + GluRash, SJS
KDT Key Point for GTCS: Sodium valproate is the preferred first-line drug for primary generalized epilepsy (including GTCS) because of its broad-spectrum efficacy. Phenytoin and carbamazepine are alternatives but are not recommended in absence seizures (may worsen them).

Reference: K.D. Tripathi - Essentials of Medical Pharmacology, 8th Edition
  • Ch. 29: Antiepileptic Drugs
  • Ch. 30: Drugs and Alcohol Dependence
  • Ch. 32: Drugs for Parkinsonism
  • Ch. 33: Drugs for Bipolar Disorder
  • Ch. 25: General Anaesthesia and Premedication
  • Ch. 27: Sedative-Hypnotics
  • Ch. 48: Sulfonamides and Cotrimoxazole
  • Ch. 15: 5-HT and Drugs for Migraine

Prepare flashcards on mechanisms and side effects of antiparkinson drugs

Asking for Preferences
Reading File
Running Command

ls /home/daytona/workspace/ 2>/dev/null || echo "workspace empty or missing"

Running Command

mkdir -p /home/daytona/workspace/antiparkinson-flashcards && echo "done"

Writing File

~/antiparkinson-flashcards/make_flashcards.py

from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import cm
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import KeepTogether

# ─── Color palette ────────────────────────────────────────────────────────────
DARK_BLUE    = colors.HexColor("#1a237e")
MED_BLUE     = colors.HexColor("#1565c0")
LIGHT_BLUE   = colors.HexColor("#e3f2fd")
ACCENT       = colors.HexColor("#0288d1")
GREEN        = colors.HexColor("#2e7d32")
LIGHT_GREEN  = colors.HexColor("#e8f5e9")
RED          = colors.HexColor("#c62828")
LIGHT_RED    = colors.HexColor("#ffebee")
ORANGE       = colors.HexColor("#e65100")
LIGHT_ORANGE = colors.HexColor("#fff3e0")
PURPLE       = colors.HexColor("#6a1b9a")
LIGHT_PURPLE = colors.HexColor("#f3e5f5")
TEAL         = colors.HexColor("#00695c")
LIGHT_TEAL   = colors.HexColor("#e0f2f1")
GOLD         = colors.HexColor("#f57f17")
LIGHT_GOLD   = colors.HexColor("#fffde7")
WHITE        = colors.white
GRAY_LIGHT   = colors.HexColor("#f5f5f5")
GRAY_MED     = colors.HexColor("#9e9e9e")
DARK_TEXT    = colors.HexColor("#212121")

OUTPUT = "/home/daytona/workspace/antiparkinson-flashcards/Antiparkinson_Drugs_Flashcards.pdf"

doc = SimpleDocTemplate(
    OUTPUT,
    pagesize=A4,
    rightMargin=1.5*cm,
    leftMargin=1.5*cm,
    topMargin=1.5*cm,
    bottomMargin=1.5*cm,
)

W = A4[0] - 3*cm   # usable width

styles = getSampleStyleSheet()

# ─── Custom styles ─────────────────────────────────────────────────────────────
def S(name, **kw):
    return ParagraphStyle(name, **kw)

title_style = S("MainTitle",
    fontSize=22, fontName="Helvetica-Bold", textColor=WHITE,
    alignment=TA_CENTER, spaceAfter=4)

subtitle_style = S("Subtitle",
    fontSize=11, fontName="Helvetica", textColor=colors.HexColor("#bbdefb"),
    alignment=TA_CENTER, spaceAfter=2)

card_title_style = S("CardTitle",
    fontSize=14, fontName="Helvetica-Bold", textColor=WHITE,
    alignment=TA_CENTER, leading=18)

card_subtitle_style = S("CardSub",
    fontSize=9, fontName="Helvetica", textColor=colors.HexColor("#e0e0e0"),
    alignment=TA_CENTER, spaceBefore=2)

section_label = S("SecLabel",
    fontSize=8, fontName="Helvetica-Bold", textColor=WHITE,
    alignment=TA_LEFT, spaceBefore=0, spaceAfter=1)

body_style = S("Body",
    fontSize=9, fontName="Helvetica", textColor=DARK_TEXT,
    leading=13, spaceAfter=2, alignment=TA_LEFT)

bullet_style = S("Bullet",
    fontSize=9, fontName="Helvetica", textColor=DARK_TEXT,
    leading=13, leftIndent=10, spaceAfter=1,
    bulletIndent=2, alignment=TA_LEFT)

bold_bullet = S("BoldBullet",
    fontSize=9, fontName="Helvetica-Bold", textColor=DARK_TEXT,
    leading=13, leftIndent=10, spaceAfter=1)

key_point_style = S("KeyPoint",
    fontSize=9, fontName="Helvetica-BoldOblique", textColor=DARK_BLUE,
    leading=12, alignment=TA_LEFT, spaceBefore=2)

mnemonic_style = S("Mnemonic",
    fontSize=10, fontName="Helvetica-Bold", textColor=PURPLE,
    alignment=TA_CENTER, spaceBefore=4, spaceAfter=4)

# ─── Helper builders ───────────────────────────────────────────────────────────

def make_cover():
    """Title cover block."""
    data = [[Paragraph("ANTIPARKINSON DRUGS", title_style)],
            [Paragraph("Mechanisms • Side Effects • Key Points", subtitle_style)],
            [Paragraph("KDT Pharmacology — 2nd Year MBBS Flashcards", subtitle_style)]]
    t = Table(data, colWidths=[W])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), DARK_BLUE),
        ("TOPPADDING",    (0,0), (-1,-1), 14),
        ("BOTTOMPADDING", (0,0), (-1,-1), 14),
        ("LEFTPADDING",   (0,0), (-1,-1), 16),
        ("RIGHTPADDING",  (0,0), (-1,-1), 16),
        ("ROUNDEDCORNERS", (0,0), (-1,-1), [10,10,10,10]),
    ]))
    return t

def header_cell(text, sub, bg_color):
    """Colored header banner for a flashcard."""
    data = [
        [Paragraph(text, card_title_style)],
        [Paragraph(sub, card_subtitle_style)],
    ]
    t = Table(data, colWidths=[W])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), bg_color),
        ("TOPPADDING",    (0,0), (-1,-1), 8),
        ("BOTTOMPADDING", (0,0), (-1,-1), 6),
        ("LEFTPADDING",   (0,0), (-1,-1), 12),
        ("RIGHTPADDING",  (0,0), (-1,-1), 12),
    ]))
    return t

def section_banner(text, bg):
    data = [[Paragraph(text.upper(), section_label)]]
    t = Table(data, colWidths=[W])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), bg),
        ("TOPPADDING",    (0,0), (-1,-1), 3),
        ("BOTTOMPADDING", (0,0), (-1,-1), 3),
        ("LEFTPADDING",   (0,0), (-1,-1), 8),
    ]))
    return t

def body_box(rows, bg=GRAY_LIGHT):
    """Simple bordered content box."""
    data = [[r] for r in rows]
    t = Table(data, colWidths=[W])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), bg),
        ("TOPPADDING",    (0,0), (-1,-1), 4),
        ("BOTTOMPADDING", (0,0), (-1,-1), 2),
        ("LEFTPADDING",   (0,0), (-1,-1), 10),
        ("RIGHTPADDING",  (0,0), (-1,-1), 10),
        ("BOX", (0,0), (-1,-1), 0.5, colors.HexColor("#bdbdbd")),
    ]))
    return t

def two_col(left_rows, right_rows, left_bg, right_bg, left_label, right_label):
    """Two-column layout: mechanism (left) | side effects (right)."""
    half = (W - 0.3*cm) / 2

    def col_table(label, bg_label, rows, bg_body):
        inner = [[section_banner(label, bg_label)]]
        for r in rows:
            inner.append([r])
        t = Table(inner, colWidths=[half])
        t.setStyle(TableStyle([
            ("BACKGROUND", (0,1), (-1,-1), bg_body),
            ("TOPPADDING",    (0,0), (-1,-1), 3),
            ("BOTTOMPADDING", (0,0), (-1,-1), 2),
            ("LEFTPADDING",   (0,0), (-1,-1), 6),
            ("RIGHTPADDING",  (0,0), (-1,-1), 6),
            ("BOX", (0,0), (-1,-1), 0.5, colors.HexColor("#bdbdbd")),
        ]))
        return t

    lc = col_table(left_label,  left_bg,  left_rows,  LIGHT_BLUE)
    rc = col_table(right_label, right_bg, right_rows, LIGHT_RED)

    outer = Table([[lc, rc]], colWidths=[half, half],
                  spaceBefore=0, spaceAfter=0)
    outer.setStyle(TableStyle([
        ("VALIGN", (0,0), (-1,-1), "TOP"),
        ("LEFTPADDING",  (0,0), (-1,-1), 0),
        ("RIGHTPADDING", (0,0), (-1,-1), 0),
        ("TOPPADDING",   (0,0), (-1,-1), 0),
        ("BOTTOMPADDING",(0,0), (-1,-1), 0),
    ]))
    return outer

def bp(text):
    return Paragraph(f"• {text}", bullet_style)

def bb(text):
    return Paragraph(f"• <b>{text}</b>", bullet_style)

def b(text):
    return Paragraph(text, body_style)

def kp(text):
    return Paragraph(f"⭐ {text}", key_point_style)

def mn(text):
    return Paragraph(text, mnemonic_style)

def card_wrapper(items):
    """Wrap a card so it tries to keep together and adds spacing."""
    return KeepTogether(items + [Spacer(1, 0.35*cm)])

# ═══════════════════════════════════════════════════════════════════════════════
#  FLASHCARD DATA
# ═══════════════════════════════════════════════════════════════════════════════

def card_levodopa():
    mech_rows = [
        b("<b>Drug:</b> Levodopa (L-DOPA)"),
        b("<b>Class:</b> Dopamine Precursor"),
        Spacer(1,3),
        bp("Dopamine CANNOT cross the BBB"),
        bp("Levodopa crosses via Large Neutral Amino Acid Transporter (LNAT)"),
        bp("Inside brain → decarboxylated by AADC (Aromatic L-Amino Acid Decarboxylase) → Dopamine"),
        bp("Dopamine acts on D1 & D2 receptors in striatum → relieves motor symptoms"),
        bp("95–99% converted peripherally → explains side effects"),
        Spacer(1,3),
        b("<b>Route:</b> Levodopa → AADC (brain) → DA → D1/D2 receptors"),
    ]
    se_rows = [
        b("<b>GI (peripheral DA):</b>"),
        bp("Nausea, vomiting (CTZ stimulation)"),
        bp("Anorexia"),
        b("<b>Cardiovascular:</b>"),
        bp("Postural hypotension"),
        bp("Cardiac arrhythmias"),
        b("<b>CNS (long-term):</b>"),
        bp("Dyskinesias (peak dose, most common)"),
        bp("On-Off fluctuations"),
        bp("Wearing-off phenomenon"),
        bp("Psychosis, hallucinations, confusion"),
        bp("Sleep disturbances, vivid dreams"),
        b("<b>Other:</b>"),
        bp("Dark urine/sweat (melanin)"),
        bp("Mydriasis → CI in narrow-angle glaucoma"),
    ]
    return card_wrapper([
        header_cell("LEVODOPA (L-DOPA)", "Dopamine Precursor | Most Effective Antiparkinson Drug", MED_BLUE),
        two_col(mech_rows, se_rows, MED_BLUE, RED, "⚙ Mechanism of Action", "⚠ Side Effects"),
        body_box([
            kp("KDT Key: Only ~1–3% of oral levodopa reaches the brain when given alone"),
            kp("CI: Psychosis, narrow-angle glaucoma, concurrent non-selective MAO inhibitors"),
            kp("NOT given with antipsychotics (D2 blockers — antagonize levodopa)"),
        ], LIGHT_GOLD),
    ])

def card_carbidopa():
    mech_rows = [
        b("<b>Carbidopa:</b> Peripheral DOPA Decarboxylase (DDC) Inhibitor"),
        Spacer(1,3),
        bp("Does NOT cross the BBB (hydrazine group → polar molecule)"),
        bp("Inhibits peripheral decarboxylation of levodopa → peripheral DA NOT formed"),
        bp("More levodopa reaches the brain (~10x more bioavailability)"),
        bp("Carbidopa itself has NO antiparkinson effect"),
        Spacer(1,3),
        b("<b>Ratio:</b> Levodopa : Carbidopa = 4:1 (standard preparation)"),
        b("<b>Benefits of combination:</b>"),
        bp("Levodopa dose reduced by ~75–80%"),
        bp("Faster onset of benefit"),
        bp("Reduced peripheral side effects"),
        bp("No need to restrict dietary protein (protein competes for LNAT)"),
    ]
    se_rows = [
        b("<b>Reduced peripheral side effects:</b>"),
        bp("Less nausea & vomiting"),
        bp("Less postural hypotension"),
        bp("Less cardiac arrhythmias"),
        Spacer(1,3),
        b("<b>Remaining/New effects:</b>"),
        bp("CNS side effects persist (dyskinesias, psychosis, hallucinations — even worse as more levodopa reaches brain)"),
        bp("Involuntary movements appear earlier"),
        Spacer(1,3),
        b("<b>Carbidopa alone:</b>"),
        bp("No major adverse effects"),
        bp("Can precipitate vitamin B6 antagonism (theoretical)"),
    ]
    return card_wrapper([
        header_cell("LEVODOPA + CARBIDOPA", "Peripheral DDC Inhibitor Combination | Syndopa / Sinemet", TEAL),
        two_col(mech_rows, se_rows, TEAL, RED, "⚙ Mechanism & Rationale", "⚠ Side Effects"),
        body_box([
            kp("KDT Key: Carbidopa does NOT cross BBB → selectively inhibits PERIPHERAL DDC only"),
            kp("Entacapone (COMT inhibitor) can be added → triple combo (Stalevo): further increases levodopa availability"),
        ], LIGHT_TEAL),
    ])

def card_dopamine_agonists():
    mech_rows = [
        b("<b>Class:</b> Direct Dopamine Receptor Agonists (D2/D3)"),
        Spacer(1,3),
        b("<b>Ergot-derived:</b>"),
        bp("Bromocriptine — D2 agonist"),
        bp("Cabergoline — D2 agonist, very long t½ (~65h)"),
        Spacer(1,3),
        b("<b>Non-ergot (preferred):</b>"),
        bp("Pramipexole — D2 + D3 agonist"),
        bp("Ropinirole — D2 + D3 agonist"),
        bp("Rotigotine — transdermal patch"),
        Spacer(1,3),
        b("<b>Mechanism:</b>"),
        bp("Act DIRECTLY on striatal D2/D3 receptors"),
        bp("Do NOT require conversion — no need for surviving neurons"),
        bp("Longer duration of action than levodopa"),
        bp("Fewer motor fluctuations (on-off, dyskinesias)"),
        b("<b>Use:</b> Early PD (monotherapy) or adjunct to levodopa"),
    ]
    se_rows = [
        b("<b>Common:</b>"),
        bp("Nausea, vomiting"),
        bp("Postural hypotension"),
        bp("Somnolence (sudden 'sleep attacks' — important for driving!)"),
        Spacer(1,3),
        b("<b>CNS:</b>"),
        bp("Hallucinations, psychosis (more than levodopa)"),
        bp("Confusion, delirium (especially in elderly)"),
        Spacer(1,3),
        b("<b>Impulse Control Disorders (ICDs):</b>"),
        bp("Pathological gambling"),
        bp("Hypersexuality"),
        bp("Compulsive eating/shopping"),
        bp("Especially with pramipexole & ropinirole"),
        Spacer(1,3),
        b("<b>Ergot-specific (bromocriptine/cabergoline):</b>"),
        bp("Pulmonary/retroperitoneal fibrosis"),
        bp("Cardiac valvulopathy (rare)"),
        bp("Erythromelalgia"),
    ]
    return card_wrapper([
        header_cell("DOPAMINE AGONISTS", "Bromocriptine • Pramipexole • Ropinirole • Cabergoline", ACCENT),
        two_col(mech_rows, se_rows, ACCENT, RED, "⚙ Mechanism of Action", "⚠ Side Effects"),
        body_box([
            kp("KDT Key: Non-ergot DA agonists (pramipexole, ropinirole) are preferred — less fibrotic complications"),
            kp("Apomorphine (D1+D2 agonist) given SC for acute 'off' episodes — fastest onset"),
            kp("Warn patients about sudden sleep attacks — avoid driving!"),
        ], LIGHT_GOLD),
    ])

def card_mao_b():
    mech_rows = [
        b("<b>Drugs:</b> Selegiline (Deprenyl), Rasagiline"),
        b("<b>Class:</b> Selective, Irreversible MAO-B Inhibitors"),
        Spacer(1,3),
        b("<b>Mechanism:</b>"),
        bp("MAO-B = monoamine oxidase type B"),
        bp("Responsible for dopamine catabolism in the striatum"),
        bp("Selegiline inhibits MAO-B → reduces DA breakdown → ↑ DA availability"),
        bp("Does NOT inhibit MAO-A at therapeutic doses"),
        bp("NO 'cheese reaction' (tyramine interaction)"),
        Spacer(1,3),
        b("<b>Neuroprotective hypothesis:</b>"),
        bp("Reducing DA oxidation → less free radical production → may slow neurodegeneration (debated)"),
        Spacer(1,3),
        b("<b>Selegiline metabolized to:</b> L-amphetamine & L-methamphetamine (CNS stimulant metabolites)"),
        b("<b>Rasagiline:</b> No amphetamine metabolites; more selective"),
        b("<b>Use:</b> Early monotherapy or adjunct to levodopa for 'wearing off'"),
    ]
    se_rows = [
        b("<b>Common (selegiline):</b>"),
        bp("Insomnia, agitation (amphetamine metabolites)"),
        bp("Nausea"),
        bp("Dizziness"),
        Spacer(1,3),
        b("<b>Interactions (IMPORTANT):</b>"),
        bp("With pethidine/meperidine → serotonin syndrome (FATAL — contraindicated)"),
        bp("With SSRIs/TCAs → serotonin syndrome risk"),
        bp("With sympathomimetics → hypertensive crisis"),
        Spacer(1,3),
        b("<b>At high doses:</b>"),
        bp("Loses MAO-B selectivity → MAO-A inhibited → cheese reaction possible"),
        Spacer(1,3),
        b("<b>Rasagiline side effects:</b>"),
        bp("Headache, arthralgia"),
        bp("Fewer CNS stimulant effects than selegiline"),
    ]
    return card_wrapper([
        header_cell("MAO-B INHIBITORS", "Selegiline (Deprenyl) • Rasagiline", PURPLE),
        two_col(mech_rows, se_rows, PURPLE, RED, "⚙ Mechanism of Action", "⚠ Side Effects"),
        body_box([
            kp("KDT Key: Selegiline is selective MAO-B inhibitor → NO cheese reaction at therapeutic doses"),
            kp("CRITICAL CI: Never combine with pethidine → fatal serotonin syndrome"),
            kp("Rasagiline is 5–10x more potent than selegiline, no amphetamine metabolites"),
        ], LIGHT_PURPLE),
    ])

def card_comt():
    mech_rows = [
        b("<b>Drugs:</b> Entacapone, Tolcapone, Opicapone"),
        b("<b>Class:</b> COMT (Catechol-O-Methyl Transferase) Inhibitors"),
        Spacer(1,3),
        b("<b>Mechanism:</b>"),
        bp("COMT metabolizes levodopa → 3-O-methyldopa (3-OMD, inactive) in the periphery"),
        bp("3-OMD competes with levodopa for LNAT → reduces brain entry"),
        bp("COMT inhibitors block this step → more levodopa available → prolonged plasma half-life"),
        bp("Entacapone: peripheral COMT inhibitor only (does NOT cross BBB)"),
        bp("Tolcapone: inhibits both peripheral AND central COMT (more effective but hepatotoxic)"),
        Spacer(1,3),
        b("<b>Always used WITH levodopa</b> (not effective alone)"),
        b("<b>Stalevo:</b> Levodopa + Carbidopa + Entacapone — triple combination"),
        b("<b>Use:</b> Adjunct to levodopa to reduce 'wearing off' fluctuations"),
    ]
    se_rows = [
        b("<b>Common (entacapone):</b>"),
        bp("Diarrhea (most common reason for stopping entacapone)"),
        bp("Nausea, abdominal pain"),
        bp("Orange-brown discoloration of urine (harmless)"),
        bp("Dyskinesias (as more levodopa reaches brain — reduce levodopa dose)"),
        bp("Hallucinations"),
        Spacer(1,3),
        b("<b>Tolcapone (additional):</b>"),
        bp("HEPATOTOXICITY — potentially fatal (rare)"),
        bp("Requires LFT monitoring every 2 weeks"),
        bp("Reserved for patients not responding to entacapone"),
        Spacer(1,3),
        b("<b>Opicapone:</b>"),
        bp("Once-daily peripheral COMT inhibitor"),
        bp("Newer; better tolerability profile"),
    ]
    return card_wrapper([
        header_cell("COMT INHIBITORS", "Entacapone • Tolcapone • Opicapone", GREEN),
        two_col(mech_rows, se_rows, GREEN, RED, "⚙ Mechanism of Action", "⚠ Side Effects"),
        body_box([
            kp("KDT Key: Entacapone — peripheral COMT only (safer); Tolcapone — central + peripheral (hepatotoxic)"),
            kp("Orange urine with entacapone — warn patients (harmless but alarming)"),
            kp("Diarrhea is the main reason for discontinuing entacapone"),
        ], LIGHT_GREEN),
    ])

def card_amantadine():
    mech_rows = [
        b("<b>Drug:</b> Amantadine"),
        b("<b>Class:</b> Antiviral / NMDA Receptor Antagonist"),
        Spacer(1,3),
        b("<b>Mechanisms (multiple):</b>"),
        bp("1. Increases dopamine RELEASE from surviving neurons"),
        bp("2. Inhibits dopamine RE-UPTAKE"),
        bp("3. Blocks NMDA glutamate receptors → reduces excitotoxicity"),
        bp("4. Mild anticholinergic activity"),
        Spacer(1,3),
        b("<b>Unique use:</b>"),
        bp("Drug of choice for LEVODOPA-INDUCED DYSKINESIAS"),
        bp("Used as monotherapy in early mild PD"),
        bp("Adjunct in moderate-severe PD"),
        Spacer(1,3),
        b("<b>Originally developed as:</b> Antiviral (influenza A)"),
        b("<b>Renally excreted:</b> Reduce dose in renal impairment"),
    ]
    se_rows = [
        b("<b>Common:</b>"),
        bp("Livedo reticularis (mottled purplish skin discoloration — characteristic)"),
        bp("Ankle edema"),
        bp("Insomnia, dizziness"),
        Spacer(1,3),
        b("<b>CNS:</b>"),
        bp("Hallucinations, confusion (especially elderly)"),
        bp("Nightmares"),
        bp("Ataxia"),
        Spacer(1,3),
        b("<b>Anticholinergic effects:</b>"),
        bp("Dry mouth, blurred vision"),
        bp("Urinary retention"),
        Spacer(1,3),
        b("<b>Cardiovascular:</b>"),
        bp("Peripheral edema"),
        bp("Orthostatic hypotension"),
        Spacer(1,3),
        b("<b>Withdrawal:</b>"),
        bp("Abrupt withdrawal → neuroleptic malignant syndrome-like state"),
    ]
    return card_wrapper([
        header_cell("AMANTADINE", "NMDA Antagonist • DA Releaser | Drug of Choice for Levodopa-Induced Dyskinesias", ORANGE),
        two_col(mech_rows, se_rows, ORANGE, RED, "⚙ Mechanism of Action", "⚠ Side Effects"),
        body_box([
            kp("KDT Key: Livedo reticularis = characteristic skin finding with amantadine"),
            kp("DOC for levodopa-induced dyskinesias (NMDA receptor mechanism)"),
            kp("Originally an antiviral — repurposed for PD"),
        ], LIGHT_ORANGE),
    ])

def card_anticholinergics():
    mech_rows = [
        b("<b>Drugs:</b> Trihexyphenidyl (Benzhexol), Biperiden,"),
        b("Procyclidine, Orphenadrine"),
        b("<b>Class:</b> Central Anticholinergic / Antimuscarinic Drugs"),
        Spacer(1,3),
        b("<b>Rationale (KDT):</b>"),
        bp("In PD: DA deficiency → relative excess of ACh activity in striatum"),
        bp("Anticholinergics block muscarinic (M1) receptors in striatum"),
        bp("Restore DA/ACh balance → reduce tremor and rigidity"),
        Spacer(1,3),
        b("<b>Receptor:</b> M1 muscarinic receptor blockade (central)"),
        Spacer(1,3),
        b("<b>Trihexyphenidyl:</b> Most commonly used"),
        b("<b>Best for:</b> Tremor > Rigidity"),
        b("<b>NOT effective for:</b> Bradykinesia (least effective for this)"),
        Spacer(1,3),
        b("<b>Uses:</b>"),
        bp("Drug-induced parkinsonism (antipsychotic-induced EPS) — DOC"),
        bp("Tremor-predominant PD (especially young patients)"),
        bp("Adjunct when levodopa is inadequate for tremor"),
    ]
    se_rows = [
        b("<b>Peripheral antimuscarinic:</b>"),
        bp("Dry mouth (xerostomia)"),
        bp("Blurred vision (cycloplegia)"),
        bp("Urinary retention (CI in BPH)"),
        bp("Constipation"),
        bp("Tachycardia"),
        bp("Mydriasis (CI in narrow-angle glaucoma)"),
        Spacer(1,3),
        b("<b>Central (CNS):</b>"),
        bp("Memory impairment, confusion"),
        bp("Cognitive decline (especially elderly)"),
        bp("Hallucinations, delirium"),
        bp("Sedation, drowsiness"),
        Spacer(1,3),
        b("<b>Contraindications:</b>"),
        bp("Elderly (cognitive impairment)"),
        bp("Benign prostatic hyperplasia"),
        bp("Narrow-angle glaucoma"),
        bp("Dementia (Alzheimer's)"),
    ]
    return card_wrapper([
        header_cell("ANTICHOLINERGIC DRUGS", "Trihexyphenidyl (Benzhexol) • Biperiden • Procyclidine", colors.HexColor("#bf360c")),
        two_col(mech_rows, se_rows, colors.HexColor("#bf360c"), RED, "⚙ Mechanism of Action", "⚠ Side Effects"),
        body_box([
            kp("KDT Key: Best for TREMOR; least effective for BRADYKINESIA"),
            kp("DOC for drug-induced (antipsychotic-induced) parkinsonism"),
            kp("AVOID in elderly — high risk of cognitive impairment & hallucinations"),
        ], LIGHT_RED),
    ])

def card_summary():
    """Summary comparison table card."""
    col_w = [W*0.22, W*0.28, W*0.27, W*0.23]
    header_row = [
        Paragraph("<b>Drug</b>", S("th", fontSize=8, fontName="Helvetica-Bold", textColor=WHITE, alignment=TA_CENTER)),
        Paragraph("<b>Mechanism</b>", S("th", fontSize=8, fontName="Helvetica-Bold", textColor=WHITE, alignment=TA_CENTER)),
        Paragraph("<b>Key Side Effect</b>", S("th", fontSize=8, fontName="Helvetica-Bold", textColor=WHITE, alignment=TA_CENTER)),
        Paragraph("<b>Key Point</b>", S("th", fontSize=8, fontName="Helvetica-Bold", textColor=WHITE, alignment=TA_CENTER)),
    ]
    def row(d, m, s, k, bg=WHITE):
        cs = S("tc", fontSize=7.5, fontName="Helvetica", textColor=DARK_TEXT, leading=11, alignment=TA_LEFT)
        return [Paragraph(d,cs), Paragraph(m,cs), Paragraph(s,cs), Paragraph(k,cs)]

    data = [
        header_row,
        row("Levodopa", "Dopamine precursor\n→ crosses BBB\n→ DA in striatum",
            "Dyskinesias\nOn-off\nPsychosis", "Most effective\ndrug"),
        row("+ Carbidopa", "Peripheral DDC\ninhibitor\n(does NOT cross BBB)",
            "↑ CNS side effects\n(more levodopa\nto brain)", "Reduces dose\n& peripheralSE"),
        row("DA Agonists\n(Pramipexole,\nRopinirole)", "Direct D2/D3\nreceptor agonist\n(no conversion needed)",
            "Hallucinations\nImpulse control\ndisorders", "Non-ergot\npreferred"),
        row("Selegiline\n(MAO-B inh.)", "Irreversible\nselective\nMAO-B inhibitor",
            "Insomnia\nFatal interaction\nwith pethidine", "No cheese\nreaction at\ntherapeutic dose"),
        row("Entacapone\n(COMT inh.)", "Peripheral COMT\ninhibitor\n↑ levodopa t½",
            "Diarrhea\nOrange urine\nDyskinesias", "Always given\nwith levodopa"),
        row("Amantadine", "NMDA antagonist\n+ DA release\n+ reuptake block",
            "Livedo reticularis\nAnkle edema\nHallucinations", "DOC for\nlevodopa-induced\ndyskinesias"),
        row("Trihexyphenidyl\n(Anticholinergic)", "M1 muscarinic\nreceptor blockade\nin striatum",
            "Dry mouth\nUrinary retention\nCognitive decline", "DOC for\ndrug-induced\nParkinsonism"),
    ]

    t = Table(data, colWidths=col_w, repeatRows=1)
    t.setStyle(TableStyle([
        ("BACKGROUND",    (0,0), (-1,0), DARK_BLUE),
        ("ROWBACKGROUNDS",(0,1), (-1,-1), [WHITE, GRAY_LIGHT]),
        ("GRID",          (0,0), (-1,-1), 0.4, colors.HexColor("#9e9e9e")),
        ("VALIGN",        (0,0), (-1,-1), "TOP"),
        ("TOPPADDING",    (0,0), (-1,-1), 5),
        ("BOTTOMPADDING", (0,0), (-1,-1), 5),
        ("LEFTPADDING",   (0,0), (-1,-1), 5),
        ("RIGHTPADDING",  (0,0), (-1,-1), 5),
    ]))

    title_t = Table([[Paragraph("QUICK COMPARISON TABLE — All Antiparkinson Drugs", card_title_style)]],
                    colWidths=[W])
    title_t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), DARK_BLUE),
        ("TOPPADDING",    (0,0), (-1,-1), 8),
        ("BOTTOMPADDING", (0,0), (-1,-1), 8),
    ]))
    return KeepTogether([title_t, t, Spacer(1, 0.35*cm)])

def card_pd_overview():
    """Pathophysiology overview card."""
    items = [
        b("<b>Parkinson's Disease Pathophysiology:</b>"),
        bp("Degeneration of dopaminergic neurons in <b>Substantia Nigra pars compacta (SNpc)</b>"),
        bp("Loss of nigrostriatal tract → ↓ Dopamine in striatum"),
        bp("Relative excess of <b>Acetylcholine (ACh)</b> activity → motor symptoms"),
        bp("Cardinal features: <b>TRAP</b> — Tremor (resting), Rigidity (cogwheel), Akinesia/Bradykinesia, Postural instability"),
        Spacer(1,4),
        b("<b>Treatment Goal:</b> Restore DA/ACh balance in striatum"),
        Spacer(1,4),
        b("<b>Classification of Antiparkinson Drugs (KDT):</b>"),
        b("<b>A. Dopaminergic (↑ DA):</b>"),
        bp("1. DA Precursor: Levodopa (± Carbidopa, Benserazide)"),
        bp("2. DA Agonists: Bromocriptine, Pramipexole, Ropinirole, Cabergoline, Apomorphine"),
        bp("3. MAO-B Inhibitors: Selegiline, Rasagiline"),
        bp("4. COMT Inhibitors: Entacapone, Tolcapone, Opicapone"),
        bp("5. DA Releaser + NMDA antagonist: Amantadine"),
        b("<b>B. Anticholinergic (↓ ACh):</b>"),
        bp("Trihexyphenidyl (Benzhexol), Biperiden, Procyclidine, Orphenadrine"),
    ]
    title_t = Table([[Paragraph("PARKINSON'S DISEASE — OVERVIEW & DRUG CLASSIFICATION", card_title_style)]],
                    colWidths=[W])
    title_t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), colors.HexColor("#004d40")),
        ("TOPPADDING",    (0,0), (-1,-1), 8),
        ("BOTTOMPADDING", (0,0), (-1,-1), 8),
    ]))
    return KeepTogether([title_t, body_box(items, LIGHT_TEAL),
                         body_box([mn("Mnemonic: TRAP = Tremor • Rigidity • Akinesia • Postural instability")], LIGHT_GOLD),
                         Spacer(1, 0.35*cm)])

# ═══════════════════════════════════════════════════════════════════════════════
#  BUILD DOCUMENT
# ═══════════════════════════════════════════════════════════════════════════════

story = []

# Cover
story.append(make_cover())
story.append(Spacer(1, 0.4*cm))

# Overview
story.append(card_pd_overview())

# Individual drug cards
story.append(card_levodopa())
story.append(card_carbidopa())
story.append(card_dopamine_agonists())
story.append(card_mao_b())
story.append(card_comt())
story.append(card_amantadine())
story.append(card_anticholinergics())

# Summary table
story.append(card_summary())

# Footer note
story.append(body_box([
    Paragraph("Reference: KD Tripathi — Essentials of Medical Pharmacology, 8th Ed. | Chapter 32: Drugs for Parkinsonism",
              S("ref", fontSize=8, fontName="Helvetica-Oblique", textColor=GRAY_MED, alignment=TA_CENTER))
], WHITE))

doc.build(story)
print(f"PDF created: {OUTPUT}")
Running Command

cd /home/daytona/workspace/antiparkinson-flashcards && python make_flashcards.py…

Running Command

ls -lh /home/daytona/workspace/antiparkinson-flashcards/Antiparkinson_Drugs_Flas…

Your flashcard PDF is ready! Here is your download link:

Antiparkinson Drugs Flashcards

PDF Document · PDF


What's inside (9 flashcard sections):

CardDrugColor Theme
0Overview & Classification of Antiparkinson DrugsDark Teal
1Levodopa — mechanism, peripheral vs central actionBlue
2Levodopa + Carbidopa — rationale, dose reductionTeal
3Dopamine Agonists (Pramipexole, Ropinirole, Bromocriptine)Sky Blue
4MAO-B Inhibitors (Selegiline, Rasagiline)Purple
5COMT Inhibitors (Entacapone, Tolcapone)Green
6Amantadine — NMDA antagonist, DOC for dyskinesiasOrange
7Anticholinergics (Trihexyphenidyl, Biperiden)Brown-Red
8Quick Comparison Table — all drugs side-by-sideNavy
Each card has a two-column layout: ⚙ Mechanism on the left (blue background) and ⚠ Side Effects on the right (red background), with gold ⭐ KDT key points at the bottom.
This is a shared conversation. Sign in to Orris to start your own chat.