@auth

<style>
    /* Sidebar styling */
    .sidebar {
        width: 250px;
        height: 100vh;
        position: fixed;
        top: 0; bottom: 0; left: 0;
        background-color: #fff;
        border-right: 1px solid #ddd;
        padding: 1rem;
        overflow-y: auto;
        z-index: 1040;
    }

    /* Main content margin to avoid sidebar overlap */
    #main-content {
        margin-left: 250px;
        padding: 1rem;
    }

    /* Nav links styling */
    .nav-link {
        color: #333;
        text-decoration: none;
        padding: 0.5rem 0;
        display: block;
    }

    .nav-link.active {
        font-weight: bold;
        color: #007bff;
    }

    .nav-link:hover {
        color: #0056b3;
    }

    /* Logout link styling */
    .nav-link.text-danger {
        color: #dc3545;
    }

    /* Sidebar header styling */
    .sidebar-header {
        margin-bottom: 1.5rem;
    }
</style>

<nav id="sidebar" class="sidebar vh-100">
    <div class="sidebar-header">
        <h4 class="mb-0">Admin Panel</h4>
    </div>

    <ul class="nav flex-column">
        <li class="nav-item">
            <a href="{{ route('admin.dashboard') }}" class="nav-link {{ request()->routeIs('admin.dashboard') ? 'active' : '' }}">
                Dashboard
            </a>
        </li>
        <li class="nav-item">
            <a href="{{ route('admin.data-latih') }}" class="nav-link {{ request()->routeIs('admin.data-latih') ? 'active' : '' }}">
                Dataset
            </a>
        </li>
        <li class="nav-item">
            <a href="{{ route('admin.uji-data') }}" 
            class="nav-link {{ request()->routeIs('admin.uji-data*') ? 'active' : '' }}">
                Modelling
            </a>
        </li>
        <li class="nav-item">
            <a href="{{ route('admin.prediksi.index') }}" class="nav-link {{ request()->routeIs('admin.prediksi.index') ? 'active' : '' }}">
                Hasil Prediksi
            </a>
        </li>
        <li class="nav-item">
            <a href="#dataMenu" class="nav-link" data-bs-toggle="collapse" role="button" aria-expanded="false" aria-controls="dataMenu">
                Data
            </a>
            <div id="dataMenu" class="collapse">
                <ul class="nav flex-column ms-3">
                    <li class="nav-item">
                        <a href="{{ route('admin.users.index') }}" class="nav-link {{ request()->routeIs('admin.users.*') ? 'active' : '' }}">
                            Users
                        </a>
                    </li>
                    <li class="nav-item">
                        <a href="{{ route('admin.kabupaten.index') }}" class="nav-link {{ request()->routeIs('admin.kabupaten.*') ? 'active' : '' }}">
                            Kecamatan
                        </a>
                    </li>
                    <li class="nav-item">
                        <a href="{{ route('admin.kasus.index') }}" class="nav-link {{ request()->routeIs('admin.kasus.*') ? 'active' : '' }}">
                            Data Kasus
                        </a>
                    </li>
                </ul>
            </div>
        </li>

        <li class="nav-item mt-auto">
            <form id="logout-form" action="{{ route('logout') }}" method="POST" style="display:none;">@csrf</form>
            <a href="#" onclick="event.preventDefault(); document.getElementById('logout-form').submit();" class="nav-link text-danger">
                Logout
            </a>
        </li>
    </ul>
</nav>

<div id="main-content">
    {{-- Tempat isi konten utama --}}
    <h1>Selamat datang di halaman Admin</h1>
</div>

@endauth
