<?php
session_start();
$basePath = dirname(__DIR__);
if (file_exists($basePath . '/config.php') || file_exists($basePath . '/install/install.lock')) { die('Installer is locked. To reinstall safely, back up the database, remove config.php and install/install.lock manually, then reload this page.'); }
$step = 1;
$stepNames = ['Welcome', 'Requirements', 'Permissions', 'Database', 'Import', 'Academy', 'Banking', 'Admin'];
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CIX Orbit Academy - Installer</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">
    <link rel="stylesheet" href="assets/css/install.css">
</head>
<body>
<div class="installer-wrapper">
    <div class="installer-card">
        <div class="installer-header">
            <h1><i class="fas fa-orbit"></i> CIX <span>Orbit</span> Academy</h1>
            <p>Complete LMS &amp; Student Management System</p>
            <div class="version"><i class="fas fa-code-branch"></i> v1.0.0</div>
        </div>
        <div class="step-indicator">
            <?php for ($i = 1; $i <= 8; $i++): ?>
            <div class="step-dot <?= $i === $step ? 'active' : ($i < $step ? 'completed' : '') ?>">
                <?= $i < $step ? '<i class="fas fa-check"></i>' : $i ?>
                <span class="step-label"><?= $stepNames[$i-1] ?></span>
            </div>
            <?php endfor; ?>
        </div>
        <div class="installer-content">
            <div class="welcome-text">
                <div class="welcome-icon"><i class="fas fa-rocket"></i></div>
                <h2>Welcome to CIX Orbit Academy</h2>
                <p>Learn. Build. Automate. Grow. - AI Skills for the New Economy</p>
                <p style="margin-top:15px;">This wizard will guide you through installing CIX Orbit Academy, a complete LMS with CBT assessment, certificate generation, payment management, and more.</p>
            </div>
            <div class="features-list">
                <div class="feature-item"><i class="fas fa-check-circle"></i> Full Admin Backend</div>
                <div class="feature-item"><i class="fas fa-check-circle"></i> Student Portal</div>
                <div class="feature-item"><i class="fas fa-check-circle"></i> Teacher Portal</div>
                <div class="feature-item"><i class="fas fa-check-circle"></i> CBT Assessment System</div>
                <div class="feature-item"><i class="fas fa-check-circle"></i> Certificate Generator</div>
                <div class="feature-item"><i class="fas fa-check-circle"></i> Payment Management</div>
                <div class="feature-item"><i class="fas fa-check-circle"></i> PDF Reports</div>
                <div class="feature-item"><i class="fas fa-check-circle"></i> 22+ Themes</div>
                <div class="feature-item"><i class="fas fa-check-circle"></i> PWA Support</div>
                <div class="feature-item"><i class="fas fa-check-circle"></i> AI Integration</div>
            </div>
            <div class="alert alert-info">
                <i class="fas fa-info-circle"></i>
                <div><strong>Before you begin:</strong> Ensure PHP 8.1+, MySQL/MariaDB, and a web server are ready.</div>
            </div>
            <div class="btn-group" style="justify-content:center;">
                <a href="step2.php" class="btn btn-primary"><i class="fas fa-play"></i> Accept &amp; Continue</a>
            </div>
        </div>
    </div>
</div>
<script src="assets/js/install.js"></script>
</body>
</html>
