<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta content="width=device-width, initial-scale=1.0" name="viewport">
    <!-- CSRF Token -->
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <meta name="UID" content="{{ \Illuminate\Support\Facades\Auth::id() }}">
    <title>@yield('title') - {{ config('app.name', 'Corsair Portal') }}</title>
    <!-- Favicons -->

    <link href="{{ asset('frontend/images/favicon.png') }}" rel="icon">

    <script type="text/javascript">
       let APPLICATION_URL = "{{url('/')}}";
       let UID = "{{Auth::id() ?? 0}}"
       let baseURL = "{{url('/')}}/";
       let platform = "{{ config('amplivo.support_configuration.platform_name') }}";
    </script>
    <!-- Google tag (gtag.js) -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=UA-251088052-2"></script>
    <script>
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag('js', new Date());
    gtag('config', 'UA-251088052-2');
    </script>
    <link rel="stylesheet" href="{{ asset('frontend/styles/css/icons-1.13.1/font/bootstrap-icons.css') }}">
    <link rel="stylesheet" href="{{ asset('frontend/styles/css/themes/lite-purple.min.css') }}">
    <link rel="stylesheet" href="{{ asset('frontend/styles/vendor/perfect-scrollbar.css') }}">
    <link rel="stylesheet" href="{{ asset('frontend/styles/css/landing-style.css') }}">
    <link rel="stylesheet" href="{{ asset('frontend/fonts/fontawesome-free-5.10.1-web/css/all.min.css') }}" />
    <link rel="stylesheet" href="{{ asset('frontend/styles/css/snackbar/snackbar.min.css') }}" />
    <link rel="stylesheet" href="{{ asset('frontend/styles/vendor/select2/css/select2.css') }}">
    <link rel="stylesheet" href="{{ asset('frontend/styles/vendor/select2/css/select2-bootstrap4.css') }}">
    <link rel="stylesheet" href="{{ asset('frontend/styles/css/toastr.css') }}">
    <link rel="stylesheet" href="{{ asset('frontend/styles/vendor/select2/css/custom.css') }}">

    <style>
        .layout-horizontal-bar .main-content-wrap{
            margin-top: 80px !important;
        }
        .main-content-wrap.sidebar-full-z-index{
            width: 100% !important;
            z-index: 0 !important;
        }
    </style>
    @stack('styles')

    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet">

    <script src="https://cdn.jsdelivr.net/npm/flowbite@2.4.1/dist/flowbite.min.js"></script>
    <link href="https://cdn.jsdelivr.net/npm/flowbite@2.4.1/dist/flowbite.min.css" rel="stylesheet" />
</head>

<body class="dashboard_page p-0">
    <!-- Pre Loader Strat  -->
    <div class='loadscreen' id="preloader">
        <div class="loader spinner-bubble spinner-bubble-primary"></div>
    </div>
    <!-- Pre Loader end  -->
    <!-- ============ Large SIdebar Layout start ============= -->

    <div class="app-admin-wrap layout-horizontal-bar clearfix">
        @include('layouts.landing_page.header')
        <!-- ============ end of header menu ============= -->

        <!-- ============ end of left sidebar ============= -->
        <!-- ============ Body content start ============= -->
        <div class="main-content-wrap d-flex flex-column flex-grow-1 p-0">

            <div class="main-content">
            @yield('content')
            </div>

        </div>
        <!-- ============ Body content End ============= -->
    </div>

    <!-- Footer Start -->
        @include('layouts.landing_page.footer')
    <!-- fotter end -->
    <!--=============== End app-admin-wrap ================-->


    @include('component.cookie')
    @include('component.get-language-message')

    {{-- common js --}}
    <script src="{{ asset('frontend/js/js-cookie/js.cookie.min.js') }}"></script>
    <script src="{{ asset('frontend/js/common-bundle-script.js') }}"></script>
    <script src="{{ asset('frontend/js/script.js') }}"></script>
    <script src="{{ asset('frontend/js/snackbar/snackbar.min.js') }}"></script>
    <script src="{{ asset('frontend/js/select2/select2.min.js') }}"></script>
    <script src="{{ asset('frontend/js/crypto-js/crypto-js.min.js') }}"></script>
    <script src="{{ asset('frontend/js/page-js/cryptojs-laravel-encryption.js') }}"></script>
    <script src="{{ asset('frontend/js/portal-global.js') }}"></script>
    <script src="{{ asset('frontend/js/toastr.min.js') }}"></script>
    <script src="{{ asset('frontend/js/custom.js') }}"></script>

    @if (\Illuminate\Support\Facades\Session::get('flash_notification'))
        <?php
        $flash_notification = session('flash_notification')[0]->message ?? session('flash_notification');
        $flash_notification_status = \Illuminate\Support\Facades\Session::get('flash_notification')[0]->level ?? 'success';
        \Illuminate\Support\Facades\Session::forget('flash_notification');
        ?>
        <script>
            swalMsg("{!! $flash_notification !!}",'{{ $flash_notification_status }}');
        </script>
    @endif

    @stack('scripts')

    <script>
        window.Icons = @json(getIconClassMap());

        function renderIconTag(name, extraClass = 'me-1') {
            const iconClass = window.Icons?.[name];
            if (!iconClass) return '';
            return `<i class="${extraClass} ${iconClass}"></i>`;
        }
    </script>

</body>
</html>
