

    @php
    $authCheck = auth()->check();
    $permission= auth()->user();
    @endphp
    <div class="sidebar h-100 position-fixed w3-sidebar w3-bar-block w3-collapse w3-card w3-animate-left" id="mySidebar">
        <div class="sidebar-logo p-4 text-start border-bottom border-white d-flex justify-content-between">
            <img src="{{asset('img/Logo3.png')}}" alt="">
            <a href="#" class="d-lg-none d-md-block d-block text-decoration-none text-white" onclick="w3_close()"><i class="fa-solid fa-circle-xmark"></i></a>
        </div>
        <div class="sidebar-module py-4">
            <nav class="navbar bg-transparent sidebar-navbar">
                <div class="container-fluid justify-content-center">
                    <ul class="navbar-nav w-100 px-2">
                        <li class="nav-item my-1">
                            <a class="nav-link d-flex align-items-center {{ Request::segment(2) == 'dashboard' ? 'active' : '' }} gap-2" href="{{ route('admin.dashboard') }}"><i class="fa-solid fa-gauge"></i> Dashboard</a>
                        </li>

                        {{-- <li class="nav-item my-1">
                            <a class="nav-link d-flex align-items-center {{ Request::segment(2) == 'users' ? 'active' : '' }} gap-2" href="{{ route('admin.users.index') }}"><i class="fa-solid fa-user"></i> Users</a>
                        </li> --}}

                        <li class="nav-item my-1">
                            <a class="nav-link d-flex align-items-center gap-2 {{ Request::segment(2) == 'users' || Request::segment(2) == 'roles' ? '' : 'collapsed' }}" data-bs-toggle="collapse" href="#usersSubmenu" role="button" aria-expanded="{{ Request::segment(2) == 'users' || Request::segment(2) == 'roles' ? 'true' : 'false' }}" aria-controls="usersSubmenu">
                                <i class="fa-solid fa-user"></i> User Management
                                <i class="fa-solid fa-chevron-down ms-auto"></i>
                            </a>
                            <div class="collapse {{ Request::segment(2) == 'users' || Request::segment(2) == 'roles' ? 'show' : '' }}" id="usersSubmenu">
                                <ul class="btn-toggle-nav list-unstyled fw-normal pb-1 small ms-4">
                                
                                    @if($authCheck && $permission->hasPermission('user-show'))
                                        <li class="my-1">
                                            <a href="{{ route('admin.users.index') }}" class="nav-link {{ Request::routeIs('admin.users.index') ? 'active' : '' }}">User</a>
                                        </li>
                                    @endif
                                    
                                        <li class="my-1">
                                            <a href="{{ route('admin.roles.index') }}" class="nav-link {{ Request::routeIs('admin.roles.index') ? 'active' : '' }}"> <i class="fa-solid fa-user-gear"></i>Manage Role</a>
                                        </li>
                                    
                                </ul>
                            </div>
                        </li>
                        
                        

                        <li class="nav-item my-1">
                            {{-- <a class="nav-link d-flex align-items-center {{ Request::segment(2) == 'roles' ? 'active' : '' }} gap-2" href="{{ route('admin.roles.index') }}"><i class="fa-solid fa-user-gear"></i> Roles</a> --}}
                        </li>


                        {{-- <li class="nav-item my-1">
                            <a class="nav-link d-flex align-items-center {{ Request::segment(2) == 'permissions' ? 'active' : '' }} gap-2" href="{{ route('admin.permissions.index') }}"><i class="fa-solid fa-user-lock"></i> Permissions</a>
                        </li> --}}
                        

                        @if($authCheck && $permission->hasPermission('student-show'))
                            <li class="nav-item my-1">
                                <a class="nav-link d-flex align-items-center {{ Request::segment(2) == 'student' ? 'active' : '' }} gap-2" href="{{ route('admin.student') }}"><i class="fa-solid fa-user-tie"></i>Students</a>
                            </li>
                        @endif 

                        <li class="nav-item my-1">
                            <a class="nav-link d-flex align-items-center gap-2 {{ Request::segment(2) == 'revenue' || Request::segment(2) == 'revenue' ? '' : 'collapsed' }}" data-bs-toggle="collapse" href="#reveSubmenu" role="button" aria-expanded="{{ Request::segment(2) == 'revenue' || Request::segment(2) == 'billing' ? 'true' : 'false' }}" aria-controls="reveSubmenu">
                                <i class="fa-solid fa-user"></i> Revenue 
                                <i class="fa-solid fa-chevron-down ms-auto"></i>
                            </a>
                            <div class="collapse {{ Request::segment(2) == 'revenue' || Request::segment(2) == 'billing' ? 'show' : '' }}" id="reveSubmenu">
                                <ul class="btn-toggle-nav list-unstyled fw-normal pb-1 small ms-4">
                                    @if($authCheck && $permission->hasPermission('revenue-show'))
                                        <li class="my-1">
                                            <a href="{{ route('admin.revenue.index') }}" class="nav-link {{ Request::routeIs('admin.revenue.index') ? 'active' : '' }}"></i>Revenue Management</a>
                                        </li>
                                    @endif 
                                    @if($authCheck && $permission->hasPermission('billing-show'))
                                        <li class="my-1">
                                            <a href="{{ route('admin.billing') }}" class="nav-link {{ Request::routeIs('admin.billing') ? 'active' : '' }}">Billing & Subscription</a>
                                        </li>
                                    @endif 
                                </ul>
                            </div>
                        </li>  
                        

                        <li class="nav-item my-1">
                            <a class="nav-link d-flex align-items-center gap-2 {{ Request::segment(2) == 'feedback' || Request::segment(2) == 'feedback' ? '' : 'collapsed' }}" data-bs-toggle="collapse" href="#feedbackSubmenu" role="button" aria-expanded="{{ Request::segment(2) == 'feedback' || Request::segment(2) == 'feedback-option' ? 'true' : 'false' }}" aria-controls="feedbackSubmenu">
                                <i class="fa-solid fa-user"></i> Feedback 
                                <i class="fa-solid fa-chevron-down ms-auto"></i>
                            </a>
                            <div class="collapse {{ Request::segment(2) == 'feedback' || Request::segment(2) == 'feedback-option' ? 'show' : '' }}" id="feedbackSubmenu">
                                <ul class="btn-toggle-nav list-unstyled fw-normal pb-1 small ms-4">
                                        @if($authCheck && $permission->hasPermission('feedback-show'))
                                        <li class="my-1">
                                            <a href="{{ route('admin.feedback') }}" class="nav-link {{ Request::routeIs('admin.feedback') ? 'active' : '' }}"></i>User Feedback</a>
                                        </li>
                                        @endif
                                         @if($authCheck && $permission->hasPermission('feedbackoption-show'))
                                        <li class="my-1">
                                            <a href="{{ route('admin.feedback-option') }}" class="nav-link {{ Request::routeIs('admin.feedback-option') ? 'active' : '' }}">Feedback Option</a>
                                        </li>
                                        @endif
                                    
                                </ul>
                            </div>
                        </li>  


                        {{-- <li class="nav-item my-1">
                            <a class="nav-link d-flex align-items-center {{ Request::segment(2) == 'feedback-option' ? 'active' : '' }} gap-2" href="{{ route('admin.feedback-option') }}"><i class="fa-solid fa-comments"></i> Feedback Option</a>
                        </li> --}}
                        
                        

                        {{-- <li class="nav-item my-1">
                            <a class="nav-link d-flex align-items-center {{ Request::segment(2) == 'feedback' ? 'active' : '' }} gap-2" href="{{ route('admin.feedback') }}"><i class="fa-solid fa-file-pen"></i>Feedback</a>
                        </li> --}}
                        
                        @if($authCheck && $permission->hasPermission('contacts-show'))
                         <li class="nav-item my-1">
                            <a class="nav-link d-flex align-items-center {{ Request::segment(2) == 'contacts' ? 'active' : '' }} gap-2" href="{{ route('admin.contacts') }}"><i class="fa-solid fa-address-card"></i> Contacts</a>
                        </li>
                        @endif
                        <li class="nav-item my-1">
                            <a class="nav-link d-flex align-items-center gap-2 {{ Request::segment(2) == 'faqs' || Request::segment(2) == 'faqs' ? '' : 'collapsed' }}" data-bs-toggle="collapse" href="#faqSubmenu" role="button" aria-expanded="{{ Request::segment(2) == 'faqs' || Request::segment(2) == 'faq-category' ? 'true' : 'false' }}" aria-controls="faqSubmenu">
                                <i class="fa-solid fa-user"></i> FAQ
                                <i class="fa-solid fa-chevron-down ms-auto"></i>
                            </a>
                            <div class="collapse {{ Request::segment(2) == 'faqs' || Request::segment(2) == 'faq-category' ? 'show' : '' }}" id="faqSubmenu">
                                <ul class="btn-toggle-nav list-unstyled fw-normal pb-1 small ms-4">
                                        @if($authCheck && $permission->hasPermission('faqcategory-show'))
                                        <li class="my-1">
                                            <a href="{{ route('admin.faq-category') }}" class="nav-link {{ Request::routeIs('admin.faq-category') ? 'active' : '' }}"></i>Category</a>
                                        </li>
                                        @endif
                                        {{-- @if($authCheck && $permission->hasPermission('faqoption-show')) --}}
                                            <li class="my-1">
                                                <a href="{{ route('admin.faqs.index') }}" class="nav-link {{ Request::routeIs('admin.faqs.index') ? 'active' : '' }}">FAQ Listing</a>
                                            </li>
                                        {{-- @endif --}}
                                </ul>
                            </div>
                        </li>  

                        {{-- <li class="nav-item my-1">
                            <a class="nav-link d-flex align-items-center {{ Request::segment(2) == 'faqs' ? 'active' : '' }} gap-2" href="{{ route('admin.faqs.index') }}"><i class="fa-solid fa-message"></i> FAQ</a>
                        </li> --}}
                        


                        {{-- <li class="nav-item my-1">
                            <a class="nav-link d-flex align-items-center {{ Request::segment(2) == 'faq-category' ? 'active' : '' }} gap-2" href="{{ route('admin.faq-category') }}"><i class="fa-solid fa-comment"></i> FAQ Category</a>
                        </li> --}}
                        

                        {{-- @if($authCheck && $permission->hasPermission('subject-show')) --}}
                        <li class="nav-item my-1">
                            <a class="nav-link d-flex align-items-center {{ Request::segment(2) == 'subjects' ? 'active' : '' }} gap-2" href="{{ route('admin.subjects') }}"><i class="fa-solid fa-user-pen"></i> Subjects</a>
                        </li>
                        {{-- @endif --}}


                         <li class="nav-item my-1">
                            <a class="nav-link d-flex align-items-center {{ Request::segment(2) == 'sample-questions' ? 'active' : '' }} gap-2" href="{{ route('admin.sample-questions') }}"><i class="fa-solid fa-file-pen"></i> Sample Questions</a>
                        </li>
                        
                       

                        {{-- <li class="nav-item my-1">
                            <a class="nav-link d-flex align-items-center {{ Request::segment(2) == 'revenue' ? 'active' : '' }} gap-2" href="{{ route('admin.revenue.index') }}"><i class="fa-solid fa-money-bill-trend-up"></i> Revenue Management</a>
                        </li>

                         <li class="nav-item my-1">
                            <a class="nav-link d-flex align-items-center {{ Request::segment(2) == 'billing' ? 'active' : '' }} gap-2" href="{{ route('admin.billing') }}"><i class="fa-solid fa-crown"></i>Billing & Subscription</a>
                        </li> --}}
                        
                        {{-- <li class="nav-item my-1">
                            <form method="POST" action="{{ route('admin.logout') }}">
                                @csrf
                                <a class="nav-link d-flex align-items-center  gap-2" href="{{ route('admin.logout') }}" onclick="event.preventDefault(); this.closest('form').submit();">
                                    <i class="fa-solid fa-power-off"></i> Logout
                                </a>
                            </form>
                        </li> --}}
                        
                        
                        {{-- <li class="nav-item my-1">
                            <a class="nav-link d-flex align-items-center gap-2" href="#" data-bs-toggle="collapse" data-bs-target="#demo"><i class="fa-solid fa-users"></i> User Management</a>
                            <div id="demo" class="collapse">
                                <ul class="navbar-nav w-100 px-2 mx-1">
                                    <li class="nav-item my-1">
                                        <a class="nav-link d-flex align-items-center gap-2" href="user.html">User</a>
                                    </li>
                                    <li class="nav-item my-1">
                                        <a class="nav-link d-flex align-items-center gap-2" href="role.html">Role & Permissions</a>
                                    </li>
                                </ul>
                            </div>
                        </li>
                        <li class="nav-item my-1">
                            <a class="nav-link d-flex align-items-center gap-2" href="#"><i class="fa-solid fa-gear"></i> Settings</a>
                        </li> --}}
                    </ul>
                </div>
            </nav>
            {{-- <div class="lights lights-fix mt-5 py-5 px-4">
                <form action="#" class="p-3 light-form d-flex justify-content-between align-items-center">
                    <label class="form-check-label text-white" for="mySwitch"><img src="img/Vector.png" class="me-2"> Light Mode</label>
                    <div class="form-check form-switch p-0 mb-0">
                      <input class="form-check-input mt-0" type="checkbox" id="mySwitch" name="darkmode" value="yes" checked>
                    </div>
                </form>
            </div> --}}
        </div>
    </div>
    <script>
        function w3_open() {
          document.getElementById("mySidebar").style.left = "0px";
        }
        
        function w3_close() {
          document.getElementById("mySidebar").style.left    = "-300px";
        }
    </script>

