<nav class="navbar navbar-expand-md navbar-light bg-white shadow-sm">
    <div class="container">
        <a class="navbar-brand" href="{{ url('/products') }}">
            <img src="{{ asset('images/logo.jpg') }}" alt="Logo" style="width: 150px; height: 55px; margin: 5px;">
        </a>

        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="{{ __('Toggle navigation') }}">
            <span class="navbar-toggler-icon"></span>
        </button>

        <div class="collapse navbar-collapse" id="navbarSupportedContent">
            <!-- Left Side Of Navbar -->
            <ul class="navbar-nav ms-5">
                <!-- Navigation Links for Authenticated Users -->
                @auth
                    <li class="nav-item me-3">
                        <a class="nav-link" href="https://www.squat.in.th/services/logservertesting/" target="_blank">
                            <i class="fas fa-chart-line me-1"></i>
                            {{ __('ข้อมูลมาตรฐาน') }}
                        </a>
                    </li>
                    <li class="nav-item me-3">
                        <a class="nav-link" href="{{ route('products.index') }}">
                            <i class="fas fa-clipboard-list me-1"></i>
                            {{ __('ประเมินผลิตภัณฑ์') }}
                        </a>
                    </li>
                @endauth
            </ul>

            <!-- Right Side Of Navbar -->
            <ul class="navbar-nav ms-auto">
                <!-- Authentication Links -->
                @guest
                    @if (Route::has('login'))
                        <li class="nav-item">
                            <a class="nav-link" href="{{ route('login') }}">{{ __('เข้าสู่ระบบ') }}</a>
                        </li>
                    @endif

                    @if (Route::has('register'))
                        <li class="nav-item">
                            <a class="nav-link" href="{{ route('register') }}">{{ __('ลงทะเบียน') }}</a>
                        </li>
                    @endif
                @else
                    <!-- Admin Function Button -->
                    @if (strtolower(Auth::user()->Level) === 'admin' || strtolower(Auth::user()->Level) === 'superadmin')
                    <li class="nav-item me-3">
                        <a class="nav-link btn btn-primary text-white px-3" href="{{ route('admin.dashboard') }}">
                            <i class="fas fa-cogs me-1"></i>
                            {{ __('ADMIN FUNCTION') }}
                        </a>
                    </li>
                    @endif

                    <li class="nav-item dropdown">
                        <a id="navbarDropdown" class="nav-link" href="#" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>
                            <img src="{{ asset('images/Profile.png') }}" alt="Profile" class="rounded-circle"  style="width: 32px; height: 32px; object-fit: cover;">
                            {{ Auth::user()->name }}
                        </a>
                    </li>
                @endguest
            </ul>
        </div>
    </div>
</nav>
