"""Deck archetype definitions — structured templates for common deck types."""

from __future__ import annotations

from dataclasses import dataclass, field

from pptx_mcp.models.slides import SlideType


@dataclass(frozen=True)
class SlideSlot:
    """A slot in a deck archetype's structure."""
    slide_type: SlideType
    title_template: str
    required: bool = True


@dataclass(frozen=True)
class DeckArchetype:
    """Template for a specific kind of presentation."""
    name: str
    display_name: str
    description: str
    slots: tuple[SlideSlot, ...]
    min_slides: int = 5
    max_slides: int = 20


ARCHETYPES: dict[str, DeckArchetype] = {
    "pitch_deck": DeckArchetype(
        name="pitch_deck",
        display_name="Pitch Deck",
        description="Investor/stakeholder pitch with problem, solution, traction, team, and ask.",
        min_slides=8,
        max_slides=15,
        slots=(
            SlideSlot(SlideType.TITLE, "Company Pitch"),
            SlideSlot(SlideType.CONTENT, "The Problem"),
            SlideSlot(SlideType.CONTENT, "Our Solution"),
            SlideSlot(SlideType.BIG_NUMBER, "Traction"),
            SlideSlot(SlideType.IMAGE_TEXT, "Product Overview"),
            SlideSlot(SlideType.DASHBOARD, "Key Metrics"),
            SlideSlot(SlideType.ICON_GRID, "Why Us"),
            SlideSlot(SlideType.CHART, "Market Opportunity"),
            SlideSlot(SlideType.TEAM, "The Team"),
            SlideSlot(SlideType.CLOSING, "The Ask", required=False),
        ),
    ),
    "board_deck": DeckArchetype(
        name="board_deck",
        display_name="Board Update",
        description="Quarterly board update with financials, strategy, and operational review.",
        min_slides=8,
        max_slides=20,
        slots=(
            SlideSlot(SlideType.TITLE, "Board Update"),
            SlideSlot(SlideType.AGENDA, "Agenda"),
            SlideSlot(SlideType.DASHBOARD, "Financial Overview"),
            SlideSlot(SlideType.CHART, "Revenue & Growth"),
            SlideSlot(SlideType.PROCESS, "Strategic Initiatives"),
            SlideSlot(SlideType.SWOT, "Strategic Assessment"),
            SlideSlot(SlideType.CONTENT, "Operational Highlights"),
            SlideSlot(SlideType.CONTENT, "Risks & Mitigations"),
            SlideSlot(SlideType.CLOSING, "Next Steps"),
        ),
    ),
    "sales_deck": DeckArchetype(
        name="sales_deck",
        display_name="Sales Deck",
        description="Customer-facing sales presentation with value proposition and social proof.",
        min_slides=7,
        max_slides=15,
        slots=(
            SlideSlot(SlideType.TITLE, "Sales Presentation"),
            SlideSlot(SlideType.CONTENT, "The Challenge"),
            SlideSlot(SlideType.STEP_CARDS, "Our Approach"),
            SlideSlot(SlideType.COMPARISON, "Why Choose Us"),
            SlideSlot(SlideType.DASHBOARD, "Results"),
            SlideSlot(SlideType.QUOTE, "What Customers Say"),
            SlideSlot(SlideType.TABLE, "Pricing"),
            SlideSlot(SlideType.CLOSING, "Get Started"),
        ),
    ),
    "all_hands": DeckArchetype(
        name="all_hands",
        display_name="All-Hands Meeting",
        description="Company-wide update with achievements, metrics, and team recognition.",
        min_slides=7,
        max_slides=20,
        slots=(
            SlideSlot(SlideType.TITLE, "All-Hands Meeting"),
            SlideSlot(SlideType.AGENDA, "Agenda"),
            SlideSlot(SlideType.ICON_GRID, "Highlights"),
            SlideSlot(SlideType.DASHBOARD, "Key Metrics"),
            SlideSlot(SlideType.TIMELINE, "Roadmap"),
            SlideSlot(SlideType.TEAM, "New Joiners", required=False),
            SlideSlot(SlideType.CLOSING, "Thank You"),
        ),
    ),
    "project_update": DeckArchetype(
        name="project_update",
        display_name="Project Update",
        description="Status update with progress, timeline, and risk assessment.",
        min_slides=6,
        max_slides=15,
        slots=(
            SlideSlot(SlideType.TITLE, "Project Update"),
            SlideSlot(SlideType.AGENDA, "Agenda"),
            SlideSlot(SlideType.CONTENT, "Executive Summary"),
            SlideSlot(SlideType.PROCESS, "Current Status"),
            SlideSlot(SlideType.TIMELINE, "Project Timeline"),
            SlideSlot(SlideType.PROS_CONS, "Risks & Mitigations"),
            SlideSlot(SlideType.CLOSING, "Next Steps"),
        ),
    ),
    "training": DeckArchetype(
        name="training",
        display_name="Training Deck",
        description="Educational presentation with structured lessons and exercises.",
        min_slides=6,
        max_slides=25,
        slots=(
            SlideSlot(SlideType.TITLE, "Training Session"),
            SlideSlot(SlideType.AGENDA, "Learning Objectives"),
            SlideSlot(SlideType.CONTENT, "Introduction"),
            SlideSlot(SlideType.STEP_CARDS, "Key Concepts"),
            SlideSlot(SlideType.SECTION, "Practice"),
            SlideSlot(SlideType.CONTENT, "Summary"),
            SlideSlot(SlideType.CLOSING, "Next Steps"),
        ),
    ),
}
