@if (!is_null($ad[2]))
@php echo '<div class="container text-center mb-3">'.$ad[2].'</div>'; @endphp
@endif

<!-- Footer Container -->
<div class="footer-container">

    <!-- Footer -->
    <footer class="page-footer">

        <!-- Footer Links -->
        <div class="container">

            <!-- Grid row -->
            <div class="row">

                <!-- Grid column -->
                <div class="col-md-3 mx-auto">
                    <strong>{{$settings['site_title']}}</strong><br /><br />
                    {{$settings['site_description']}}<br /><br />
                    @if ($settings['show_submission_form'] == '1')
                    <a href="{{ asset('submit-app') }}" class="submit-app">@lang('general.submit_your_app')</a>
                    @endif
                    @if (!empty($settings['facebook_page']))<a href="{{$settings['facebook_page']}}" target="_blank">{!! svg_icon('fab fa-facebook-f') !!}</a>@endif
                    @if (!empty($settings['twitter_account']))<a href="{{$settings['twitter_account']}}" target="_blank">{!! svg_icon('fab fa-twitter') !!}</a>@endif
                </div>
                <!-- /Grid column -->

                <div class="clearfix w-100 d-md-none">&nbsp;</div>

                <!-- Grid column -->
                <div class="col-md-3 col-4">
                    <a class="font-weight-bold">@lang('general.pages')</a><br /><br />
                    <ul class="list-unstyled">
                        @foreach ($pages as $page)
                        <li><a href="{{ asset($settings['page_base']) }}/{{ $page->slug }}">{{ $page->title }}</a></li>
                        @endforeach
                    </ul>
                </div>
                <!-- /Grid column -->

                <!-- Grid column -->
                <div class="col-md-3 col-4">
                    <a class="font-weight-bold">@lang('general.categories')</a><br /><br />
                    <ul class="list-unstyled">
                        @foreach ($categories as $category)
                        @if ($category->footer == '1')
                        <li><a href="{{ asset($settings['category_base']) }}/{{ $category->slug }}">{{ $category->title }}</a></li>
                        @endif
                        @endforeach
                    </ul>
                </div>
                <!-- /Grid column -->

                <!-- Grid column -->
                <div class="col-md-3 col-4">
                    <a class="font-weight-bold mt-3 mb-4">@lang('general.platforms')</a><br /><br />
                    <ul class="list-unstyled">
                        @foreach ($platforms as $platform)
                        <li><a href="{{ asset($settings['platform_base']) }}/{{ $platform->slug }}">{{ $platform->title }}</a></li>
                        @endforeach
                    </ul>
                </div>
                <!-- /Grid column -->

            </div>
            <!-- /Grid row -->

        </div>
        <!-- /Footer Links -->

        <!-- Copyright Message -->
        <div class="footer-copyright text-center py-2">© {{date('Y')}} @lang('general.copyright') -
            <a href="#"> {{$settings['site_title']}}</a>
        </div>
        <!-- /Copyright Message -->

    </footer>
    <!-- /Footer -->

</div>
<!-- /Footer Container -->

<!-- Search Box -->
<div id="SearchBox" class="overlaymenu">
    <a href="javascript:void(0)" class="closebtn" onclick="closeSearchBox()">&times;</a>
    <div class="overlay-content-search">
        <div class="container">
            <form method="post" action="{{ asset('search') }}">
                {{ csrf_field() }}
                <div class="row justify-content-center">
                    <div class="md-form mt-0">
                        <input class="form-control form-control-lg" type="text" name="term" id="term" placeholder="@lang('general.search_apps')" aria-label="@lang('general.search_apps')">
                    </div>
                    <div class="col-auto">
                        <button class="sbtn btn-lg" type="submit">@lang('general.search')</button>
                    </div>
                </div>

                @if (!empty($settings['recommended_terms']))
                @php $terms = explode(",", $settings['recommended_terms']); @endphp
                @if (count($terms) > 0)

                <div class="d-flex justify-content-center">
                    <div class="recommended-terms mt-1" id="terms">
                        <strong>@lang('general.recommended_terms')</strong>
                        @foreach ($terms as $term)
                        <a href="#">{{ $term }}</a>
                        @endforeach
                    </div>
                </div>

                @endif
                @endif

            </form>
        </div>
    </div>
</div>
<!-- /Search Box -->

@if ($settings['show_cookie_bar'] == '1')
<!-- Cookie Alert -->
<div class="alert text-center cookiealert" role="alert">
    @lang('general.cookies_note')
    <button type="button" class="btn btn-sm acceptcookies" aria-label="Close">
        @lang('general.accept_cookies')
    </button>
</div>
<!-- /Cookie Alert -->
@endif

{!!$settings['before_body_end_tag']!!}

@stack('assets_footer')

<!-- Lazy Load -->
<script src="{{ asset('js/jquery.lazy.min.js') }}"></script>

<!-- Other JS -->
<script src="{{ asset('js/scripts.js') }}?v1.5"></script>

<!-- Bootstrap -->
<script src="{{ asset('js/bootstrap.min.js') }}"></script>
