<?php
$page_title = 'Corporate University';
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-university" style="color:#f59e0b; margin-right:10px;"></i>Corporate University</h2>
        <p style="color:#64748b; font-size:0.95rem; margin-top:5px;">Internal academy, certifications, skill badges, and leadership programs.</p>
    </div>
    <button style="background:linear-gradient(135deg,#f59e0b,#d97706); color:#fff; border:none; padding:10px 20px; border-radius:8px; font-size:0.9rem; cursor:pointer; font-weight:600;"><i class="fas fa-plus"></i> Create Course</button>
</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 #f59e0b;">
        <div style="color:#64748b; font-size:0.8rem; font-weight:600; margin-bottom:8px;">TOTAL COURSES</div>
        <div style="font-size:1.6rem; font-weight:700; color:#0f172a;">86</div>
        <div style="color:#f59e0b; font-size:0.8rem; margin-top:5px;"><i class="fas fa-graduation-cap"></i> 7 Programs</div>
    </div>
    <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;">CERTIFIED STAFF</div>
        <div style="font-size:1.6rem; font-weight:700; color:#0f172a;">1,840</div>
        <div style="color:#10b981; font-size:0.8rem; margin-top:5px;"><i class="fas fa-certificate"></i> 74% of Workforce</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;">SKILL BADGES</div>
        <div style="font-size:1.6rem; font-weight:700; color:#0f172a;">4,280</div>
        <div style="color:#3b82f6; font-size:0.8rem; margin-top:5px;"><i class="fas fa-award"></i> Earned This Quarter</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;">LEARNING HOURS</div>
        <div style="font-size:1.6rem; font-weight:700; color:#0f172a;">12,400</div>
        <div style="color:#8b5cf6; font-size:0.8rem; margin-top:5px;"><i class="fas fa-clock"></i> This Month</div>
    </div>
</div>

<div class="grid-2" style="margin-bottom:24px;">
    <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-medal" style="color:#f59e0b; margin-right:8px;"></i>Certification Programs</h3>
        <?php
        $certs = [
            ['Internal Academy', '42 courses', '1,240 enrolled', '#f59e0b', 92],
            ['Safety Certification', '12 modules', '2,480 certified', '#ef4444', 98],
            ['Leadership Program', '8 tracks', '86 leaders', '#8b5cf6', 78],
            ['Dealer Certification', '6 modules', '420 dealers', '#3b82f6', 85],
            ['Franchise Certification', '5 modules', '48 franchises', '#10b981', 91],
        ];
        foreach ($certs as $c): ?>
        <div style="border:1px solid #e2e8f0; border-radius:8px; padding:15px; margin-bottom:10px;">
            <div style="display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:8px;">
                <div>
                    <div style="font-weight:600; font-size:0.9rem; color:#0f172a;"><?= $c[0] ?></div>
                    <div style="font-size:0.75rem; color:#94a3b8;"><?= $c[1] ?> · <?= $c[2] ?></div>
                </div>
                <span style="background:<?= $c[3] ?>15; color:<?= $c[3] ?>; padding:3px 10px; border-radius:10px; font-size:0.7rem; font-weight:bold;"><?= $c[4] ?>% Complete</span>
            </div>
            <div style="background:#e2e8f0; height:6px; border-radius:3px; overflow:hidden;">
                <div style="width:<?= $c[4] ?>%; height:100%; background:<?= $c[3] ?>; border-radius:3px;"></div>
            </div>
        </div>
        <?php endforeach; ?>
    </div>

    <div style="display:flex; flex-direction:column; gap:24px;">
        <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-award" style="color:#3b82f6; margin-right:8px;"></i>Top Skill Badges</h3>
            <?php
            $badges = [
                ['🔧 Welding Expert', 342],
                ['📊 Data Analytics', 280],
                ['🛡️ Safety Champion', 520],
                ['💼 Sales Master', 186],
                ['🏭 Quality Inspector', 240],
            ];
            foreach ($badges as $b): ?>
            <div style="display:flex; justify-content:space-between; align-items:center; padding:10px 0; border-bottom:1px solid #f1f5f9;">
                <span style="font-size:0.9rem; font-weight:500;"><?= $b[0] ?></span>
                <span style="color:#64748b; font-size:0.85rem;"><?= $b[1] ?> earned</span>
            </div>
            <?php endforeach; ?>
        </div>

        <div style="background:linear-gradient(135deg,#f59e0b,#d97706); color:#fff; padding:20px; border-radius:12px;">
            <h3 style="margin:0 0 8px; font-size:1.1rem;"><i class="fas fa-trophy"></i> Leaderboard</h3>
            <p style="margin:0 0 10px; font-size:0.85rem; opacity:0.85;">Top learners this month.</p>
            <div style="display:flex; justify-content:space-between; font-size:0.85rem; margin-bottom:8px;">
                <span>🥇 Priya Sharma</span><span style="font-weight:bold;">42 hrs</span>
            </div>
            <div style="display:flex; justify-content:space-between; font-size:0.85rem; margin-bottom:8px;">
                <span>🥈 Rajesh Kumar</span><span style="font-weight:bold;">38 hrs</span>
            </div>
            <div style="display:flex; justify-content:space-between; font-size:0.85rem;">
                <span>🥉 Anita Patel</span><span style="font-weight:bold;">35 hrs</span>
            </div>
        </div>
    </div>
</div>

<?php require_once __DIR__ . '/footer.php'; ?>
