namespace SelectPdf.Samples
{
    public record SampleEntry(string Slug, string Title, string Desc);

    public record SampleGroup(string Name, SampleEntry[] Items);

    // Single source of truth for the sample directory (home card grid) and the
    // compact "all samples" rail in _Layout / _LayoutConverter (via the
    // _SpdfRail partial).
    public static class SampleCatalog
    {
        public static readonly SampleGroup[] Groups =
        {
            new("Pdf Creation Basics", new SampleEntry[]
            {
                new("GettingStarted",       "Getting Started",        "Create a PDF and write text"),
                new("DocumentProperties",   "Document Properties",    "Set title, author, keywords"),
                new("PdfViewerPreferences", "Viewer Preferences",     "Control how viewers open the PDF"),
                new("PageSettings",         "Page Settings",          "Size, orientation, margins"),
                new("PdfSecurity",          "Security Settings",      "Passwords and permissions"),
                new("PdfElementsPositions", "Element Positions",      "Place elements precisely"),
                new("PdfTextElement",       "Text Element",           "Draw styled text"),
                new("PdfImageElement",      "Image Element",          "Place images in the PDF"),
                new("PdfHtmlElement",       "Html Element",           "Render HTML into a region"),
                new("GraphicElements",      "Graphic Elements",       "Lines, rectangles, shapes"),
                new("PdfLinks",             "Links",                  "Internal and external links"),
                new("PdfBookmarks",         "Bookmarks",              "Document outline tree"),
            }),
            new("Advanced Topics", new SampleEntry[]
            {
                new("PdfTemplates",                 "Templates",                    "Reusable page templates"),
                new("HeadersAndFooters",            "Headers & Footers",            "Repeat content per page"),
                new("PdfStamps",                    "Stamps",                       "Stamp content onto pages"),
                new("PdfWatermarks",                "Watermarks",                   "Background watermarks"),
                new("PageNumbering",                "Page Numbering",               "Add page numbers"),
                new("PdfMerge",                     "Merge",                        "Combine multiple PDFs"),
                new("PdfSplit",                     "Split",                        "Split a PDF into parts"),
                new("DigitalSignatures",            "Digital Signatures",           "Sign documents"),
                new("ModifyExistingPdf",            "Modify Existing PDF",          "Edit an existing document"),
                new("PdfCompression",               "Compression",                  "Shrink file size"),
                new("AdvancedPdfSecurity",          "Advanced Security",            "Fine-grained security + signing"),
                new("PdfFormFilling",               "Form Filling",                 "Fill AcroForm fields"),
                new("PdfPortfolio",                 "Portfolio",                    "PDF portfolios / packages"),
                new("PdfResize",                    "Resize / Scale",               "Resize or scale pages"),
                new("ExistingPdfHeadersAndFooters", "Existing PDF Headers & Footers","Headers/footers on existing PDFs"),
            }),
            new("Html to Pdf Converter", new SampleEntry[]
            {
                new("HtmlToPdfConverter",            "Getting Started",        "Convert HTML to PDF"),
                new("ConvertUrlToPdf",               "Convert URL to PDF",     "Render a web page to PDF"),
                new("ConvertHtmlCodeToPdf",          "Convert HTML Code",      "Render an HTML string to PDF"),
                new("PdfConverterProperties",        "Document Properties",    "Metadata on converted PDFs"),
                new("PdfConverterViewerPreferences", "Viewer Preferences",     "Viewer prefs on conversion"),
                new("PdfConverterSecurity",          "Security Settings",      "Secure converted PDFs"),
                new("ConvertMultipleUrlsToPdf",      "Multiple URLs",          "Merge several URLs into one PDF"),
                new("ConversionDelay",               "Conversion Delay",       "Wait before rendering"),
                new("HtmlToPdfHeadersAndFooters",    "Headers & Footers",      "HTML headers and footers"),
                new("PageBreaks",                    "Page Breaks",            "Control page breaks"),
                new("AutomaticBookmarks",            "Automatic Bookmarks",    "Bookmarks from HTML headings"),
                new("HttpHeaders",                   "HTTP Headers",           "Send custom request headers"),
                new("HttpCookies",                   "HTTP Cookies",           "Send cookies with the request"),
                new("HttpPostRequest",               "HTTP POST Request",      "Convert a POST response"),
                new("ConvertFromJs",                 "Start from JavaScript",  "Trigger conversion from JS"),
                new("MediaTypes",                    "Media Types",            "Screen vs print CSS"),
                new("HtmlToPdfConverterLinks",       "Links",                  "Internal/external links in output"),
                new("PartialConversion",             "Partial Conversion",     "Convert a single page section"),
                new("ExcludeFromConversion",         "Exclude Elements",       "Skip elements when converting"),
                new("CurrentWebPageToPdf",           "Current Web Page",       "Convert the current page"),
                new("ConvertAndEmail",               "Convert & Email",        "Convert and email the PDF"),
                new("WebElementsLocation",           "Web Elements Location",  "Get element positions in the PDF"),
                new("TableOfContents",               "Table of Contents",      "Generate a table of contents"),
            }),
            new("Html to Image Converter", new SampleEntry[]
            {
                new("ConvertUrlToImage",       "Convert URL to Image",      "Render a web page to an image"),
                new("ConvertHtmlCodeToImage",  "Convert HTML Code to Image","Render an HTML string to an image"),
            }),
            new("Pdf To Text", new SampleEntry[]
            {
                new("PdfToTextConverter", "Extract Text", "Extract text from a PDF"),
                new("SearchPdfText",      "Search Text",  "Search for text in a PDF"),
            }),
            new("Pdf To Image", new SampleEntry[]
            {
                new("PdfToImageConverter", "PDF Pages to Images", "Rasterize PDF pages to images"),
            }),
        };
    }
}
