<!DOCTYPE html>
<html lang="en" data-theme="<?= e(get_theme_slug_for_scope('teacher')) ?>">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Teacher Portal - <?= get_setting('academy_name', 'CIX Orbit Academy') ?></title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="<?= asset_url('css/style.css') ?>" rel="stylesheet">
    <?= render_theme_css('teacher') ?>
</head>
<body>
<aside class="sidebar-cix" id="sidebar">
    <div class="sidebar-brand">
        <i class="fas fa-orbit" style="color:var(--secondary);font-size:1.3rem"></i>
        <div>
            <h5>CIX <span style="color:var(--secondary)">Orbit</span></h5>
            <small>Teacher Portal</small>
        </div>
    </div>
    <?php $uri = $_SERVER['REQUEST_URI'] ?? ''; ?>
    <ul class="sidebar-nav">
        <li><a href="<?= base_url('teacher/dashboard') ?>" class="<?= str_contains($uri, '/teacher/dashboard') ? 'active' : '' ?>"><i class="fas fa-th-large"></i> Dashboard</a></li>
        <li><a href="<?= base_url('teacher/courses') ?>" class="<?= str_contains($uri, '/teacher/course') ? 'active' : '' ?>"><i class="fas fa-book"></i> My Courses</a></li>
        <li><a href="<?= base_url('teacher/tests') ?>" class="<?= str_contains($uri, '/teacher/test') ? 'active' : '' ?>"><i class="fas fa-laptop-code"></i> Tests</a></li>
        <li><a href="<?= base_url('teacher/question-banks') ?>" class="<?= str_contains($uri, '/teacher/question') ? 'active' : '' ?>"><i class="fas fa-database"></i> Question Bank</a></li>
        <li><a href="<?= base_url('teacher/marking') ?>" class="<?= str_contains($uri, '/teacher/marking') ? 'active' : '' ?>"><i class="fas fa-check-double"></i> Marking</a></li>
        <li><a href="<?= base_url('teacher/students') ?>" class="<?= str_contains($uri, '/teacher/student') ? 'active' : '' ?>"><i class="fas fa-users"></i> Students</a></li>
        <li><a href="<?= base_url('teacher/announcements') ?>" class="<?= str_contains($uri, '/teacher/announcement') ? 'active' : '' ?>"><i class="fas fa-bullhorn"></i> Announcements</a></li>
        <li><a href="<?= base_url('teacher/reports') ?>" class="<?= str_contains($uri, '/teacher/report') ? 'active' : '' ?>"><i class="fas fa-chart-bar"></i> Reports</a></li>
        <li><a href="<?= base_url('/') ?>"><i class="fas fa-home"></i> Back to Site</a></li>
    </ul>
</aside>
<div class="main-content">
    <div class="top-bar">
        <div class="d-flex align-center gap-2">
            <button id="sidebarToggle" class="btn btn-outline-light d-lg-none"><i class="fas fa-bars"></i></button>
            <h4><?= $pageTitle ?? 'Dashboard' ?></h4>
        </div>
        <div class="d-flex align-center gap-2">
            <span class="text-secondary"><i class="fas fa-chalkboard-teacher me-1"></i> <?= e(current_user()['first_name'] ?? 'Teacher') ?></span>
            <a href="<?= base_url('logout') ?>" class="btn-cix btn-cix-sm btn-cix-danger"><i class="fas fa-sign-out-alt"></i></a>
        </div>
    </div>
    <?php if ($flash = flash('success')): ?><div class="alert-cix alert-cix-success"><i class="fas fa-check-circle"></i> <?= $flash ?></div><?php endif; ?>
    <?php if ($flash = flash('error')): ?><div class="alert-cix alert-cix-error"><i class="fas fa-exclamation-circle"></i> <?= $flash ?></div><?php endif; ?>
