<?php
/**
 * Services Category Page Template
 * 
 * This template displays service categories with their descriptions and subsections
 */

// Sample data structure - replace with your database queries
$services = [
    [
        'id' => 'business-valuation',
        'name' => 'Business Valuation Services',
        'url' => 'business-valuation.php',
        'active' => false
    ],
    [
        'id' => 'mergers-acquisitions',
        'name' => 'Mergers and Acquisitions',
        'url' => 'mergers-acquisitions.php',
        'active' => false
    ],
    [
        'id' => 'audit-assurance',
        'name' => 'Audit and Assurance Services',
        'url' => 'audit-assurance.php',
        'active' => false
    ],
    [
        'id' => 'public-private-partnerships',
        'name' => 'Public Private Partnerships',
        'url' => 'public-private-partnerships.php',
        'active' => true // Current page
    ],
    [
        'id' => 'business-recovery',
        'name' => 'Business Recovery Analysis',
        'url' => 'business-recovery.php',
        'active' => false
    ],
    [
        'id' => 'financial-advisory',
        'name' => 'Financial Advisory',
        'url' => 'financial-advisory.php',
        'active' => false
    ],
    [
        'id' => 'consequential-loss',
        'name' => 'Consequential Loss Assessment',
        'url' => 'consequential-loss.php',
        'active' => false
    ],
    [
        'id' => 'taxation',
        'name' => 'Taxation Services',
        'url' => 'taxation.php',
        'active' => false
    ]
];

// Page content - this would come from your database or CMS
$pageContent = [
    'title' => 'Public Private Partnerships',
    'sections' => [
        [
            'id' => 'feasibility-study',
            'title' => 'A. Feasibility Study',
            'description' => 'Samuel Richards & Associates® helps you produce a comprehensive feasibility study for the Project using a Public Sector Comparator (PSC) and Public Private Partnership (PPP) reference models. This enables the client to determine the full project cycle costs, affordability limits, risks, and their costs and optimal value-for-money methods of delivery.',
            'subtitle' => 'The feasibility study will include the following:',
            'items' => [
                [
                    'left' => [
                        'Introduction',
                        'Section 1 – Needs analysis',
                        'Section 2 – Solution options analysis',
                        'Section 3 – Project due diligence'
                    ],
                    'right' => [
                        'Section 4 – Value assessment',
                        'Section 5 – Economic valuation',
                        'Section 6 – Procurement plan'
                    ]
                ]
            ]
        ],
        [
            'id' => 'ppp-procurement',
            'title' => 'B. PPP Procurement',
            'description' => 'If on the basis of the feasibility study, a PPP solution is decided upon, Samuel Richards & Associates® will provide the necessary technical, legal, and financial advisory support for the procurement of a private partner.',
            'items' => []
        ]
    ]
];
?>


</head>
<body>
    <div class="container">
        <!-- Sidebar Navigation -->
        <aside class="sidebar">
            <?php foreach ($services as $service): ?>
                <a href="<?php echo htmlspecialchars($service['url']); ?>" 
                   class="sidebar-item <?php echo $service['active'] ? 'active' : ''; ?>">
                    <div class="sidebar-icon"></div>
                    <div class="sidebar-text"><?php echo htmlspecialchars($service['name']); ?></div>
                </a>
            <?php endforeach; ?>
        </aside>

        <!-- Main Content -->
        <main class="content">
            <h1 class="page-title"><?php echo htmlspecialchars($pageContent['title']); ?></h1>

            <?php foreach ($pageContent['sections'] as $section): ?>
                <section class="section" id="<?php echo htmlspecialchars($section['id']); ?>">
                    <h2 class="section-title"><?php echo htmlspecialchars($section['title']); ?></h2>
                    
                    <p class="section-description"><?php echo htmlspecialchars($section['description']); ?></p>
                    
                    <?php if (!empty($section['subtitle'])): ?>
                        <p class="section-subtitle"><?php echo htmlspecialchars($section['subtitle']); ?></p>
                    <?php endif; ?>

                    <?php if (!empty($section['items'])): ?>
                        <?php foreach ($section['items'] as $itemGroup): ?>
                            <div class="items-grid">
                                <?php if (!empty($itemGroup['left'])): ?>
                                    <div class="items-column">
                                        <?php foreach ($itemGroup['left'] as $item): ?>
                                            <div class="item">
                                                <span class="checkmark">✓</span>
                                                <span class="item-text"><?php echo htmlspecialchars($item); ?></span>
                                            </div>
                                        <?php endforeach; ?>
                                    </div>
                                <?php endif; ?>

                                <?php if (!empty($itemGroup['right'])): ?>
                                    <div class="items-column">
                                        <?php foreach ($itemGroup['right'] as $item): ?>
                                            <div class="item">
                                                <span class="checkmark">✓</span>
                                                <span class="item-text"><?php echo htmlspecialchars($item); ?></span>
                                            </div>
                                        <?php endforeach; ?>
                                    </div>
                                <?php endif; ?>
                            </div>
                        <?php endforeach; ?>
                    <?php endif; ?>
                </section>
            <?php endforeach; ?>
        </main>
    </div>
</body>
</html>