<?php
session_start();

/* ---------- AUTH CHECK ---------- */
if (!isset($_SESSION['user_id'])) {
    header("Location: login.php");
    exit();
}

/* ---------- LANGUAGE LOCK ---------- */
if (!isset($_SESSION['language'])) {
    header("Location: select_language.php");
    exit();
}

$language = $_SESSION['language'];
$username = $_SESSION['username'];
?>

<?php require_once 'includes/header.php'; ?>

<div class="container">
    <h1>Learning Tracks</h1>
    <p>Select a track to begin your learning journey.</p>

    <?php if ($language === 'python'): ?>
        <div class="track-card">
            <h2>Python Basics</h2>
            <p>
                Learn Python from the fundamentals to problem-solving.
                This track focuses on understanding concepts, not memorizing code.
            </p>
            <a href="practice_track.php" class="btn-primary">Start Practice Track</a>
        </div>
    <?php endif; ?>

    <div class="track-card disabled">
        <h2>Java Programming</h2>
        <p>Coming Soon</p>
        <span class="locked">Locked</span>
    </div>

    <div class="track-card disabled">
        <h2>C Programming</h2>
        <p>Coming Soon</p>
        <span class="locked">Locked</span>
    </div>

    <p class="footer">
        © 2026 RS Learning Lab. Learning · Assessment · Certification
    </p>
</div>
