@php
    if (empty($authUser) and auth()->check()) {
        $authUser = auth()->user();
    }
@endphp

<nav id="navbar" class="navbar navbar-expand-lg navbar-light glass-panel navbar--premium-home">
    <div class="{{ (!empty($isPanel) and $isPanel) ? 'container-fluid' : 'container' }}">
        <div class="premium-home-nav-shell d-flex align-items-center justify-content-between w-100 flex-wrap gap-15">
            <a class="navbar-brand navbar-order d-flex align-items-center mr-0 order-lg-2 order-xl-1" href="/">
                @if (!empty($generalSettings['logo']))
                    <img src="{{ $generalSettings['logo'] }}" class="img-fluid navbar-logo-home-premium" alt="{{ $generalSettings['site_name'] ?? 'logo' }}">
                @endif
            </a>

            <button class="navbar-toggler navbar-order border-0 order-3" type="button" id="navbarToggle" aria-controls="navbarContent" aria-expanded="false" aria-label="Menu">
                <span class="navbar-toggler-icon"></span>
            </button>

            <div class="collapse navbar-collapse navbar-toggle-content navbar-toggle-content--premium-center flex-grow-1 order-lg-1 order-xl-2" id="navbarContent">
                <div class="navbar-toggle-header text-right d-lg-none w-100 py-10">
                    <button class="btn-transparent" type="button" id="navbarClose" aria-label="Close">
                        <i data-feather="x" width="32" height="32"></i>
                    </button>
                </div>
                <form action="/search" method="get" class="premium-nav-search-form premium-nav-search-form--mobile d-lg-none px-15 pb-15 w-100" role="search">
                    <label class="sr-only" for="premium-nav-search-mobile-q">{{ trans('navbar.search_anything') }}</label>
                    <input id="premium-nav-search-mobile-q" type="search" name="search" class="premium-nav-search-form__input"
                        placeholder="{{ trans('home.premium_nav_search_placeholder') }}" autocomplete="off">
                    <button type="submit" class="premium-nav-search-form__btn" aria-label="{{ trans('navbar.search_anything') }}">
                        <i class="fa fa-search" aria-hidden="true"></i>
                    </button>
                </form>
                <ul class="navbar-nav premium-home-center-nav mx-lg-auto text-right align-items-lg-center" dir="rtl">
                    <li class="nav-item premium-nav-search-slot d-none d-lg-flex align-items-center mr-15">
                        <form action="/search" method="get" class="premium-nav-search-form" role="search">
                            <label class="sr-only" for="premium-nav-search-q">{{ trans('navbar.search_anything') }}</label>
                            <input id="premium-nav-search-q" type="search" name="search" class="premium-nav-search-form__input"
                                placeholder="{{ trans('home.premium_nav_search_placeholder') }}" autocomplete="off">
                            <button type="submit" class="premium-nav-search-form__btn" aria-label="{{ trans('navbar.search_anything') }}">
                                <i class="fa fa-search" aria-hidden="true"></i>
                            </button>
                        </form>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link font-weight-bold" href="/">{{ trans('home.premium_nav_home') }}</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link font-weight-bold" href="{{ url('/classes') }}">{{ trans('home.premium_nav_courses') }}</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link font-weight-bold" href="{{ url('/instructors') }}">{{ trans('home.premium_nav_instructors') }}</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link font-weight-bold" href="{{ url('/blog') }}">{{ trans('home.premium_nav_blog') }}</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link font-weight-bold" href="{{ url('/pages/about') }}">{{ trans('home.premium_nav_about') }}</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link font-weight-bold" href="{{ url('/contact') }}">{{ trans('home.premium_nav_contact') }}</a>
                    </li>
                </ul>
            </div>

            <div class="d-flex align-items-center flex-shrink-0 order-lg-3 premium-home-nav-ctas">
                @if(!empty($authUser))
                    <a href="{{ $authUser->isAdmin() ? '/admin' : '/panel' }}" class="btn btn-sm btn-premium-nav-cta btn-premium-nav-cta--gold ml-10">
                        {{ trans('public.my_panel') }}
                    </a>
                @else
                    <a href="{{ url('/register') }}" class="btn btn-sm btn-premium-nav-cta btn-premium-nav-cta--gold ml-10">
                        {{ trans('home.premium_cta_start') }}
                    </a>
                    <a href="{{ url('/login') }}?url={{ urlencode(url()->current()) }}" class="btn btn-sm btn-premium-nav-cta btn-premium-nav-cta--ghost ml-10">
                        {{ __('auth.login') }}
                    </a>
                @endif
            </div>
        </div>
    </div>
</nav>
