<?php
// admin/index.php - Soul Guard Admin Dashboard
require_once dirname(__DIR__) . '/config.php';

// Check if user is logged in AND is admin
if (!isset($_SESSION['user_id']) || !isset($_SESSION['is_admin']) || $_SESSION['is_admin'] != 1) {
    // Clear session and redirect to login page
    session_destroy();
    header('Location: /login.php?error=Please+login+with+admin+credentials');
    exit;
}

$pdo = getDBConnection();
$userId = $_SESSION['user_id'];

// Get statistics
$totalUsers = $pdo->query("SELECT COUNT(*) FROM users")->fetchColumn();
$totalOrganizations = $pdo->query("SELECT COUNT(*) FROM organizations")->fetchColumn();
$totalAttacks = $pdo->query("SELECT COUNT(*) FROM attack_logs")->fetchColumn();
$totalScans = $pdo->query("SELECT COUNT(*) FROM scan_results")->fetchColumn();
$totalDPA = $pdo->query("SELECT COUNT(*) FROM dpa_assessments")->fetchColumn();
$totalServices = $pdo->query("SELECT COUNT(*) FROM service_requests")->fetchColumn();
$pendingServices = $pdo->query("SELECT COUNT(*) FROM service_requests WHERE status = 'pending'")->fetchColumn();

