<?php
// Sidebar component - dapat digunakan di semua halaman admin dashboard
// Gunakan: <?php include 'sidebar.php'; ?>


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

    .main-container {
        display: flex;
        min-height: 100vh;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 250px;
        height: 100vh;
        background-color: #212529;
        color: white;
        overflow-y: auto;
        z-index: 1000;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    }

    .sidebar-content {
        display: flex;
        flex-direction: column;
        height: 100%;
        padding: 15px 0;
    }

    .sidebar-header {
        padding: 20px 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .sidebar-header a {
        text-decoration: none;
        color: white;
        font-size: 1.25rem;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .sidebar-nav {
        flex: 1;
        padding: 15px 0;
        overflow-y: auto;
    }

    .sidebar-nav ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .sidebar-nav li {
        margin: 0;
    }

    .sidebar-nav a {
        color: rgba(255, 255, 255, 0.8);
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 20px;
        transition: all 0.3s ease;
        font-size: 0.95rem;
    }

    .sidebar-nav a:hover {
        color: white;
        background-color: rgba(255, 255, 255, 0.1);
        padding-left: 25px;
    }

    .sidebar-nav a.active {
        background-color: rgba(255, 255, 255, 0.15);
        color: white;
        border-left: 3px solid #007bff;
        padding-left: 17px;
    }

    .sidebar-footer {
        padding: 15px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .sidebar-footer .dropdown-toggle {
        color: white;
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px;
        border-radius: 4px;
        transition: background-color 0.3s;
    }

    .sidebar-footer .dropdown-toggle:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }

    .content-wrapper {
        margin-left: 250px;
        width: calc(100% - 250px);
        min-height: 100vh;
    }

    .content {
        padding: 20px;
    }

    /* Responsive - untuk tablet */
    @media (max-width: 992px) {
        .sidebar {
            width: 200px;
        }

        .sidebar-nav a {
            font-size: 0.9rem;
            padding: 10px 15px;
        }

        .content-wrapper {
            margin-left: 200px;
            width: calc(100% - 200px);
        }
    }

    /* Responsive - untuk mobile */
    @media (max-width: 768px) {
        .sidebar {
            width: 100%;
            height: auto;
            position: relative;
            box-shadow: none;
            border-bottom: 1px solid #ddd;
        }

        .sidebar-content {
            padding: 0;
        }

        .sidebar-nav {
            display: none;
            padding: 0;
        }

        .sidebar-nav.show {
            display: block;
            padding: 10px 0;
        }

        .sidebar-footer {
            border-top: none;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .content-wrapper {
            margin-left: 0;
            width: 100%;
        }
    }
</style>

<div class="main-container">
    <!-- Sidebar -->
    <div class="sidebar">
        <div class="sidebar-content">
            <!-- Header -->
            <div class="sidebar-header">
                <a href="../admin_dashboard">
                   <!--ikon fl3n pada asset-->
                    <img src="/assets/logoFLS3N.png" alt="Logo FL3N" style="width: 30px; height: 30px;">
                    <span>FLS3N 2026 Admin Panel</span>
                </a>
            </div>

            <!-- Navigation -->
            <div class="sidebar-nav">
                <ul>
                    <li>
                        <a href="../admin_dashboard" class="<?php echo ($current_dir === 'admin_dashboard' && $current_page === 'index.php') ? 'active' : ''; ?>">
                            <i class="fas fa-home"></i> Dashboard
                        </a>
                    </li>
                    <li>
                        <a href="/admin/admin_dashboard/admin_cabang_lomba" class="<?php echo ($current_dir === 'admin_cabang_lomba') ? 'active' : ''; ?>">
                            <i class="fas fa-trophy"></i> Cabang Lomba
                        </a>
                    </li>
                    <li>
                        <a href="/admin/admin_dashboard/admin_kelola_peserta" class="<?php echo ($current_dir === 'admin_kelola_peserta') ? 'active' : ''; ?>">
                            <i class="fas fa-user-tie"></i> Kelola Peserta
                        </a>
                    </li>
                    <li>
                        <a href="/admin/admin_dashboard/admin_peserta_kota" class="<?php echo ($current_dir === 'admin_peserta_kota') ? 'active' : ''; ?>">
                            <i class="fas fa-users"></i> Peserta Kota Salatiga
                        </a>
                    </li>
                    <li>
                        <a href="/admin/admin_dashboard/admin_peserta_kabupaten" class="<?php echo ($current_dir === 'admin_peserta_kabupaten') ? 'active' : ''; ?>">
                            <i class="fas fa-users"></i> Peserta Kab. Semarang
                        </a>
                    </li>
                    <li>
                        <a href="/admin/admin_dashboard/admin_peserta_kabupaten_2" class="<?php echo ($current_dir === 'admin_peserta_kabupaten_2') ? 'active' : ''; ?>">
                            <i class="fas fa-users"></i> Peserta Kab. Demak
                        </a>
                    </li>
                    <li>
                        <a href="/admin/admin_dashboard/admin_admin" class="<?php echo ($current_dir === 'admin_admin') ? 'active' : ''; ?>">
                            <i class="fas fa-user-shield"></i> Kelola Admin
                        </a>
                    </li>
                    <li>
                        <a href="/admin/admin_dashboard/admin_juri" class="<?php echo ($current_dir === 'admin_juri') ? 'active' : ''; ?>">
                            <i class="fas fa-user-tie"></i> Kelola Juri
                        </a>
                    </li>
                    <li>
                        <a href="/admin/admin_dashboard/admin_kelola_sekolah" class="<?php echo ($current_dir === 'admin_kelola_sekolah') ? 'active' : ''; ?>">
                            <i class="fas fa-school"></i> Kelola Sekolah    
                        </a>
                    </li>
                    <li>
                        <a href="/admin/admin_dashboard/admin_penilaian" class="<?php echo ($current_dir === 'admin_penilaian') ? 'active' : ''; ?>">
                            <i class="fas fa-star"></i> Hasil Penilaian
                        </a>
                    </li>
                    <li>
                        <a href="/admin/admin_dashboard/admin_status_lomba" class="<?php echo ($current_dir === 'admin_status_lomba') ? 'active' : ''; ?>">
                            <i class="fas fa-toggle-on"></i> Status Lomba
                        </a>
                    </li>
                </ul>
            </div>

            <!-- Footer -->
            <div class="sidebar-footer">
                <div class="dropdown">
                    <a href="#" class="dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
                        <i class="fas fa-user-circle" style="font-size: 1.5rem;"></i>
                        <strong><?php echo isset($_SESSION['nama']) ? $_SESSION['nama'] : 'Admin'; ?></strong>
                    </a>
                    <ul class="dropdown-menu dropdown-menu-dark">
                        <li><hr class="dropdown-divider"></li>
                        <li><a class="dropdown-item" href="../../logout.php">Logout</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>

    <!-- Content Wrapper -->
    <div class="content-wrapper">
        <div class="content">
