from pptx import Presentation
from pptx.util import Inches, Pt
from pptx.enum.text import PP_ALIGN

prs = Presentation()
prs.slide_width = Inches(13.333)
prs.slide_height = Inches(7.5)

def add_title_slide(title, subtitle=""):
    slide = prs.slides.add_slide(prs.slide_layouts[6])  # blank
    # Title
    txBox = slide.shapes.add_textbox(Inches(0.5), Inches(2.5), Inches(12.333), Inches(1.5))
    tf = txBox.text_frame
    p = tf.paragraphs[0]
    p.text = title
    p.font.size = Pt(44)
    p.font.bold = True
    p.alignment = PP_ALIGN.CENTER
    # Subtitle
    if subtitle:
        txBox2 = slide.shapes.add_textbox(Inches(0.5), Inches(4), Inches(12.333), Inches(1))
        tf2 = txBox2.text_frame
        p2 = tf2.paragraphs[0]
        p2.text = subtitle
        p2.font.size = Pt(24)
        p2.alignment = PP_ALIGN.CENTER

def add_content_slide(title, bullets):
    slide = prs.slides.add_slide(prs.slide_layouts[6])  # blank
    # Title
    txBox = slide.shapes.add_textbox(Inches(0.5), Inches(0.5), Inches(12.333), Inches(1))
    tf = txBox.text_frame
    p = tf.paragraphs[0]
    p.text = title
    p.font.size = Pt(36)
    p.font.bold = True
    # Content
    txBox2 = slide.shapes.add_textbox(Inches(0.5), Inches(1.5), Inches(12.333), Inches(5.5))
    tf2 = txBox2.text_frame
    tf2.word_wrap = True
    for i, bullet in enumerate(bullets):
        if i == 0:
            p = tf2.paragraphs[0]
        else:
            p = tf2.add_paragraph()
        p.text = "• " + bullet
        p.font.size = Pt(20)
        p.space_after = Pt(12)

# SLIDE 1: Title
add_title_slide(
    "One Platform. Smarter Learning. Massive Savings.",
    "PHINMA Learning Platform (PLP)\nSymph × PHINMA Education"
)

# SLIDE 2: The Challenge
add_content_slide("15-20% of Students Drop Out", [
    "For 177,000 students, that's an entire college disappearing every year",
    "Difficult courses (Anatomy & Physiology) cause failures",
    "Retakes add financial burden → dropouts",
    "Intervention comes too late (one week before finals)",
    "Teachers can't give personalized feedback at scale",
    "Every dropout is a broken promise — and a business cost"
])

# SLIDE 3: Hidden Cost
add_content_slide("You're Paying for 7+ Platforms", [
    "Canvas LMS — Course management",
    "Khan Academy — Learning content", 
    "Quiz Whizzer — Gamified quizzes",
    "Google Classroom — Communication",
    "Analytics tools — Reporting",
    "Learning Pod — Physical support",
    "Books — Reference",
    "",
    "Fragmented. Expensive. No AI."
])

# SLIDE 4: The Solution
add_content_slide("PHINMA Learning Platform (PLP)", [
    "One platform that replaces Canvas + Khan + Quiz Whizzer + Analytics",
    "AND adds AI capabilities none of them have:",
    "",
    "✅ Proactive Intervention — AI flags at-risk students in Week 2, not Week 10",
    "✅ Personalized Paths — Adapts to each student's learning needs",
    "✅ Instant Feedback — Meaningful feedback after every quiz",
    "✅ Teacher Superpowers — Real-time dashboards, no guesswork",
    "✅ Admin Visibility — School-wide analytics, enrollment prediction"
])

# SLIDE 5: What We Replace
add_content_slide("Platform Consolidation", [
    "Canvas LMS → ✓ FULL REPLACE (Already built)",
    "Khan Academy → ✓ FULL REPLACE (Curate OER content)",
    "Quiz Whizzer → ✓ FULL REPLACE (Add multiplayer mode)",
    "Google Classroom → ◐ PARTIAL (Video conf gap)",
    "Analytics → ✓ FULL REPLACE (Build admin dashboard)",
    "Learning Pod → ✗ NO (Physical infrastructure)",
    "",
    "4 platforms consolidated. AI added. One vendor."
])

# SLIDE 6: The Numbers
add_content_slide("ROI That Speaks for Itself", [
    "PILOT (SWU): 3,500 students",
    "  • Current spend: ~$112/student/year",
    "  • With PLP: ~$72/student/year", 
    "  • Annual Savings: ~$73,000",
    "",
    "FULL NETWORK: 177,000 students",
    "  • Annual Savings: ~$19.8 MILLION",
    "  • Cost Reduction: 56%",
    "",
    "Consolidation pays for itself. AI is the bonus."
])

# SLIDE 7: The Model
add_content_slide("Hypercustom Subscription — Zero Risk", [
    "Upfront cost: ₱0 — We build V1 at our risk",
    "Monthly: $5-6/student/month",
    "Minimum: 2,000 users",
    "Go-live: 10-12 weeks",
    "Updates: 16 feature releases/year included",
    "Hosting: Fully managed by Symph",
    "AI: 50 chats/student included",
    "",
    "We succeed when students succeed."
])

# SLIDE 8: The Rollout
add_content_slide("Phased Deployment", [
    "PHASE 1 (Weeks 1-12): Build & Configure",
    "  • Platform setup, content upload, integrations",
    "",
    "PHASE 2 (Months 3-4): Pilot at SWU",
    "  • Live with Anaphy, 3,500 students, intensive feedback",
    "",
    "PHASE 3 (Month 5): Expand",
    "  • Add more courses, more campuses, optimize",
    "",
    "PHASE 4 (Month 6+): Full Network",
    "  • All PHINMA schools, ongoing support"
])

# SLIDE 9: Demo
add_content_slide("See It In Action", [
    "Live POC: phinma-pathways.lovable.app/dashboard",
    "",
    "Three views:",
    "🎓 Student — Personalized learning, AI assistant, instant feedback",
    "👩‍🏫 Teacher — Progress dashboards, intervention triggers",
    "🏫 Admin — School-wide analytics, content management",
    "",
    "[Switch to demo]"
])

# SLIDE 10: Why Symph
add_content_slide("Why Symph", [
    "16 Years. Real Clients. Philippine DNA.",
    "",
    "Enterprise clients: Globe, BPI, government agencies",
    "Education focus: Built for Filipino students",
    "Hypercustom model: We build what you need, not what we have",
    "",
    "We're not selling software. We're building YOUR platform."
])

# SLIDE 11: The Ask
add_content_slide("Let's Start with SWU", [
    "Immediate next steps:",
    "",
    "1. ✅ LMS Architecture Audit — Map existing systems (2 weeks)",
    "2. ✅ Pilot Scope — Agree on Anaphy, 3,500 students, success metrics",
    "3. ✅ Build & Launch — Live in 10-12 weeks",
    "4. ✅ Prove It — Measure dropout reduction, then scale",
    "",
    "Target: Meet with SWU team Feb 23-27"
])

# SLIDE 12: Contact
add_title_slide(
    "Ready to Transform Student Success?",
    "Symph\n\nOne platform. Smarter learning. $19.8M in savings."
)

# Save
prs.save('/home/aria/marketing-assets/uploads/phinma-proposal-20260219/PHINMA-PLP-Pitch-Deck-v2.pptx')
print("Created PHINMA-PLP-Pitch-Deck-v2.pptx")