// Get recent activities
$recentUsers = $pdo->query("SELECT * FROM users ORDER BY created_at DESC LIMIT 5")->fetchAll();
$recentServices = $pdo->query("
    SELECT sr.*, u.username 
    FROM service_requests sr 
    LEFT JOIN users u ON sr.user_id = u.id 
    ORDER BY sr.created_at DESC LIMIT 5
")->fetchAll();
$recentAttacks = $pdo->query("SELECT * FROM attack_logs ORDER BY timestamp DESC LIMIT 5")->fetchAll();

// Get severity breakdown
$criticalAttacks = $pdo->query("SELECT COUNT(*) FROM attack_logs WHERE severity = 'Critical'")->fetchColumn();
$highAttacks = $pdo->query("SELECT COUNT(*) FROM attack_logs WHERE severity = 'High'")->fetchColumn();
$mediumAttacks = $pdo->query("SELECT COUNT(*) FROM attack_logs WHERE severity = 'Medium'")->fetchColumn();
$lowAttacks = $pdo->query("SELECT COUNT(*) FROM attack_logs WHERE severity = 'Low'")->fetchColumn();

// Get today's stats
$today = date('Y-m-d');
$todayAttacks = $pdo->query("SELECT COUNT(*) FROM attack_logs WHERE DATE(timestamp) = '$today'")->fetchColumn();
$todayUsers = $pdo->query("SELECT COUNT(*) FROM users WHERE DATE(created_at) = '$today'")->fetchColumn();
$todayServices = $pdo->query("SELECT COUNT(*) FROM service_requests WHERE DATE(created_at) = '$today'")->fetchColumn();

$theme = getTheme();
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Admin Dashboard - Soul Guard</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        :root {
            --bg-primary: #0a0a0f;
            --bg-secondary: #13131a;
            --bg-card: rgba(255, 255, 255, 0.03);
            --border-color: rgba(255, 255, 255, 0.06);
            --text-primary: #e4e4e7;
            --text-secondary: #a1a1aa;
            --accent-blue: #3b82f6;
            --accent-red: #ef4444;
            --accent-green: #22c55e;
            --accent-yellow: #eab308;
            --accent-purple: #a855f7;
            --accent-cyan: #06b6d4;
            --accent-orange: #f97316;
            --accent-teal: #14b8a6;
            --accent-pink: #ec4899;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: var(--bg-primary);
            color: var(--text-primary);
            min-height: 100vh;
            background-image: radial-gradient(ellipse at top, rgba(59, 130, 246, 0.08), transparent 50%),
                              radial-gradient(ellipse at bottom right, rgba(168, 85, 247, 0.05), transparent 50%);
        }

        .navbar {
            background: var(--bg-secondary);
            border-bottom: 1px solid var(--border-color);
            padding: 0 30px;
            height: 65px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            position: sticky;
            top: 0;
            z-index: 100;
            backdrop-filter: blur(20px);
        }

        .logo {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .logo-icon {
            width: 40px;
            height: 40px;
            background: linear-gradient(135deg, #3b82f6, #a855f7);
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
        }

        .logo-text h1 {
            font-size: 18px;
            font-weight: 700;
            background: linear-gradient(135deg, #3b82f6, #a855f7);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .logo-text small {
            font-size: 10px;
            color: var(--text-secondary);
        }

        .nav-links {
            display: flex;
            align-items: center;
            gap: 5px;
            flex-wrap: wrap;
        }

        .nav-links a {
            color: var(--text-secondary);
            text-decoration: none;
            padding: 8px 14px;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 500;
            transition: all 0.2s;
        }

        .nav-links a:hover {
            background: rgba(255, 255, 255, 0.05);
            color: var(--text-primary);
        }

        .nav-links a.active {
            background: rgba(59, 130, 246, 0.15);
            color: var(--accent-blue);
        }

        .user-badge {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 6px 12px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 20px;
            font-size: 12px;
            margin-left: 10px;
        }

        .user-avatar {
            width: 28px;
            height: 28px;
            background: linear-gradient(135deg, #3b82f6, #a855f7);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            font-weight: 700;
            color: white;
        }

        .logout-btn {
            background: rgba(239, 68, 68, 0.1) !important;
            color: var(--accent-red) !important;
            border: 1px solid rgba(239, 68, 68, 0.2);
        }

        .logout-btn:hover {
            background: rgba(239, 68, 68, 0.2) !important;
        }

        .container {
            max-width: 1400px;
            margin: 0 auto;
            padding: 30px;
        }

        .welcome-section {
            margin-bottom: 30px;
        }

        .welcome-section h2 {
            font-size: 28px;
            font-weight: 700;
            margin-bottom: 5px;
        }

        .welcome-section .subtitle {
            color: var(--text-secondary);
            font-size: 14px;
        }

        .admin-badge {
            display: inline-block;
            background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(168, 85, 247, 0.2));
            border: 1px solid rgba(59, 130, 246, 0.3);
            border-radius: 20px;
            padding: 4px 12px;
            font-size: 11px;
            margin-top: 10px;
            color: var(--accent-blue);
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 15px;
            margin-bottom: 30px;
        }

        .stat-card {
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 16px;
            padding: 20px;
            transition: all 0.3s;
            position: relative;
            overflow: hidden;
            cursor: pointer;
        }

        .stat-card:hover {
            transform: translateY(-3px);
            border-color: rgba(255, 255, 255, 0.15);
        }

        .stat-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
        }

        .stat-card.blue::before { background: var(--accent-blue); }
        .stat-card.red::before { background: var(--accent-red); }
        .stat-card.green::before { background: var(--accent-green); }
        .stat-card.purple::before { background: var(--accent-purple); }
        .stat-card.cyan::before { background: var(--accent-cyan); }
        .stat-card.orange::before { background: var(--accent-orange); }
        .stat-card.teal::before { background: var(--accent-teal); }
        .stat-card.yellow::before { background: var(--accent-yellow); }

        .stat-icon {
            font-size: 28px;
            margin-bottom: 12px;
        }

        .stat-number {
            font-size: 32px;
            font-weight: 800;
            margin-bottom: 4px;
        }

        .stat-label {
            font-size: 11px;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .stat-change {
            font-size: 11px;
            margin-top: 8px;
        }

        .stat-change.up { color: var(--accent-green); }
        .stat-change.down { color: var(--accent-red); }

        .main-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 20px;
            margin-bottom: 30px;
        }

        @media (max-width: 1024px) {
            .main-grid {
                grid-template-columns: 1fr;
            }
        }

        .card {
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 16px;
            overflow: hidden;
        }

        .card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 18px 20px;
            border-bottom: 1px solid var(--border-color);
            background: rgba(255, 255, 255, 0.02);
        }

        .card-header h3 {
            font-size: 16px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .card-header .badge {
            font-size: 11px;
            padding: 4px 10px;
            border-radius: 20px;
            background: rgba(59, 130, 246, 0.15);
            color: var(--accent-blue);
        }

        .card-body {
            padding: 20px;
        }

        .activity-item {
            padding: 12px;
            border-radius: 8px;
            margin-bottom: 8px;
            background: rgba(255, 255, 255, 0.02);
            border-left: 3px solid var(--border-color);
            transition: all 0.2s;
        }

        .activity-item:hover {
            background: rgba(255, 255, 255, 0.04);
        }

        .activity-title {
            font-size: 13px;
            font-weight: 600;
            margin-bottom: 4px;
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }

        .activity-meta {
            font-size: 11px;
            color: var(--text-secondary);
            display: flex;
            gap: 15px;
            flex-wrap: wrap;
        }

        .service-item {
            padding: 12px;
            border-radius: 8px;
            margin-bottom: 8px;
            background: rgba(139, 92, 246, 0.05);
            border-left: 3px solid var(--accent-purple);
        }

        .service-title {
            font-size: 13px;
            font-weight: 600;
            margin-bottom: 4px;
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }

        .service-meta {
            font-size: 10px;
            color: var(--text-secondary);
            display: flex;
            gap: 12px;
            flex-wrap: wrap;
        }

        .user-item {
            padding: 12px;
            border-radius: 8px;
            margin-bottom: 8px;
            background: rgba(59, 130, 246, 0.05);
            border-left: 3px solid var(--accent-blue);
        }

        .severity {
            font-size: 10px;
            padding: 2px 8px;
            border-radius: 10px;
            font-weight: 600;
            text-transform: uppercase;
        }

        .severity-critical { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
        .severity-high { background: rgba(234, 179, 8, 0.2); color: #fde047; }
        .severity-medium { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
        .severity-low { background: rgba(34, 197, 94, 0.2); color: #86efac; }

        .status-badge {
            display: inline-block;
            padding: 2px 8px;
            border-radius: 10px;
            font-size: 9px;
            font-weight: 600;
        }

        .status-pending { background: rgba(245, 158, 11, 0.2); color: #fde047; }
        .status-processing { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
        .status-completed { background: rgba(34, 197, 94, 0.2); color: #86efac; }
        .status-cancelled { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }

        .btn {
            display: inline-block;
            padding: 10px 20px;
            background: linear-gradient(135deg, #06b6d4, #14b8a6);
            color: white;
            text-decoration: none;
            border-radius: 8px;
            transition: all 0.3s;
            font-size: 13px;
            font-weight: 600;
            border: none;
            cursor: pointer;
        }

        .btn-outline {
            background: transparent;
            border: 1px solid var(--accent-cyan);
            color: var(--accent-cyan);
        }

        .btn-outline:hover {
            background: rgba(6, 182, 212, 0.1);
        }

        .btn-sm {
            padding: 6px 12px;
            font-size: 11px;
        }

        .quick-actions {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
            gap: 12px;
            margin-bottom: 30px;
        }

        .action-card {
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 16px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s;
            text-decoration: none;
            color: var(--text-primary);
        }

        .action-card:hover {
            transform: translateY(-3px);
            border-color: var(--accent-cyan);
            background: rgba(6, 182, 212, 0.05);
        }

        .action-icon {
            font-size: 28px;
            display: block;
            margin-bottom: 8px;
        }

        .action-label {
            font-size: 12px;
            font-weight: 500;
        }

        .empty-state {
            text-align: center;
            padding: 40px;
            color: var(--text-secondary);
        }

        .footer {
            text-align: center;
            padding: 20px;
            border-top: 1px solid var(--border-color);
            margin-top: 30px;
            color: var(--text-secondary);
            font-size: 12px;
        }

        @media (max-width: 768px) {
            .container {
                padding: 15px;
            }
            .navbar {
                padding: 0 15px;
            }
            .nav-links a {
                padding: 6px 10px;
                font-size: 11px;
            }
            .stats-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 10px;
            }
            .stat-number {
                font-size: 24px;
            }
            .quick-actions {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        @media (max-width: 480px) {
            .stats-grid {
                grid-template-columns: 1fr;
            }
        }
    </style>
</head>
<body>
    <nav class="navbar">
        <div class="logo">
            <div class="logo-icon">🛡️</div>
            <div class="logo-text">
                <h1>Soul Guard Admin</h1>
                <small>v<?php echo APP_VERSION; ?> | AI Security Platform</small>
            </div>
        </div>
        <div class="nav-links">
            <a href="index.php" class="active">📊 Dashboard</a>
            <a href="users.php">👥 Users</a>
            <a href="services.php">📋 Services</a>
            <a href="reports.php">📄 Reports</a>
            <span class="user-badge">
                <div class="user-avatar"><?php echo strtoupper(substr($_SESSION['username'], 0, 1)); ?></div>
                <?php echo htmlspecialchars($_SESSION['username']); ?>
            </span>
            <a href="/logout.php" class="logout-btn">🚪 Logout</a>
        </div>
    </nav>

    <div class="container">
        <div class="welcome-section">
            <h2>👋 Welcome back, Admin <?php echo htmlspecialchars($_SESSION['username']); ?></h2>
            <p class="subtitle">Soul Guard Security Platform - Administrative Control Panel</p>
            <div class="admin-badge">🔐 Full System Access | AI-Powered Security Management</div>
        </div>

        <div class="quick-actions">
            <a href="users.php" class="action-card">
                <span class="action-icon">👥</span>
                <span class="action-label">Manage Users</span>
            </a>
            <a href="services.php" class="action-card">
                <span class="action-icon">📋</span>
                <span class="action-label">Service Requests</span>
                <?php if($pendingServices > 0): ?>
                <span class="badge" style="background:var(--accent-red);color:white;margin-top:5px;display:inline-block"><?php echo $pendingServices; ?> pending</span>
                <?php endif; ?>
            </a>
            <a href="../dpa.php" class="action-card">
                <span class="action-icon">📋</span>
                <span class="action-label">DPA Assessments</span>
            </a>
            <a href="../reports.php" class="action-card">
                <span class="action-icon">📊</span>
                <span class="action-label">View Reports</span>
            </a>
            <a href="../attack.php" class="action-card">
                <span class="action-icon">⚔️</span>
                <span class="action-label">Attack Module</span>
            </a>
            <a href="../defense.php" class="action-card">
                <span class="action-icon">🛡️</span>
                <span class="action-label">Defense Module</span>
            </a>
        </div>

        <div class="stats-grid">
            <div class="stat-card blue">
                <div class="stat-icon">👥</div>
                <div class="stat-number"><?php echo number_format($totalUsers); ?></div>
                <div class="stat-label">Total Users</div>
                <div class="stat-change up">+<?php echo $todayUsers; ?> today</div>
            </div>
            <div class="stat-card green">
                <div class="stat-icon">🏢</div>
                <div class="stat-number"><?php echo number_format($totalOrganizations); ?></div>
                <div class="stat-label">Organizations</div>
            </div>
            <div class="stat-card red">
                <div class="stat-icon">⚔️</div>
                <div class="stat-number"><?php echo number_format($totalAttacks); ?></div>
                <div class="stat-label">Total Attacks</div>
                <div class="stat-change up">+<?php echo $todayAttacks; ?> today</div>
            </div>
            <div class="stat-card purple">
                <div class="stat-icon">🔍</div>
                <div class="stat-number"><?php echo number_format($totalScans); ?></div>
                <div class="stat-label">Security Scans</div>
            </div>
            <div class="stat-card cyan">
                <div class="stat-icon">📋</div>
                <div class="stat-number"><?php echo number_format($totalDPA); ?></div>
                <div class="stat-label">DPA Assessments</div>
            </div>
            <div class="stat-card orange">
                <div class="stat-icon">🛎️</div>
                <div class="stat-number"><?php echo number_format($totalServices); ?></div>
                <div class="stat-label">Service Requests</div>
                <?php if($pendingServices > 0): ?>
                <div class="stat-change up"><?php echo $pendingServices; ?> pending</div>
                <?php endif; ?>
            </div>
        </div>

        <div class="card" style="margin-bottom: 20px;">
            <div class="card-header">
                <h3>📊 Attack Severity Breakdown</h3>
                <span class="badge">Threat Analysis</span>
            </div>
            <div class="card-body">
                <div style="display: flex; gap: 20px; flex-wrap: wrap;">
                    <div style="flex: 1; text-align: center; padding: 15px; background: rgba(239,68,68,0.1); border-radius: 12px;">
                        <div style="font-size: 28px; font-weight: 800; color: #fca5a5;"><?php echo $criticalAttacks; ?></div>
                        <div style="font-size: 11px; color: var(--text-secondary);">Critical</div>
                    </div>
                    <div style="flex: 1; text-align: center; padding: 15px; background: rgba(234,179,8,0.1); border-radius: 12px;">
                        <div style="font-size: 28px; font-weight: 800; color: #fde047;"><?php echo $highAttacks; ?></div>
                        <div style="font-size: 11px; color: var(--text-secondary);">High</div>
                    </div>
                    <div style="flex: 1; text-align: center; padding: 15px; background: rgba(59,130,246,0.1); border-radius: 12px;">
                        <div style="font-size: 28px; font-weight: 800; color: #93c5fd;"><?php echo $mediumAttacks; ?></div>
                        <div style="font-size: 11px; color: var(--text-secondary);">Medium</div>
                    </div>
                    <div style="flex: 1; text-align: center; padding: 15px; background: rgba(34,197,94,0.1); border-radius: 12px;">
                        <div style="font-size: 28px; font-weight: 800; color: #86efac;"><?php echo $lowAttacks; ?></div>
                        <div style="font-size: 11px; color: var(--text-secondary);">Low</div>
                    </div>
                </div>
            </div>
        </div>

        <div class="main-grid">
            <div class="card">
                <div class="card-header">
                    <h3>👥 Recent User Registrations</h3>
                    <a href="users.php" class="badge" style="text-decoration: none;">View All →</a>
                </div>
                <div class="card-body">
                    <?php if(empty($recentUsers)): ?>
                        <div class="empty-state">No users registered yet</div>
                    <?php else: ?>
                        <?php foreach($recentUsers as $user): ?>
                        <div class="user-item">
                            <div class="activity-title">
                                <?php echo htmlspecialchars($user['username']); ?>
                                <?php if($user['is_admin']): ?>
                                <span class="severity severity-critical">Admin</span>
                                <?php endif; ?>
                                <?php if(!$user['is_active']): ?>
                                <span class="status-badge status-pending">Inactive</span>
                                <?php endif; ?>
                            </div>
                            <div class="activity-meta">
                                <span>📧 <?php echo htmlspecialchars($user['email']); ?></span>
                                <span>📅 <?php echo date('M d, Y', strtotime($user['created_at'])); ?></span>
                            </div>
                        </div>
                        <?php endforeach; ?>
                    <?php endif; ?>
                </div>
            </div>

            <div class="card">
                <div class="card-header">
                    <h3>🛎️ Recent Service Requests</h3>
                    <a href="services.php" class="badge" style="text-decoration: none;">View All →</a>
                </div>
                <div class="card-body">
                    <?php if(empty($recentServices)): ?>
                        <div class="empty-state">No service requests yet</div>
                    <?php else: ?>
                        <?php foreach($recentServices as $service): ?>
                        <div class="service-item">
                            <div class="service-title">
                                <?php echo htmlspecialchars($service['service_type']); ?>
                                <span class="status-badge status-<?php echo $service['status']; ?>"><?php echo ucfirst($service['status']); ?></span>
                            </div>
                            <div class="service-meta">
                                <span>👤 <?php echo htmlspecialchars($service['username'] ?? 'Unknown'); ?></span>
                                <span>🏢 <?php echo htmlspecialchars($service['company_name']); ?></span>
                                <span>📅 <?php echo date('M d', strtotime($service['created_at'])); ?></span>
                            </div>
                        </div>
                        <?php endforeach; ?>
                    <?php endif; ?>
                </div>
            </div>

            <div class="card">
                <div class="card-header">
                    <h3>⚔️ Recent Attack Activities</h3>
                    <span class="badge">Last 5</span>
                </div>
                <div class="card-body">
                    <?php if(empty($recentAttacks)): ?>
                        <div class="empty-state">No attacks recorded yet</div>
                    <?php else: ?>
                        <?php foreach($recentAttacks as $attack): ?>
                        <div class="activity-item" style="border-left-color: <?php 
                            echo $attack['severity'] == 'Critical' ? 'var(--accent-red)' : 
                                ($attack['severity'] == 'High' ? 'var(--accent-yellow)' : 
                                ($attack['severity'] == 'Medium' ? 'var(--accent-blue)' : 'var(--accent-green)')); 
                        ?>">
                            <div class="activity-title">
                                <?php echo htmlspecialchars($attack['attack_type']); ?>
                                <span class="severity severity-<?php echo strtolower($attack['severity']); ?>"><?php echo $attack['severity']; ?></span>
                            </div>
                            <div class="activity-meta">
                                <span>🎯 <?php echo htmlspecialchars(substr($attack['target_url'], 0, 40)); ?></span>
                                <span>🕐 <?php echo date('M d, H:i', strtotime($attack['timestamp'])); ?></span>
                                <span>🌐 <?php echo htmlspecialchars($attack['attacker_ip']); ?></span>
                            </div>
                        </div>
                        <?php endforeach; ?>
                    <?php endif; ?>
                </div>
            </div>

            <div class="card">
                <div class="card-header">
                    <h3>ℹ️ System Information</h3>
                    <span class="badge">Status</span>
                </div>
                <div class="card-body">
                    <div style="margin-bottom: 15px; padding: 12px; background: rgba(6,182,212,0.1); border-radius: 8px;">
                        <div style="display: flex; justify-content: space-between; margin-bottom: 8px;">
                            <span>🤖 AI Provider:</span>
                            <span style="color: #06b6d4; font-weight: 600;">Gemini AI</span>
                        </div>
                        <div style="display: flex; justify-content: space-between; margin-bottom: 8px;">
                            <span>🛡️ VirusTotal:</span>
                            <span style="color: #22c55e; font-weight: 600;">Connected</span>
                        </div>
                        <div style="display: flex; justify-content: space-between; margin-bottom: 8px;">
                            <span>🔍 WPScan:</span>
                            <span style="color: #22c55e; font-weight: 600;">Connected</span>
                        </div>
                        <div style="display: flex; justify-content: space-between;">
                            <span>📦 Database:</span>
                            <span style="color: #a1a1aa;">MySQL Database</span>
                        </div>
                    </div>
                    <div style="display: flex; gap: 10px; flex-wrap: wrap;">
                        <a href="../cupp.php" class="btn btn-sm">🔑 Launch CUPP</a>
                        <a href="../dpa.php" class="btn btn-sm">📋 DPA Assessment</a>
                        <a href="../reports.php" class="btn btn-sm btn-outline">📊 View Reports</a>
                    </div>
                </div>
            </div>
        </div>

        <div class="footer">
            <p>&copy; <?php echo date('Y'); ?> <?php echo COPYRIGHT; ?> | Soul Guard v<?php echo APP_VERSION; ?> | AI-Powered Security Platform</p>
            <p style="margin-top: 5px; font-size: 10px;">Gemini AI + VirusTotal + WPScan + CUPP + DPA Compliance</p>
        </div>
    </div>
</body>
</html>