<?php


$pageTitle = 'Installation Complete';
$pageDesc = '';

ob_start();
?>

<?php if (!empty($error)): ?>
<div class="alert alert-danger"><?= htmlspecialchars($error) ?></div>
<?php else: ?>
<div class="complete-message">
    <div class="complete-icon">&#10003;</div>
    <h3>Congratulations!</h3>
    <p>
        TubePress has been installed successfully.
        Your site is now ready to use.
    </p>
</div>

<?php
$siteName = Setting::get('site_name', 'My Video Site');
$siteUrl = Setting::get('site_url', '');
?>
<div style="background:#f9fafb; border:1px solid #e5e7eb; border-radius:8px; padding:16px; margin-bottom:20px; font-size:14px;">
    <div style="font-weight:600; margin-bottom:8px; color:#111827;">Your setup summary:</div>
    <div style="display:grid; grid-template-columns:auto 1fr; gap:6px 16px; color:#4b5563;">
        <span style="font-weight:500;">Site name:</span> <span><?= htmlspecialchars($siteName) ?></span>
        <?php if ($siteUrl !== ''): ?>
        <span style="font-weight:500;">URL:</span> <span><?= htmlspecialchars($siteUrl) ?></span>
        <?php endif; ?>
        <span style="font-weight:500;">Version:</span> <span><?= APP_VERSION ?></span>
    </div>
</div>

<div class="alert alert-success">
    <strong>Security tip:</strong> The installer is automatically disabled now that installation is complete.
    For extra security, you can also delete the <code>src/Install/</code> folder from your server.
</div>

<div style="background:#fffbeb; border:1px solid #fde68a; border-radius:8px; padding:14px 16px; margin-bottom:20px; font-size:13.5px; color:#92400e; line-height:1.6;">
    <strong>Two quick things before going live:</strong>
    <ul style="margin:8px 0 0; padding-left:18px;">
        <li>Set up email under <strong>Admin &rarr; Settings &rarr; Email</strong> so password resets and notifications are actually delivered &mdash; PHP's built-in mail often doesn't work on shared hosting.</li>
        <li>Make sure <code>config/</code>, <code>storage/</code> and <code>src/</code> aren't publicly reachable &mdash; the bundled web-server rules already block them.</li>
    </ul>
</div>

<div class="complete-links">
    <a href="/" class="btn btn-primary btn-lg">View Site</a>
    <a href="/admin" class="btn btn-success btn-lg">Admin Panel</a>
</div>
<?php endif; ?>

<?php
$content = ob_get_clean();
require APP_ROOT . '/templates/install/layout.php';
