<div class="header-content-wrapper" style="height:auto;">
    <a href="#" id="top-bar-js" class="top-bar-link"></a>    
    <div class="logo" style="height: 100px;width:100px;"><!-- position: absolute;margin-top: -20px; -->
        <a href="{{ localized_route('home') }}" class="full-block-link">
            <img src="{{ config('site.config.logo') }}" width="90" height="90" alt="{{config('site.config._SiteSlogan_'.App::getLocale().'')}}-{{config('site.config._sitename')}}">
        </a>
        <div class="logo-text" style="visibility: hidden;">
            <div class="logo-title">{{config('site.config._sitename')}}</div>
            <div class="logo-sub-title">{{config('site.config._SiteSlogan_'.App::getLocale().'')}}</div>
        </div>
    </div>
    <nav id="primary-menu" class="primary-menu" style="margin: 0 auto;justify-content: space-between;"> <!--style="float: right;width: 60%"-->
        <a href='javascript:void(0)' id="menu-icon-trigger" class="menu-icon-trigger showhide" style="position:fixed;top:30px;right:27px;left:27px;">
            <span class="mob-menu--title"><!--Menu--></span>
            <span id="menu-icon-wrapper" class="menu-icon-wrapper" style="visibility: hidden">
                <svg width="1000px" height="1000px">
                    <path id="pathD" d="M 300 400 L 700 400 C 900 400 900 750 600 850 A 400 400 0 0 1 200 200 L 800 800"></path>
                    <path id="pathE" d="M 300 500 L 700 500"></path>
                    <path id="pathF" d="M 700 600 L 300 600 C 100 600 100 200 400 150 A 400 380 0 1 1 200 800 L 800 200"></path>
                </svg>
            </span>
        </a>
        <!-- menu-icon-wrapper -->
        <ul class="primary-menu-menu" style="margin-top:8px;">
            @if(isset($MainMenu))
               @foreach($MainMenu as $mainMenuList=>$menuList)
                  @foreach($menuList as $submenuList=>$submenu)
                        @if(isset($submenu['classActive']) && isset($submenu['type_name_alias']))
                            <li {!! $submenu['classActive'] !!}>
                        @endif
                        @if(isset($submenu['menuLink']))
                            @if($submenu['type_url_alias'] !== "tools")
                                @if($submenu['menuLink'] === "content.list")
                                    <a href="{{localized_route($submenu['menuLink'] , ['type' => strtolower($submenu['type_name_alias'])])}}" alt="{{$submenu['type_name_'.App::getLocale().''].'-'.$submenu['type_page_title_'.App::getLocale().'']}}">{{$submenu['type_name_'.App::getLocale().'']}}
                                    </a>
                                @else
                                    <a href="{{localized_route($submenu['menuLink'])}}" alt="{{$submenu['type_name_'.App::getLocale().''].'-'.$submenu['type_page_title_'.App::getLocale().'']}}">{{$submenu['type_name_'.App::getLocale().'']}}</a>
                                @endif
                            @else
                                @php
                                    if(App::getLocale() === "en"){
                                        $langLinkOut = "en-us";
                                    }else{
                                        $langLinkOut = "th-th";
                                    }
                                @endphp
                                <a href="{{$submenu['menuLink']}}?setlang={{$langLinkOut}}" alt="{{$submenu['type_name_'.App::getLocale().''].'-'.$submenu['type_page_title_'.App::getLocale().'']}}">{{$submenu['type_name_'.App::getLocale().'']}}</a>                            
                            @endif
                        @endif
                        @if( isset($submenu['type_url_alias']) && $submenu['type_url_alias'] === 'tools' )
                        <div class="megamenu" style="background-image: url('{{config('site.config._site_template')}}/img/mountain2.png');padding:10px 10px 10px 20px;">
                            <div class="megamenu-row">
                                @foreach($menuList[1] as $toolGroup=>$toolList)
                                    @if($toolGroup!=="type")
                                        <div class="col3">
                                            <ul style="padding-left:10px;">
                                                    <li class="megamenu-item-info">
                                                        @if(is_array($toolList))                                                                    
                                                        <h5 class="megamenu-item-info-title">{{$toolGroup}}</h5>
                                                        <p class="megamenu-item-info-text" style="color: #000000b3;font-weight: bold;">{{$toolList['description']}}</p>
                                                        @endif
                                                    </li>
                                                    @if(is_array($toolList)) 
                                                        @foreach($toolList as $toolIndex=>$toolDesc)
                                                            @if(is_integer($toolIndex))
                                                                <li>
                                                                    @if(config('site.config.isEnableSubDomainSeoToolPath') )
                                                                    <a style="color: #000000b3;" href="{{config('site.config.fr_appconfig.front-end-common.default._linkConf.seo-tools-sub-domain')}}{{$toolDesc}}?setlang={{$langLinkOut}}" target="_blank">{{$toolDesc}}<i class="seoicon-right-arrow"></i></a>
                                                                    @else
                                                                    <a style="color: #000000b3;" href="{{config('site.config._APP_SITE_SEO_TOOL_PATH')}}{{$toolDesc}}/" target="_blank">{{$toolDesc}}<i class="seoicon-right-arrow"></i></a>
                                                                    @endif
                                                                </li>
                                                            @endif
                                                        @endforeach
                                                    @endif
                                            </ul>
                                        </div>
                                    @endif
                                @endforeach
                            </div>
                        </div>
                        @endif
                    </li>
                  @endforeach
                @endforeach
            @endif


            @if(\App\Helpers\UserHelpers::isUserLoggedIn())
            <li class>
                <a href="{{ localized_route(config('site.config._MY_LOGOUT_LINK')) }}" alt="Logut SeoEzyPro">Logout</a>
            </li>            
            @endif
        </ul>
            
    </nav>

    <ul class="nav-add">
        <li class="language-switcher">
            <a href="{{ route('change.locale', ['locale' => 'en']) }}"
               class="{{ App::getLocale() == 'en' ? 'active' : '' }}">English</a>
            |
            <a href="{{ route('change.locale', ['locale' => 'th']) }}"
               class="{{ App::getLocale() == 'th' ? 'active' : '' }}">ไทย</a>
        </li>

        <style>
            .language-switcher a {
                text-decoration: none;
                color: #000;
                padding: 3px 3px;
                border: 1px solid transparent;
                border-radius: 4px;
                font-size: 10px;
                transition: all 0.3s ease;
            }
        
            .language-switcher a.active {
                font-weight: bold;
                color: #007bff;
                border-color: #007bff;
                background-color: #e7f1ff;
            }
        
            .language-switcher {
                display: inline-block;
                list-style: none;
            }
        </style>        
    
    @if (Cache::get('_WEBSERVICE') !== "auth")
        <li class="search search_main">
            <a href="#" class="js-open-search">
                <i class="seoicon-loupe"></i>
            </a>
        </li>
    @endif

    </ul>

        @if (Cache::get('_WEBSERVICE') !== "auth")
            <div class="user-menu open-overlay">
               <a href="#" class="user-menu-content  js-open-aside">
                   <span></span>
                   <span></span>
                   <span></span>
               </a>
           </div>
        @endif     
</div>