<!doctype html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- CSRF Token -->
    <meta name="csrf-token" content="{{ csrf_token() }}">

    <title>{{ config('app.name', 'Laravel') }}</title>

    <!-- Fonts -->
    <link rel="dns-prefetch" href="//fonts.bunny.net">
    <link href="https://fonts.bunny.net/css?family=Nunito" rel="stylesheet">
<!-- Font Awesome CSS (CDN) -->
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
  <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" rel="stylesheet">


<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.8/dist/umd/popper.min.js" integrity="sha384-I7E8VVD/ismYTF4hNIPjVp/Zjvgyol6VFvRkX/vR+Vc4jQkC+hVqc2pM8ODewa9r" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/js/bootstrap.min.js" integrity="sha384-7qAoOXltbVP82dhxHAUje59V5r2YsVfBafyUDxEdApLPmcdhBPg1DKg1ERo0BZlK" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
   <!-- Scripts -->
<style>
.pointer{
	cursor:pointer;
}
</style>
</head>
<body>
    <div id="app">
        <nav class="navbar navbar-expand-md navbar-light bg-white shadow-sm">
            <div class="container">
				@if(Auth::user())					
					@if(auth()->user()->hasRole('superadmin'))				
						<a class="navbar-brand" href="{{ url('/superadmin/home') }}">
							{{ config('app.name', 'Laravel') }}
						</a>
					@elseif(auth()->user()->hasRole('admin'))				
						 <a class="navbar-brand" href="{{ url('/admin/adminhome') }}">
							{{ config('app.name', 'Laravel') }}
						</a>
					@elseif(auth()->user()->hasRole('user'))				
						 <a class="navbar-brand" href="{{ url('/user/userhome') }}">
							{{ config('app.name', 'Laravel') }}
						</a>
					@endif		
				@else
					<a class="navbar-brand" href="{{ url('/') }}">
						{{ config('app.name', 'Laravel') }}
					</a>	
				@endif
				
                <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 me-auto">
						<!-- <li class="nav-item">
							<a class="nav-link" href="{{ route('register') }}">{{ __('Register') }}</a>
						</li> -->
					</ul>

                    <!-- Right Side Of Navbar -->
                    <ul class="navbar-nav ms-auto">
					<li class="nav-item d-flex justify-content-center align-items-center">						
						<a href="{{ url('lang/en') }}" class="link-info" style="margin-right:5px;text-decoration:none;" >English</a> | <a class="link-warning" style="margin-left:5px;text-decoration:none;margin-right:30px;" href="{{ url('lang/mr') }}">मराठी</a>
					</li>
                        <!-- Authentication Links -->
                        @guest
                            @if (Route::has('login'))
                                <li class="nav-item">
                                    <a class="nav-link" href="{{ route('login') }}">{{ __('Login') }}</a>
                                </li>
                            @endif

                            @if (Route::has('register'))
                                <li class="nav-item">
                                    <a class="nav-link" href="{{ route('register') }}">{{ __('Register') }}</a>
                                </li>
                            @endif
                        @else
											
							@if(Auth::user()->hasRole('superadmin'))
								
                            <li class="nav-item dropdown">
                                <a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>
                                    <i class="fa fa-upload"></i>&nbsp;{{ __('Muncipal Corporation') }}
                                </a>

                                <div class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
                                    <a class="dropdown-item" href="{{ route('latest_news.index') }}">{{ __('Latest News') }}</a>                                    
                               
                                    <a class="dropdown-item" href="{{ route('general_elections.index') }}">{{ __('General Elections') }}</a>                                    
                                    <a class="dropdown-item" href="{{ route('audits.index') }}">{{ __('User Logs') }}</a>                                    
                                </div>
                            </li>							
								
                            <li class="nav-item dropdown">
                                <a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>
                                    <i class="fa fa-cog"></i>&nbsp;{{ __('Settings') }}
                                </a>

                                <div class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
                                    <a class="dropdown-item" href="{{ route('configs.index') }}">{{ __('Configs') }}</a>
                                    <a class="dropdown-item" href="{{ route('roles.index') }}">{{ __('Roles') }}</a>
                                    <a class="dropdown-item" href="{{ route('users.index') }}">{{ __('Users') }}</a>                                    
                                </div>
                            </li>
							@endif
								
                            <li class="nav-item dropdown">
                                <a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>
                                    {{ Auth::user()->name }}
                                </a>

                                <div class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
                                    <a class="dropdown-item" href="{{ route('logout') }}"
                                       onclick="event.preventDefault();
                                                     document.getElementById('logout-form').submit();">
                                        {{ __('Logout') }}
                                    </a>

                                    <form id="logout-form" action="{{ route('logout') }}" method="POST" class="d-none">
                                        @csrf
                                    </form>
                                </div>
                            </li>
                        @endguest
                    </ul>
                </div>
            </div>
        </nav>

        <main class="py-4">
            @yield('content')
        </main>
    </div>
</body>
</html>
