<nav class="navbar navbar-expand-lg navbar-dark bg-dark shadow-sm">
    <div class="container-fluid">
        <a class="navbar-brand" href="{{ route('dashboard') }}">{{ config('app.name', 'ISP Billing') }}</a>

        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#mainNavbar" aria-controls="mainNavbar" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>

        <div class="collapse navbar-collapse" id="mainNavbar">
            @auth
                <ul class="navbar-nav me-auto mb-2 mb-lg-0">
                    <li class="nav-item">
                        <a class="nav-link {{ request()->routeIs('dashboard') ? 'active' : '' }}" href="{{ route('dashboard') }}">Dashboard</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link {{ request()->routeIs('admin.customers.*') ? 'active' : '' }}" href="{{ route('admin.customers.index') }}">Customers</a>
                    </li>
                    @can('package.view')
                        <li class="nav-item">
                            <a class="nav-link {{ request()->routeIs('admin.packages.*') ? 'active' : '' }}" href="{{ route('admin.packages.index') }}">Packages</a>
                        </li>
                    @endcan
                    @can('mikrotik.view')
                        <li class="nav-item">
                            <a class="nav-link {{ request()->routeIs('admin.mikrotiks.*') ? 'active' : '' }}" href="{{ route('admin.mikrotiks.index') }}">Mikrotik Servers</a>
                        </li>
                    @endcan
                    @can('mikrotik_secret.view')
                        <li class="nav-item">
                            <a class="nav-link {{ request()->routeIs('admin.mikrotik-secrets.*') ? 'active' : '' }}" href="{{ route('admin.mikrotik-secrets.index') }}">PPP Secrets</a>
                        </li>
                    @endcan
                    @can('online_status.view')
                        <li class="nav-item">
                            <a class="nav-link {{ request()->routeIs('admin.online-statuses.*') ? 'active' : '' }}" href="{{ route('admin.online-statuses.index') }}">Online Status</a>
                        </li>
                    @endcan
                    @can('zone.view')
                        <li class="nav-item">
                            <a class="nav-link {{ request()->routeIs('admin.zones.*') ? 'active' : '' }}" href="{{ route('admin.zones.index') }}">Zones</a>
                        </li>
                    @endcan
                    @can('reseller.view')
                        <li class="nav-item">
                            <a class="nav-link {{ request()->routeIs('admin.resellers.*') ? 'active' : '' }}" href="{{ route('admin.resellers.index') }}">Resellers</a>
                        </li>
                    @endcan
                    @can('sms.view')
                        <li class="nav-item">
                            <a class="nav-link {{ request()->routeIs('admin.sms-gateways.*') ? 'active' : '' }}" href="{{ route('admin.sms-gateways.index') }}">SMS Integration</a>
                        </li>
                    @endcan
                    @can('user.manage')
                        <li class="nav-item">
                            <a class="nav-link {{ request()->routeIs('admin.staff.*') ? 'active' : '' }}" href="{{ route('admin.staff.index') }}">Staff</a>
                        </li>
                    @endcan
                </ul>

                <ul class="navbar-nav ms-auto align-items-center">
                    <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" href="#" id="accountDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
                            {{ Auth::user()->name }}
                        </a>
                        <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="accountDropdown">
                            <li><a class="dropdown-item" href="{{ route('profile.edit') }}">Profile</a></li>
                            <li><hr class="dropdown-divider"></li>
                            <li>
                                <form method="POST" action="{{ route('logout') }}">
                                    @csrf
                                    <button type="submit" class="dropdown-item">Log Out</button>
                                </form>
                            </li>
                        </ul>
                    </li>
                </ul>
            @endauth
        </div>
    </div>
</nav>
