melhore a interface:<?php
// teacher/dashboard.php

session_start();
include '../includes/db.php';

// Simulando professor logado
$professor_id = 1;

// Buscar dados do professor
$stmt = $pdo->prepare("SELECT * FROM teachers WHERE id = ?");
$stmt->execute([$professor_id]);
$professor = $stmt->fetch(PDO::FETCH_ASSOC);

// Buscar alunos vinculados ao professor
$stmt_alunos = $pdo->prepare("SELECT * FROM students WHERE teacher_id = ?");
$stmt_alunos->execute([$professor_id]);
$alunos = $stmt_alunos->fetchAll(PDO::FETCH_ASSOC);

// Buscar aulas agendadas do professor
$stmt_aulas = $pdo->prepare("SELECT * FROM classes WHERE teacher_id = ? AND status = 'scheduled'");
$stmt_aulas->execute([$professor_id]);
$aulas = $stmt_aulas->fetchAll(PDO::FETCH_ASSOC);
?>

<!DOCTYPE html>
<html lang="pt-BR">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>FluentImmersion - Teacher Dashboard</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css ">
    <style>
        :root {
            --primary-color: #4361ee;
            --secondary-color: #3f37c9;
            --accent-color: #4895ef;
            --light-color: #f8f9fa;
            --dark-color: #212529;
            --success-color: #4cc9f0;
            --warning-color: #f8961e;
            --danger-color: #f72585;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        body {
            background-color: #f5f7fa;
            color: var(--dark-color);
        }

        .dashboard {
            display: grid;
            grid-template-columns: 250px 1fr;
            min-height: 100vh;
        }

        /* Sidebar Styles */
        .sidebar {
            background-color: var(--primary-color);
            color: white;
            padding: 20px 0;
            position: relative;
        }

        .logo {
            text-align: center;
            padding: 0 20px 20px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .logo h2 {
            font-size: 1.5rem;
            margin-bottom: 5px;
        }

        .logo p {
            font-size: 0.8rem;
            opacity: 0.8;
        }

        .nav-menu {
            margin-top: 30px;
        }

        .nav-item {
            padding: 12px 20px;
            display: flex;
            align-items: center;
            cursor: pointer;
            transition: all 0.3s;
        }

        .nav-item:hover {
            background-color: rgba(255, 255, 255, 0.1);
        }

        .nav-item.active {
            background-color: rgba(255, 255, 255, 0.2);
            border-left: 4px solid white;
        }

        .nav-item i {
            margin-right: 10px;
            font-size: 1.1rem;
        }

        .user-profile {
            position: absolute;
            bottom: 20px;
            width: 100%;
            padding: 0 20px;
        }

        .profile-card {
            display: flex;
            align-items: center;
            background-color: rgba(255, 255, 255, 0.1);
            padding: 10px;
            border-radius: 8px;
        }

        .profile-img {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background-color: white;
            margin-right: 10px;
            overflow: hidden;
        }

        .profile-img img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .profile-info h4 {
            font-size: 0.9rem;
            margin-bottom: 3px;
        }

        .profile-info p {
            font-size: 0.7rem;
            opacity: 0.8;
        }

        /* Main Content Styles */
        .main-content {
            padding: 20px;
        }

        .header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 30px;
        }

        .page-title h1 {
            font-size: 1.8rem;
            color: var(--dark-color);
        }

        .page-title p {
            font-size: 0.9rem;
            color: #6c757d;
        }

        .search-bar {
            display: flex;
            align-items: center;
            background-color: white;
            padding: 8px 15px;
            border-radius: 30px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
        }

        .search-bar input {
            border: none;
            outline: none;
            padding: 5px 10px;
            width: 200px;
        }

        .search-bar i {
            color: #6c757d;
        }

        /* Stats Cards */
        .stats-cards {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 20px;
            margin-bottom: 30px;
        }

        .stat-card {
            background-color: white;
            border-radius: 10px;
            padding: 20px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            display: flex;
            justify-content: space-between;
        }

        .stat-info h3 {
            font-size: 1.2rem;
            margin-bottom: 10px;
            color: var(--dark-color);
        }

        .stat-info p {
            font-size: 0.9rem;
            color: #6c757d;
        }

        .stat-icon {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
        }

        .icon-blue {
            background-color: rgba(67, 97, 238, 0.1);
            color: var(--primary-color);
        }

        .icon-green {
            background-color: rgba(76, 201, 240, 0.1);
            color: var(--success-color);
        }

        .icon-orange {
            background-color: rgba(248, 150, 30, 0.1);
            color: var(--warning-color);
        }

        .icon-pink {
            background-color: rgba(247, 37, 133, 0.1);
            color: var(--danger-color);
        }

        /* Classes Section */
        .classes-section {
            display: grid;
            grid-template-columns: 2fr 1fr;
            gap: 20px;
            margin-bottom: 30px;
        }

        .upcoming-classes {
            background-color: white;
            border-radius: 10px;
            padding: 20px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
        }

        .section-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }

        .section-header h2 {
            font-size: 1.3rem;
            color: var(--dark-color);
        }

        .section-header a {
            color: var(--primary-color);
            text-decoration: none;
            font-size: 0.9rem;
        }

        .class-list {
            display: flex;
            flex-direction: column;
            gap: 15px;
        }

        .class-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px;
            border-radius: 8px;
            background-color: #f8f9fa;
            transition: all 0.3s;
        }

        .class-item:hover {
            background-color: #e9ecef;
        }

        .class-info h4 {
            font-size: 0.9rem;
            margin-bottom: 5px;
        }

        .class-info p {
            font-size: 0.8rem;
            color: #6c757d;
        }

        .class-time {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
        }

        .class-time .time {
            font-weight: bold;
            color: var(--primary-color);
        }

        .class-time .duration {
            font-size: 0.7rem;
            color: #6c757d;
        }

        .class-actions {
            display: flex;
            gap: 10px;
        }

        .btn {
            padding: 5px 10px;
            border-radius: 5px;
            border: none;
            cursor: pointer;
            font-size: 0.8rem;
            transition: all 0.3s;
        }

        .btn-primary {
            background-color: var(--primary-color);
            color: white;
        }

        .btn-outline {
            background-color: transparent;
            border: 1px solid var(--primary-color);
            color: var(--primary-color);
        }

        /* Student Progress */
        .student-progress {
            background-color: white;
            border-radius: 10px;
            padding: 20px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
        }

        .student-list {
            display: flex;
            flex-direction: column;
            gap: 15px;
        }

        .student-item {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .student-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background-color: #e9ecef;
            overflow: hidden;
        }

        .student-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .student-info h4 {
            font-size: 0.9rem;
            margin-bottom: 3px;
        }

        .student-info p {
            font-size: 0.8rem;
            color: #6c757d;
        }

        .progress-indicator {
            width: 60px;
            height: 6px;
            background-color: #e9ecef;
            border-radius: 3px;
            overflow: hidden;
        }

        .progress-bar {
            height: 100%;
            background-color: var(--primary-color);
            width: 0%;
        }
    </style>
