<?php
/**
 * Generator for SmartThink Global Technology solution pages.
 * Creates T2-template pages for each solution listed in the mega-menu.
 * Run from project root: php scripts/generate_solution_pages.php
 */

$baseDir = __DIR__ . '/../website';
$includesDir = $baseDir . '/includes';

$solutions = [
    // AI & Intelligence
    ['slug' => 'ai-business-assistants', 'pillar' => 'AI & Intelligence Solutions', 'pillar_slug' => 'solutions-ai', 'title' => 'Give Every Employee an AI Assistant That Knows Your Business', 'short' => 'AI assistants trained on your knowledge base, processes, and systems.'],
    ['slug' => 'ai-chatbots', 'pillar' => 'AI & Intelligence Solutions', 'pillar_slug' => 'solutions-ai', 'title' => 'Automate Customer and Employee Conversations with AI Chatbots', 'short' => 'Intelligent chatbots that resolve requests, answer questions, and escalate when needed.'],
    ['slug' => 'ai-knowledge-platforms', 'pillar' => 'AI & Intelligence Solutions', 'pillar_slug' => 'solutions-ai', 'title' => 'Centralize Knowledge and Make It Accessible with AI', 'short' => 'Unify documents, policies, and data into an intelligent, searchable knowledge platform.'],
    ['slug' => 'predictive-analytics', 'pillar' => 'AI & Intelligence Solutions', 'pillar_slug' => 'solutions-ai', 'title' => 'Turn Data Into Foresight with Predictive Analytics', 'short' => 'Use machine learning to forecast outcomes, identify risks, and optimize decisions.'],
    ['slug' => 'intelligent-decision-support', 'pillar' => 'AI & Intelligence Solutions', 'pillar_slug' => 'solutions-ai', 'title' => 'Make Faster, Smarter Decisions with AI-Powered Decision Support', 'short' => 'Augment leadership and operations with AI-driven recommendations and scenario analysis.'],
    ['slug' => 'ai-document-processing', 'pillar' => 'AI & Intelligence Solutions', 'pillar_slug' => 'solutions-ai', 'title' => 'Eliminate Document Bottlenecks and Compliance Risk with AI', 'short' => 'Extract, classify, and process documents automatically with high accuracy.'],
    ['slug' => 'ai-workforce-productivity', 'pillar' => 'AI & Intelligence Solutions', 'pillar_slug' => 'solutions-ai', 'title' => 'Boost Workforce Productivity with Embedded AI Tools', 'short' => 'Embed AI into daily workflows to accelerate output and reduce manual work.'],
    ['slug' => 'ai-governance', 'pillar' => 'AI & Intelligence Solutions', 'pillar_slug' => 'solutions-ai', 'title' => 'Govern AI Responsibly and Sustainably', 'short' => 'Build the policies, controls, and oversight needed for trustworthy AI adoption.'],

    // Digital Transformation
    ['slug' => 'enterprise-digital-transformation', 'pillar' => 'Digital Transformation', 'pillar_slug' => 'solutions-digital-transformation', 'title' => 'Transform Your Enterprise for the Digital Economy', 'short' => 'A structured, end-to-end approach to modernizing strategy, operations, and technology.'],
    ['slug' => 'process-automation', 'pillar' => 'Digital Transformation', 'pillar_slug' => 'solutions-digital-transformation', 'title' => 'Automate Processes and Free Your People for Higher-Value Work', 'short' => 'Identify, design, and deploy intelligent automation across the organization.'],
    ['slug' => 'cloud-transformation', 'pillar' => 'Digital Transformation', 'pillar_slug' => 'solutions-digital-transformation', 'title' => 'Modernize Securely with Cloud Transformation', 'short' => 'Migrate, optimize, and secure cloud infrastructure for agility and scale.'],
    ['slug' => 'smart-operations-platforms', 'pillar' => 'Digital Transformation', 'pillar_slug' => 'solutions-digital-transformation', 'title' => 'Build Smart Operations Platforms That Run the Business', 'short' => 'Integrated platforms that connect operations, data, and decision-making.'],
    ['slug' => 'business-intelligence-dashboards', 'pillar' => 'Digital Transformation', 'pillar_slug' => 'solutions-digital-transformation', 'title' => 'See the Business Clearly with Business Intelligence Dashboards', 'short' => 'Real-time dashboards and analytics that turn data into executive insight.'],
    ['slug' => 'digital-workplace', 'pillar' => 'Digital Transformation', 'pillar_slug' => 'solutions-digital-transformation', 'title' => 'Create a Digital Workplace That Works for Everyone', 'short' => 'Modern collaboration, communication, and productivity environments.'],
    ['slug' => 'enterprise-collaboration', 'pillar' => 'Digital Transformation', 'pillar_slug' => 'solutions-digital-transformation', 'title' => 'Connect Teams with Enterprise Collaboration Platforms', 'short' => 'Unified collaboration tools designed for security, scale, and cross-border work.'],

    // Cybersecurity & Risk
    ['slug' => 'cybersecurity-strategy', 'pillar' => 'Cybersecurity & Risk Intelligence', 'pillar_slug' => 'solutions-cybersecurity', 'title' => 'Build a Cybersecurity Strategy Aligned to Business Risk', 'short' => 'Develop a security strategy that protects what matters most and enables growth.'],
    ['slug' => 'risk-assessments', 'pillar' => 'Cybersecurity & Risk Intelligence', 'pillar_slug' => 'solutions-cybersecurity', 'title' => 'Identify and Prioritize Risk with Expert Assessments', 'short' => 'Comprehensive risk assessments that quantify exposure and guide investment.'],
    ['slug' => 'compliance-programs', 'pillar' => 'Cybersecurity & Risk Intelligence', 'pillar_slug' => 'solutions-cybersecurity', 'title' => 'Build Compliance Programs That Pass Audits and Reduce Risk', 'short' => 'Design and operate compliance programmes aligned to ISO, SOC 2, NIST, and more.'],
    ['slug' => 'soc2-readiness', 'pillar' => 'Cybersecurity & Risk Intelligence', 'pillar_slug' => 'solutions-cybersecurity', 'title' => 'Achieve SOC 2 Readiness with Confidence', 'short' => 'Prepare controls, evidence, and processes for SOC 2 Type I and Type II audits.'],
    ['slug' => 'iso-27001', 'pillar' => 'Cybersecurity & Risk Intelligence', 'pillar_slug' => 'solutions-cybersecurity', 'title' => 'Implement and Certify ISO 27001', 'short' => 'Build an information security management system that earns international certification.'],
    ['slug' => 'nist-framework', 'pillar' => 'Cybersecurity & Risk Intelligence', 'pillar_slug' => 'solutions-cybersecurity', 'title' => 'Align Security Operations to the NIST Cybersecurity Framework', 'short' => 'Map, measure, and improve security posture using the NIST CSF.'],
    ['slug' => 'security-awareness', 'pillar' => 'Cybersecurity & Risk Intelligence', 'pillar_slug' => 'solutions-cybersecurity', 'title' => 'Transform Your Culture with Security Awareness', 'short' => 'Train employees to recognize threats and become your first line of defence.'],
    ['slug' => 'virtual-ciso', 'pillar' => 'Cybersecurity & Risk Intelligence', 'pillar_slug' => 'solutions-cybersecurity', 'title' => 'Senior Cybersecurity Leadership, Without the Full-Time Cost', 'short' => 'Flexible executive security leadership for mid-market and government organizations.'],

    // Enterprise Solutions
    ['slug' => 'erp-solutions', 'pillar' => 'Enterprise Solutions', 'pillar_slug' => 'solutions-enterprise', 'title' => 'Run the Business with Modern ERP Solutions', 'short' => 'Integrated enterprise resource planning for finance, operations, and supply chain.'],
    ['slug' => 'crm-platforms', 'pillar' => 'Enterprise Solutions', 'pillar_slug' => 'solutions-enterprise', 'title' => 'Strengthen Relationships with CRM Platforms', 'short' => 'Customer relationship management platforms that improve sales, service, and retention.'],
    ['slug' => 'data-management', 'pillar' => 'Enterprise Solutions', 'pillar_slug' => 'solutions-enterprise', 'title' => 'Turn Data Into a Trusted Asset with Data Management', 'short' => 'Govern, integrate, and secure enterprise data for analytics and operations.'],
    ['slug' => 'citizen-service-platforms', 'pillar' => 'Enterprise Solutions', 'pillar_slug' => 'solutions-enterprise', 'title' => 'Deliver Public Services Digitally with Citizen Service Platforms', 'short' => 'Mobile-first, accessible portals that transform government service delivery.'],
    ['slug' => 'regulatory-technology', 'pillar' => 'Enterprise Solutions', 'pillar_slug' => 'solutions-enterprise', 'title' => 'Simplify Compliance with Regulatory Technology', 'short' => 'Technology solutions that streamline reporting, monitoring, and regulatory adherence.'],
    ['slug' => 'e-government-solutions', 'pillar' => 'Enterprise Solutions', 'pillar_slug' => 'solutions-enterprise', 'title' => 'Modernize Government with E-Government Solutions', 'short' => 'End-to-end digital government platforms and service delivery infrastructure.'],
    ['slug' => 'smart-business-portals', 'pillar' => 'Enterprise Solutions', 'pillar_slug' => 'solutions-enterprise', 'title' => 'Build Smart Business Portals for Employees and Partners', 'short' => 'Secure, integrated portals that connect employees, partners, and stakeholders.'],
    ['slug' => 'digital-service-delivery', 'pillar' => 'Enterprise Solutions', 'pillar_slug' => 'solutions-enterprise', 'title' => 'Reimagine Digital Service Delivery', 'short' => 'Design and deploy digital services that meet user needs and operational goals.'],
];

