<?php
$pageTitle = 'Dashboard';
ob_start();
?>

<div class="admin-card">
    <h2 class="text-xl font-semibold mb-4">Welcome to the Admin Panel</h2>
    <p class="text-gray-300 mb-4">Use the sidebar to navigate to different sections of the admin panel.</p>
    
    <div class="flex flex-wrap gap-4 mt-6">
        <a href="/admin/settings" class="admin-button">
            <i class="fas fa-cog"></i> Site Settings
        </a>
        <a href="/" target="_blank" class="admin-button secondary">
            <i class="fas fa-external-link-alt"></i> View Site
        </a>
    </div>
</div>

<div class="admin-card">
    <h2 class="text-xl font-semibold mb-4">Site Settings Overview</h2>
    <div class="dashboard-grid">
        <div class="bg-dark p-4 rounded-md border border-gray-800">
            <h3 class="text-lg font-medium mb-2 text-primary">Site Title</h3>
            <p class="text-gray-300"><?= htmlspecialchars($settings['site_title'] ?? 'Not set') ?></p>
        </div>
        <div class="bg-dark p-4 rounded-md border border-gray-800">
            <h3 class="text-lg font-medium mb-2 text-primary">Site Description</h3>
            <p class="text-gray-300"><?= htmlspecialchars($settings['site_description'] ?? 'Not set') ?></p>
        </div>
        <div class="bg-dark p-4 rounded-md border border-gray-800">
            <h3 class="text-lg font-medium mb-2 text-primary">Favicon</h3>
            <?php if (isset($settings['favicon_path']) && !empty($settings['favicon_path'])): ?>
                <img src="<?= htmlspecialchars($settings['favicon_path']) ?>" alt="Favicon" class="preview-image">
            <?php else: ?>
                <p class="text-gray-300">No favicon set</p>
            <?php endif; ?>
        </div>
        <div class="bg-dark p-4 rounded-md border border-gray-800">
            <h3 class="text-lg font-medium mb-2 text-primary">Logo</h3>
            <?php if (isset($settings['logo_path']) && !empty($settings['logo_path'])): ?>
                <img src="<?= htmlspecialchars($settings['logo_path']) ?>" alt="Logo" class="preview-image">
            <?php else: ?>
                <p class="text-gray-300">No logo set</p>
            <?php endif; ?>
        </div>
    </div>
    <div class="mt-6">
        <a href="/admin/settings" class="admin-button">
            <i class="fas fa-cog"></i> Edit Settings
        </a>
    </div>
</div>

<?php
$content = ob_get_clean();
include __DIR__ . '/layout.php';
?> 