@php
    $pages = App\Models\Page::get();
    $query = App\Models\Category::where('status', 1)->latest();
@endphp
@extends($activeTemplate . 'layouts.frontend')
@section('content')
    @if ($general->theme == 2)
        <div class="header" id="header">
            <div class="container ">
                <nav class="navbar navbar-expand-lg">
                    <div class="header-menu-wrapper align-items-center d-flex">
                        <div class="logo-wrapper">
                            <a href="{{ route('home') }}" class="normal-logo" id="normal-logo">
                                <img src="{{ getImage('assets/images/general/logo1.png') }}" alt="...">
                            </a>
                        </div>
                    </div>
                    <form id="myForm" class="form-area d-flex" action="{{ route('search.by.type') }}" method="GET">
                        <div class="d-flex align-items-center">
                            <i class="fas fa-image ps-2"></i>
                            <p class="mx-2">@lang('Image')</p>
                        </div>
                        <div class="search">
                            <input id="searchInput" type="text" name="search" class="form--control"
                                value="{{ old('search') }}" placeholder="Search for photo">
                            <i class="fas fa-search"></i>
                        </div>
                    </form>
                    <button class="navbar-toggler header-button" type="button" data-bs-toggle="collapse"
                        data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent"
                        aria-expanded="false" aria-label="Toggle navigation">
                        <span id="hiddenNav"><i class="las la-bars"></i></span>
                    </button>

                    <div class="collapse navbar-collapse" id="navbarSupportedContent">
                        <ul class="navbar-nav nav-menu me-auto ps-lg-4 ps-0">
                            @foreach ($pages as $page)
                                @if ($page->slug == 'explore')
                                    <li class="nav-item">
                                        <a class="nav-link {{ Request::url() == url('/') . '/' . $page->slug ? 'active' : '' }}"
                                            href="{{ route('pages', $page->slug) }}">{{ __($page->name) }}</a>
                                    </li>
                                @endif
                            @endforeach
                            @guest
                                @php
                                    $categories = $query->take(3)->get();
                                @endphp
                                @foreach ($categories as $item)
                                    <li class="nav-item">
                                        <a class="nav-link  {{ Request::url() == route('files.category', $item->id) }} ? 'active' : '' }}"
                                            href="{{ route('files.category', $item->id) }}">{{ __($item->name) }}</a>
                                    </li>
                                @endforeach
                            @endguest
                            @auth
                                @php
                                    $categories = $query->take(2)->get();
                                @endphp
                                @foreach ($categories as $item)
                                    <li class="nav-item">
                                        <a class="nav-link  {{ Request::url() == route('files.category', $item->id) }} ? 'active' : '' }}"
                                            href="{{ route('files.category', $item->id) }}">{{ __($item->name) }}</a>
                                    </li>
                                @endforeach
                            @endauth
                            @auth
                                <li class="nav-item">
                                    <a class="nav-link" href="{{ route('user.home') }}">@lang('Dashboard')</a>
                                </li>
                            @endauth
                        </ul>
                        <div class="d-flex lan">
                            <i class="fas fa-globe"></i>
                            <select class="form-select langSel">
                                @foreach ($language as $item)
                                    <option value="{{ $item->code }}" @if (session('lang') == $item->code) selected @endif>
                                        {{ __($item->name) }}</option>
                                @endforeach
                            </select>
                        </div>
                        <div class="login ps-lg-3 ps-0">
                            @guest
                                <a class="my-auto" href="{{ route('user.login') }}"><i
                                        class="fa-solid fa-user-large"></i>@lang('Sign In')</a>
                            @endguest

                            @auth
                                <a href="{{ route('user.logout') }}" class="">@lang('Sign Out')</a>
                            @endauth
                        </div>
                    </div>
                </nav>
            </div>
        </div>
    @endif
    <!--=======-** Terms Of Service start **-=======-->
    <section class="py-100">
        <div class="policy-shape">
            <img src="{{ getImage(getFilePath('others') . '/' . 'bg-shape.png') }}" alt="image">
        </div>
        <div class="container">
            <div class="terms">
                <div class="row">
                    <div class="privacy-wrapper">
                        <h3 class="title-two text-center">{{ __($pageTitle) }}</h3>
                        <div class="wyg">
                            @php
                                echo $policy->data_values->details;
                            @endphp
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <!--=======-** Terms Of Service End **-=======-->
@endsection

@push('style')
    <style>
        .wyg h1,
        h2,
        h3,
        h4 {
            color: #383838;
            font-size: 22px;
        }

        .wyg strong {
            color: #383838
        }

        .wyg p {
            color: #666666
        }

        .wyg ul {
            margin-left: 40px
        }

        .wyg ul li {
            list-style-type: disc;
            color: #666666
        }
    </style>
@endpush