</head>
<body>

<div class="dashboard">

    <!-- Sidebar -->
    <div class="sidebar">
        <div class="logo">
            <h2>FluentImmersion</h2>
            <p>Teacher Dashboard</p>
        </div>
        <div class="nav-menu">
            <div class="nav-item active">
                <i class="fas fa-tachometer-alt"></i>
                <span>Dashboard</span>
            </div>
            <div class="nav-item">
                <i class="fas fa-users"></i>
                <span>My Students</span>
            </div>
            <div class="nav-item">
                <i class="fas fa-calendar-alt"></i>
                <span>Schedule</span>
            </div>
            <div class="nav-item">
                <i class="fas fa-book"></i>
                <span>Content Library</span>
            </div>
            <div class="nav-item">
                <i class="fas fa-chart-bar"></i>
                <span>Reports</span>
            </div>
            <div class="nav-item">
                <i class="fas fa-comments"></i>
                <span>Messages</span>
            </div>
            <div class="nav-item">
                <i class="fas fa-cog"></i>
                <span>Settings</span>
            </div>
        </div>
        <div class="user-profile">
            <div class="profile-card">
                <div class="profile-img">
                    <img src="https://randomuser.me/api/portraits/men/32.jpg " alt="Profile">
                </div>
                <div class="profile-info">
                    <h4><?= htmlspecialchars($professor['name']) ?></h4>
                    <p><?= htmlspecialchars($professor['role']) ?></p>
                </div>
            </div>
        </div>
    </div>

    <!-- Main Content -->
    <div class="main-content">
        <div class="header">
            <div class="page-title">
                <h1>Professor Dashboard</h1>
                <p>Bem-vindo(a), <?= htmlspecialchars($professor['name']) ?>! Aqui está sua visão geral.</p>
            </div>
            <div class="search-bar">
                <i class="fas fa-search"></i>
                <input type="text" placeholder="Buscar...">
            </div>
        </div>

        <!-- Stats Cards -->
        <div class="stats-cards">
            <div class="stat-card">
                <div class="stat-info">
                    <h3>Alunos Ativos</h3>
                    <p><?= count($alunos) ?> alunos</p>
                </div>
                <div class="stat-icon icon-blue">
                    <i class="fas fa-users"></i>
                </div>
            </div>
            <div class="stat-card">
                <div class="stat-info">
                    <h3>Aulas Esta Semana</h3>
                    <p><?= count($aulas) ?> aulas</p>
                </div>
                <div class="stat-icon icon-green">
                    <i class="fas fa-calendar-alt"></i>
                </div>
            </div>
            <div class="stat-card">
                <div class="stat-info">
                    <h3>Tarefas Corrigidas</h3>
                    <p>32/45 completas</p>
                </div>
                <div class="stat-icon icon-orange">
                    <i class="fas fa-check-circle"></i>
                </div>
            </div>
            <div class="stat-card">
                <div class="stat-info">
                    <h3>Mensagens</h3>
                    <p>5 não lidas</p>
                </div>
                <div class="stat-icon icon-pink">
                    <i class="fas fa-envelope"></i>
                </div>
            </div>
        </div>

        <!-- Classes Section -->
        <div class="classes-section">
            <div class="upcoming-classes">
                <div class="section-header">
                    <h2>Aulas Agendadas</h2>
                    <a href="#">Ver Todas</a>
                </div>
                <div class="class-list">
                    <?php foreach ($aulas as $aula): ?>
                        <div class="class-item">
                            <div class="class-info">
                                <h4><?= htmlspecialchars($aula['title']) ?></h4>
                                <p><?= htmlspecialchars($aula['topic']) ?></p>
                            </div>
                            <div class="class-time">
                                <span class="time"><?= date('D, H:i', strtotime($aula['schedule'])) ?></span>
                                <span class="duration"><?= $aula['duration'] ?> min</span>
                            </div>
                            <div class="class-actions">
                                <button class="btn btn-primary">Iniciar</button>
                                <button class="btn btn-outline">Detalhes</button>
                            </div>
                        </div>
                    <?php endforeach; ?>
                </div>
            </div>

            <div class="student-progress">
                <div class="section-header">
                    <h2>Progresso dos Alunos</h2>
                    <a href="#">Ver Todos</a>
                </div>
                <div class="student-list">
                    <?php foreach ($alunos as $aluno): ?>
                        <div class="student-item">
                            <div class="student-avatar">
                                <img src="https://randomuser.me/api/portraits/women/ <?= rand(10,99) ?>.jpg" alt="Student">
                            </div>
                            <div class="student-info">
                                <h4><?= htmlspecialchars($aluno['name']) ?></h4>
                                <p><?= htmlspecialchars($aluno['current_level']) ?></p>
                            </div>
                            <div class="progress-indicator">
                                <div class="progress-bar" style="width: <?= rand(40,90) ?>%"></div>
                            </div>
                        </div>
                    <?php endforeach; ?>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    // Adiciona evento aos itens do menu
    document.addEventListener('DOMContentLoaded', function () {
        const navItems = document.querySelectorAll('.nav-item');
        navItems.forEach(item => {
            item.addEventListener('click', function () {
                navItems.forEach(i => i.classList.remove('active'));
                this.classList.add('active');
            });
        });

        // Exemplo de interatividade
        const searchInput = document.querySelector('.search-bar input');
        if (searchInput) {
            searchInput.addEventListener('input', function () {
                console.log('Buscando:', this.value);
            });
        }
    });
</script>

</body>
</html>