$badgeColor = [
    'AI & Intelligence Solutions' => 'var(--blue-accent)',
    'Digital Transformation' => 'var(--gold-accent)',
    'Cybersecurity & Risk Intelligence' => 'var(--teal-accent)',
    'Enterprise Solutions' => 'var(--gold-accent)',
];

$template = <<<'HTML'
<?php
require_once __DIR__ . '/_site_content.php';
$activePage = 'solutions';
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{TITLE}} — SmartThink Global Technology</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="../assets/css/smartthink-global.css">
</head>
<body>
<?php include __DIR__ . '/includes/header.php'; ?>

    <section class="st-hero" style="min-height: 55vh; padding: 8rem 0 5rem;">
        <div class="container">
            <nav aria-label="breadcrumb" class="mb-3"><ol class="breadcrumb" style="--bs-breadcrumb-divider: '>';"><li class="breadcrumb-item"><a href="solutions.php" style="color: rgba(255,255,255,.7);">Solutions</a></li><li class="breadcrumb-item"><a href="{{PILLAR_SLUG}}.php" style="color: rgba(255,255,255,.7);">{{PILLAR}}</a></li><li class="breadcrumb-item active" aria-current="page" style="color: #fff;">{{PAGE_NAME}}</li></ol></nav>
            <div class="st-hero-badge" style="background: {{BADGE_COLOR}}; color: #fff; padding: .25rem .75rem; border-radius: 4px; display: inline-block;"><span>{{PILLAR}}</span></div>
            <h1 class="mt-3">{{TITLE}}</h1>
            <p>{{SHORT}}</p>
            <div class="st-hero-actions">
                <a class="st-btn st-btn-primary" href="contact.php">Schedule Consultation</a>
                <a class="st-btn st-btn-ghost-white" href="contact.php">Download Capability Statement</a>
            </div>
        </div>
    </section>

    <section class="st-section">
        <div class="container">
            <h2>The Challenge</h2>
            <p>Organizations face growing pressure to modernize, secure, and scale their operations while managing complexity, risk, and limited internal capacity. {{PAGE_NAME}} addresses this pressure by delivering structured, practitioner-led expertise that produces measurable outcomes without the overhead of building everything in-house.</p>
            <p>Without the right approach, these initiatives become fragmented, slow, and expensive — with unclear accountability and limited return on investment.</p>
        </div>
    </section>

    <section class="st-section st-section-cloud">
        <div class="container">
            <h2>Our Approach</h2>
            <div class="row">
                <div class="col-md-6 col-lg mb-4">
                    <div class="solution-step-card"><div class="step-label">Step 1</div><h4>Discover &amp; Assess</h4><p>We understand your current state, objectives, constraints, and the specific outcomes that matter to your stakeholders.</p></div>
                </div>
                <div class="col-md-6 col-lg mb-4">
                    <div class="solution-step-card"><div class="step-label">Step 2</div><h4>Design &amp; Architect</h4><p>We design a tailored solution blueprint that aligns technology, people, processes, and governance.</p></div>
                </div>
                <div class="col-md-6 col-lg mb-4">
                    <div class="solution-step-card"><div class="step-label">Step 3</div><h4>Implement &amp; Deploy</h4><p>We build and deploy with security, quality, and change management embedded from the start.</p></div>
                </div>
                <div class="col-md-6 col-lg mb-4">
                    <div class="solution-step-card"><div class="step-label">Step 4</div><h4>Optimize &amp; Sustain</h4><p>We measure outcomes, refine performance, and ensure the solution continues to deliver value.</p></div>
                </div>
            </div>
        </div>
    </section>

    <section class="st-section">
        <div class="container">
            <h2>What You Get</h2>
            <ul class="list-group list-group-flush">
                <li class="list-group-item">Dedicated practitioner team with domain and sector expertise</li>
                <li class="list-group-item">Clear project plan, governance structure, and communication cadence</li>
                <li class="list-group-item">Security-integrated design and risk assessment</li>
                <li class="list-group-item">Documented processes, knowledge transfer, and training</li>
                <li class="list-group-item">Ongoing support and optimization options</li>
            </ul>
        </div>
    </section>

    <section class="st-section st-section-cloud">
        <div class="container">
            <h2>Standards We Work With</h2>
            <div class="d-flex flex-wrap gap-2">
                <span class="st-badge st-badge-navy">NIST Cybersecurity Framework</span>
                <span class="st-badge st-badge-navy">ISO/IEC 27001</span>
                <span class="st-badge st-badge-navy">SOC 2</span>
                <span class="st-badge st-badge-navy">ITIL</span>
                <span class="st-badge st-badge-navy">AI Governance Frameworks</span>
            </div>
        </div>
    </section>

    <section class="st-section-navy final-cta">
        <div class="container">
            <h2>Ready to Explore {{PAGE_NAME}}?</h2>
            <div class="final-cta-actions">
                <a class="st-btn st-btn-primary" href="contact.php">Schedule a Consultation</a>
                <a class="st-btn st-btn-ghost-white" href="{{PILLAR_SLUG}}.php">View All {{PILLAR}}</a>
            </div>
        </div>
    </section>

<?php include __DIR__ . '/includes/footer.php'; ?>
HTML;

foreach ($solutions as $solution) {
    $pageName = formatName($solution['slug']);
    $output = str_replace(
        ['{{TITLE}}', '{{SHORT}}', '{{PILLAR}}', '{{PILLAR_SLUG}}', '{{PAGE_NAME}}', '{{BADGE_COLOR}}'],
        [$solution['title'], $solution['short'], $solution['pillar'], $solution['pillar_slug'], $pageName, $badgeColor[$solution['pillar']] ?? 'var(--blue-accent)'],
        $template
    );
    $file = $baseDir . '/' . $solution['slug'] . '.php';
    file_put_contents($file, $output);
    echo "Generated: {$solution['slug']}.php\n";
}

function formatName($slug) {
    return ucwords(str_replace(['-', '_'], ' ', $slug));
}

echo "Done. Generated " . count($solutions) . " solution pages.\n";
