<?php
session_start();

/* =========================
   SAFE INPUTS
========================= */
$name  = $_GET['name']  ?? 'Student';
$roll  = $_GET['roll']  ?? 'NA';
$class = $_GET['class'] ?? '';
$lang  = $_GET['lang']  ?? 'python';

/* Mark reinforcement completion (optional use later) */
$_SESSION['reinforcement_completed'] = true;
?>
<!DOCTYPE html>
<html>
<head>
<title>Reinforcement Completed</title>

<style>
body{
    margin:0;
    background:radial-gradient(circle at top,#020617,#0f172a);
    color:#e5e7eb;
    font-family:Arial;
    display:flex;
    justify-content:center;
    align-items:center;
    height:100vh;
}
.card{
    background:#020617;
    padding:45px;
    border-radius:22px;
    box-shadow:0 0 45px rgba(0,0,0,.8);
    text-align:center;
    width:420px;
}
h1{
    color:#22c55e;
    margin-bottom:10px;
}
p{
    color:#94a3b8;
    font-size:15px;
}
.btn{
    display:block;
    margin-top:22px;
    padding:14px 30px;
    border-radius:999px;
    font-weight:bold;
    text-decoration:none;
}
.badge{
    background:linear-gradient(135deg,#0b8c9f,#14b8a6);
    color:#020617;
}
.final{
    background:#1e293b;
    color:#e5e7eb;
}
</style>
</head>

<body>

<div class="card">
    <h1>🎉 Reinforcement Completed</h1>
    <p>Excellent work, <b><?= htmlspecialchars($name) ?></b></p>

    <!-- 🎖 Download Learning Badge -->
    <a class="btn badge"
       href="/rs_lab/generate_badge_pdf.php
       ?type=reinforcement
       &name=<?= urlencode($name) ?>
       &roll=<?= urlencode($roll) ?>
       &class=<?= urlencode($class) ?>">
       🎖 Download Learning Badge
    </a>

    <!-- ▶ Go to Final Track -->
    <a class="btn final"
       href="/rs_lab/final_track.php
       ?name=<?= urlencode($name) ?>
       &roll=<?= urlencode($roll) ?>
       &class=<?= urlencode($class) ?>
       &lang=<?= urlencode($lang) ?>">
       ▶ Proceed to Final Track
    </a>
</div>

</body>
</html>