<?php
$page_title = 'Developer Platform';
require_once __DIR__ . '/../config.php';
if (session_status() === PHP_SESSION_NONE) { session_start(); }
if (!isset($_SESSION['admin_id'])) { redirect(SITE_URL . '/admin/login.php'); }
require_once __DIR__ . '/header.php';
?>
<div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:24px;">
    <div>
        <h2 style="font-family:'Outfit',sans-serif; font-size:1.8rem; color:#0f172a; margin:0;"><i class="fas fa-terminal" style="color:#10b981; margin-right:10px;"></i>Developer Platform</h2>
        <p style="color:#64748b; font-size:0.95rem; margin-top:5px;">Internal SDK, sandbox, plugin marketplace, API docs, and versioned integrations.</p>
    </div>
</div>
<div class="grid-4" style="margin-bottom:24px;">
    <div style="background:#fff; padding:20px; border-radius:12px; border:1px solid #e2e8f0; border-top:4px solid #10b981;">
        <div style="color:#64748b; font-size:0.8rem; font-weight:600; margin-bottom:8px;">SDK DOWNLOADS</div>
        <div style="font-size:1.6rem; font-weight:700; color:#0f172a;">2,480</div>
        <div style="color:#10b981; font-size:0.8rem; margin-top:5px;"><i class="fas fa-download"></i> v3.2 Latest</div>
    </div>
    <div style="background:#fff; padding:20px; border-radius:12px; border:1px solid #e2e8f0; border-top:4px solid #3b82f6;">
        <div style="color:#64748b; font-size:0.8rem; font-weight:600; margin-bottom:8px;">PLUGINS</div>
        <div style="font-size:1.6rem; font-weight:700; color:#0f172a;">42</div>
        <div style="color:#3b82f6; font-size:0.8rem; margin-top:5px;"><i class="fas fa-puzzle-piece"></i> Marketplace</div>
    </div>
    <div style="background:#fff; padding:20px; border-radius:12px; border:1px solid #e2e8f0; border-top:4px solid #f59e0b;">
        <div style="color:#64748b; font-size:0.8rem; font-weight:600; margin-bottom:8px;">SANDBOX ENVS</div>
        <div style="font-size:1.6rem; font-weight:700; color:#0f172a;">8</div>
        <div style="color:#f59e0b; font-size:0.8rem; margin-top:5px;"><i class="fas fa-flask"></i> Active Testing</div>
    </div>
    <div style="background:#fff; padding:20px; border-radius:12px; border:1px solid #e2e8f0; border-top:4px solid #8b5cf6;">
        <div style="color:#64748b; font-size:0.8rem; font-weight:600; margin-bottom:8px;">API VERSIONS</div>
        <div style="font-size:1.6rem; font-weight:700; color:#0f172a;">v3.2</div>
        <div style="color:#8b5cf6; font-size:0.8rem; margin-top:5px;"><i class="fas fa-code-branch"></i> Backward Compatible</div>
    </div>
</div>
<div class="grid-2">
    <div style="background:#fff; padding:20px; border-radius:12px; border:1px solid #e2e8f0;">
        <h3 style="margin:0 0 15px; font-size:1.15rem; color:#0f172a;"><i class="fas fa-puzzle-piece" style="color:#3b82f6; margin-right:8px;"></i>Plugin Marketplace</h3>
        <?php
        $plugins = [
            ['WhatsApp Commerce', '1,240 installs', '#25d366', 'fas fa-comment'],
            ['Tally Sync Pro', '860 installs', '#3b82f6', 'fas fa-sync'],
            ['GST Auto-Filer', '720 installs', '#f59e0b', 'fas fa-file-invoice'],
            ['Smart Logistics', '480 installs', '#0ea5e9', 'fas fa-truck'],
            ['AI Price Optimizer', '360 installs', '#8b5cf6', 'fas fa-tags'],
        ];
        foreach ($plugins as $p): ?>
        <div style="border:1px solid #e2e8f0; border-radius:8px; padding:12px 15px; margin-bottom:8px; display:flex; justify-content:space-between; align-items:center;">
            <div style="display:flex; align-items:center; gap:12px;">
                <i class="<?= $p[3] ?>" style="color:<?= $p[2] ?>;"></i>
                <span style="font-weight:600; font-size:0.9rem;"><?= $p[0] ?></span>
            </div>
            <span style="color:#64748b; font-size:0.8rem;"><?= $p[1] ?></span>
        </div>
        <?php endforeach; ?>
    </div>
    <div style="background:linear-gradient(135deg,#0f172a,#1e293b); color:#fff; padding:25px; border-radius:12px;">
        <h3 style="margin:0 0 15px; font-size:1.1rem; color:#10b981;"><i class="fas fa-book"></i> API Documentation Portal</h3>
        <div style="background:#0d1117; border:1px solid #30363d; border-radius:8px; padding:15px; font-family:monospace; font-size:0.8rem; margin-bottom:15px;">
            <div style="color:#8b949e;">// Balimeen SDK v3.2</div>
            <div style="color:#c9d1d9;">npm install @balimeen/sdk</div>
            <div style="color:#7ee787; margin-top:8px;">✓ Ready to use</div>
        </div>
        <div style="display:flex; justify-content:space-between; font-size:0.85rem; margin-bottom:8px;">
            <span style="color:#94a3b8;">Endpoints Documented</span><span>86/86</span>
        </div>
        <div style="display:flex; justify-content:space-between; font-size:0.85rem;">
            <span style="color:#94a3b8;">Postman Collection</span><span>Available</span>
        </div>
        <button style="background:#10b981; color:#fff; border:none; padding:10px 16px; border-radius:6px; font-size:0.85rem; cursor:pointer; width:100%; margin-top:15px; font-weight:600;">View Full Docs</button>
    </div>
</div>
<?php require_once __DIR__ . '/footer.php'; ?>
