<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@yield('title', 'Admin Panel')</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">

    <style>
        body {
            background-color: #f8f9fa;
        }

        /* Sidebar */
        .sidebar {
            height: 100vh;
            background-color: #212529;
            color: white;
            position: fixed;
            width: 250px;
            top: 0;
            left: 0;
            padding-top: 60px;
        }

        .sidebar a {
            color: #adb5bd;
            text-decoration: none;
            display: block;
            padding: 10px 20px;
        }

        .sidebar a:hover, .sidebar a.active {
            background-color: #0d6efd;
            color: white;
        }

        /* Main Content */
        .content {
            margin-left: 250px;
            padding: 20px;
        }

        /* Topbar */
        .topbar {
            background-color: #343a40;
            height: 60px;
            position: fixed;
            width: calc(100% - 250px);
            left: 250px;
            top: 0;
            color: white;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 20px;
            z-index: 1000;
        }
    </style>
</head>
<body>

    <!-- Sidebar -->
    <div class="sidebar">
        <h4 class="text-center mb-4">E-Learning Admin</h4>
        <a href="{{ route('admin.dashboard') }}" class="{{ request()->routeIs('admin.dashboard') ? 'active' : '' }}">📊 Dashboard</a>
        <a href="{{ route('admin.guru.index') }}">👨‍🏫 Data Guru</a>
        <a href="{{ route('admin.siswa.index') }}">👨‍🎓 Data Siswa</a>
        <a href="{{ route('admin.kelas.index') }}">🏫 Data Kelas</a>
        <a href="{{ route('admin.mapel.index') }}">📘 Data Mapel</a>
        <a href="{{ route('admin.challenge.index') }}">🔥 Challenge</a>
        <a href="{{ route('admin.leaderboard.index') }}">🏆 Leaderboard</a>
        <form action="{{ route('admin.logout') }}" method="POST" class="mt-4 text-center">
            @csrf
            <button class="btn btn-outline-light btn-sm w-75">Logout</button>
        </form>
    </div>

    <!-- Topbar -->
    <div class="topbar">
        <div>
            <h5 class="mb-0">Dashboard Admin</h5>
        </div>
        <div>
            <span>👤 {{ Auth::guard('admin')->user()->username ?? 'Admin' }}</span>
        </div>
    </div>

    <!-- Content -->
    <main class="content mt-4 pt-4">
        @yield('content')
    </main>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
