<div class="header-top-area">
    <div class="container custom-container">
      <div class="row custom-row">
        <div class="col-md-6 custom-padding">
          <div class="date-area">
            <ul class="current-date">
              <li><i class="fa fa-map-marker" aria-hidden="true"></i> <?php echo e(__('Dhaka')); ?></li>
             <span id ="Clock"></span> | <span id="Date"></span> <?php echo e(__('Bengali')); ?>

             
             
                      <?php
    $activeLangId = 1; // ডিফল্ট ইংরেজি
    if (Session::has('language')) {
        $activeLangId = Session::get('language');
    } else {
        $defaultLang = \Illuminate\Support\Facades\DB::table('languages')->where('is_default', 1)->first();
        if ($defaultLang) {
            $activeLangId = $defaultLang->id;
        }
    }
?>

<script>
    document.addEventListener("DOMContentLoaded", function() {
        var currentLangId = "<?php echo e($activeLangId); ?>";
        var isBangla = (currentLangId == 2); // আইডি ২ হলে বাংলা

        setInterval(displayTime, 1000);
        displayTime(); 

        function displayTime() {
            var date = new Date();
            var hours = date.getHours();
            var minutes = date.getMinutes();
            var seconds = date.getSeconds();
            var day = date.getDay();
            var dayMonth = date.getDate();
            var month = date.getMonth();
            var year = date.getFullYear();
            var session = "AM";

            // ১২ ঘণ্টার ফরম্যাট
            if(hours == 0){ hours = 12; }
            if(hours > 12){ hours = hours - 12; session = "PM"; }

            // দুই ডিজিট (যেমন: ০৯)
            hours = (hours < 10) ? "0" + hours : hours;
            minutes = (minutes < 10) ? "0" + minutes : minutes;
            seconds = (seconds < 10) ? "0" + seconds : seconds;

            var timeString = "";
            var dateString = "";

            if (isBangla) {
                // --- বাংলা কনভার্টার ---
                var toBn = n => n.toString().replace(/\d/g, d => "০১২৩৪৫৬৭৮৯"[d]);
                var days = ["রবিবার", "সোমবার", "মঙ্গলবার", "বুধবার", "বৃহস্পতিবার", "শুক্রবার", "শনিবার"];
                var months = ["জানুয়ারি", "ফেব্রুয়ারি", "মার্চ", "এপ্রিল", "মে", "জুন", "জুলাই", "আগস্ট", "সেপ্টেম্বর", "অক্টোবর", "নভেম্বর", "ডিসেম্বর"];
                var bnSession = session === "PM" ? "পিএম" : "এএম";

                // সময়: ০১:১৭:২২ এএম
                timeString = toBn(hours) + ":" + toBn(minutes) + ":" + toBn(seconds) + " " + bnSession;
                
                // তারিখ: ১৪ পৌষ ১৪৩২ (সরাসরি কনভার্ট করা কঠিন, তাই আমরা ইংরেজি তারিখ বাংলায় দেখাব)
                // অথবা: রবিবার, ২৯ ডিসেম্বর ২০২৫
                dateString = days[day] + ", " + toBn(dayMonth) + " " + months[month] + " " + toBn(year);

            } else {
                // --- ইংরেজি ---
                var days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
                var months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
                
                // Time: 01:17:22 AM
                timeString = hours + ":" + minutes + ":" + seconds + " " + session;
                
                // Date: Sunday, 29 December 2025
                dateString = days[day] + ", " + dayMonth + " " + months[month] + " " + year;
            }

            // HTML-এ ভ্যালু বসানো
            var clockEl = document.getElementById("Clock");
            var dateEl = document.getElementById("Date");

            if(clockEl) clockEl.innerText = timeString;
            if(dateEl) dateEl.innerText = dateString;
        }
    });
</script>                            
            </ul><!--/.date-area-->
          </div><!--/.date-area-->
        </div><!--/.col-md-5-->
        <div class="col-md-6 custom-padding">
          <div class="social-icon-wrapper float-right">
            <!-- <div class="top-other-link">
              <ul class="other-link">
                <li><a href="#"><i class="fa fa-newspaper-o" aria-hidden="true"></i> English </a></li>
              </ul>
            </div> -->
            <div class="top_socail_icon_area">
               <ul class="list-inline">
                 
				 
				 <?php $__currentLoopData = $social_links->sortBy('id'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $social_link): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> 
				 <li><a target="_blank" href="<?php echo e($social_link->link); ?>" class="<?php echo e($social_link->name); ?>" target="_blank">
                   <span class="cube">
                     <span class="cube-top"><i class="<?php echo e($social_link->icon); ?>"></i></span>
                     <span class="cube-front"><i class="<?php echo e($social_link->icon); ?>"></i></span>
                   </span>
                 </a></li>
                 <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
				 
				 				<?php if(Auth::guard('admin')->user() && Auth::guard('admin')->user()->role_id != 1): ?>
				<?php else: ?>
				 <li><a target="_blank" href="<?php echo e(route('front.LogReg')); ?>" class="youtube" target="_blank">
                   <span class="cube">
                     <span class="cube-top"><i class="fa fa-user-circle"></i></span>
                     <span class="cube-front"><i class="fa fa-user-circle"></i></span>
                   </span>
                 </a></li>
				 
				 
									<?php endif; ?>
									<?php if(Auth::guard('admin')->user() && Auth::guard('admin')->user()->role_id != 1): ?>
									     <?php
											 $data = Auth::guard('admin')->user();
										 ?>	
				 <li><a target="_blank" href="<?php echo e(route('admin.dashboard')); ?>" class="youtube" target="_blank">
                   <span class="cube">
                     <span class="cube-top"><i class="fa fa-dashboard"></i></span>
                     <span class="cube-front"><i class="fa fa-dashboard"></i></span>
                   </span>
                 </a></li>
				 <?php endif; ?>	
				 
				 
               </ul>
             </div><!--/.top_socail_icon_area-->
          </div><!--/.social-icon-wrapper-->
        </div><!--/.col-md-7-->
      </div><!--/.row-->
    </div><!--/.container-->
  </div><!--/.header-top-area-->
  <div class="logo-area">
    <div class="container custom-container">
      <div class="row custom-row">
        <div class="col-md-4 custom-padding">
		<?php
		Session::has('language') ? $lid=Session::get('language') : $lid = (DB::table('languages')->where('is_default','=',1)->first()->id)
		?>
							
		<?php
		$header_footer_logo = d_logo($lid);
		?>
          <div class="main-logo">
            <a href="<?php echo e(route('frontend.index')); ?>"><img class="img-fluid" src="<?php echo e(asset('assets/images/logo/'.$gs->logo)); ?>" alt="<?php echo e($gs->title); ?>"></a>
          </div><!--/.main-logo-->
        </div><!--/.col-md-3-->
        <div class="col-md-8 custom-padding">
          <div class="header-baner float-right">
<?php echo $gs->horizontal_adds1; ?>

          </div>
        </div><!--/.col-md-9-->
      </div><!--/.row-->
    </div><!--/.container-->
  </div><!--/.logo-area-->
</header>
<div class="top-nav-main">
<nav class="navbar navbar-expand-lg top-nav-sports">
    <div class="container navbar-container custom-container">
      <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
        <i class="fa fa-bars iconbar"></i>
      </button>
      <div class="collapse navbar-collapse" id="navbarSupportedContent">
        <ul class="navbar-nav">
		
		
		
<?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
    
    <?php if($loop->first): ?>
        <li class="nav-item d-none d-lg-block" id="home">
            <a class="nav-link" href="<?php echo e(route('frontend.index')); ?>">
                <i class="fa fa-home"></i> <?php echo e($category->title); ?>

            </a>
        </li>
    <?php endif; ?>

    
    <?php if($category->child()->count() > 0): ?>
        <li class="nav-item dropdown position-relative">
            <a class="nav-link dropdown-toggle"
               href="<?php echo e(route('frontend.category', $category->slug)); ?>"
               id="navbarDropdown<?php echo e($category->id); ?>"
               role="button"
               data-bs-toggle="dropdown"
               aria-expanded="false">
                <?php echo e($category->title); ?>

                <i class="fa fa-angle-down ms-1"></i>
            </a>

            <ul class="dropdown-menu" aria-labelledby="navbarDropdown<?php echo e($category->id); ?>">
                <?php $__currentLoopData = $category->child; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $child): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <li>
                        <a href="<?php echo e(route('frontend.postBySubcategory.details', [$category->slug, $child->slug])); ?>"
                           class="dropdown-item">
                           <?php echo e($child->title); ?>

                        </a>
                    </li>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </ul>
        </li>

    
    <?php else: ?>
        <?php if(! $loop->first): ?>
            <li class="nav-item" id="menu-item-<?php echo e($category->id); ?>">
                <a class="nav-link" href="<?php echo e(route('frontend.category', $category->slug)); ?>">
                    <?php echo e($category->title); ?>

                </a>
            </li>
        <?php endif; ?>
    <?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

<style>
/* Bootstrap default caret hide, কারণ আমরা নিজে icon দিচ্ছি */
.navbar-nav .dropdown-toggle::after {
  display: none !important;
}

/* 🔧 Dropdown পজিশন ঠিক করা */
.navbar-nav .dropdown-menu {
  background-color: #fff !important;
  border: 1px solid #ddd !important;
  border-top: 3px solid #d32f2f;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
  padding: 0;
  margin-top: 0 !important; /* dropdown ঠিক নিচে থাকবে */
  top: 100% !important;
  left: 0;
  min-width: 180px;
  display: none; /* hover ছাড়া লুকানো থাকবে */
}

/* 🔹 Hover করলে dropdown খুলবে */
.navbar-nav .nav-item.dropdown:hover > .dropdown-menu {
  display: block;
}

/* 🔹 সাবমেনু আইটেম */
.navbar-nav .dropdown-menu .dropdown-item {
  color: #000 !important;
  padding: 8px 15px;
  font-size: 15px;
  border-bottom: 1px solid #eee;
  transition: all 0.2s ease-in-out;
}

/* Hover effect */
.navbar-nav .dropdown-menu .dropdown-item:hover {
  background-color: #f5f5f5 !important;
  color: #d32f2f !important;
}

/* caret icon alignment fix */
.navbar-nav .dropdown-toggle .fa-angle-down {
  font-size: 12px;
  margin-left: 3px;
  vertical-align: middle;
}

/* overflow সমস্যা যেন না হয় */
.navbar,
.nav-item {
  overflow: visible !important;
  z-index: 9999;
}

/* nav link hover effect */
.navbar-nav .nav-link {
  color: #fff;
  padding: 10px 15px;
  font-weight: 500;
  transition: all 0.2s;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  background-color: #d32f2f;
  color: #fff;
}

</style>







<li class="nav-item dropdown position-relative">
    <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownLang" role="button" 
       data-bs-toggle="dropdown" aria-expanded="false">
        <?php echo e(__('Language')); ?>

        <i class="fa fa-angle-down ms-1"></i>
    </a>

    <?php
        use Illuminate\Support\Facades\Session;
        use Illuminate\Support\Facades\DB;

        // 🔹 সেশন থেকে ভাষা আইডি নেওয়া
        $activeLang = Session::get('language');

        // 🔹 যদি সেশন না থাকে, ডিফল্ট ভাষা সেট করা
        if (!$activeLang) {
            $defaultLang = DB::table('languages')->where('is_default', 1)->first();
            $activeLang = $defaultLang ? $defaultLang->id : null;
        }

        // 🔹 সব ভাষা লোড করা
        $languages = DB::table('languages')->orderBy('id', 'asc')->get();
    ?>

    <ul class="dropdown-menu" aria-labelledby="navbarDropdownLang">
        <?php $__currentLoopData = $languages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $language): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <li>
                <a href="<?php echo e(route('front.language.change', $language->id)); ?>"
                   class="dropdown-item <?php echo e($activeLang == $language->id ? 'active' : ''); ?>">
                    <?php echo e($language->language); ?>

                </a>
            </li>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </ul>
</li>















        </ul>
      </div><!--/.navbarSupportedContent-->
      <!-- Start Atribute Navigation -->
        <div class="attr-nav">
          <ul>
            <li class="search"><a href="#"><i class="fa fa-search"></i></a></li>
          </ul>
        </div><!--/.attr-nav-->
      <!-- End Atribute Navigation -->
    </div><!-- container -->
  </nav>
  <div class="top-search">
      <div class="container custom-container">
        <div class="col-lg-3 col-md-4 col-12 top-search-secton">
          <form action="<?php echo e(route('front.news_search')); ?>" method="get" class="search-form">
            <div class="input-group">
              <label for="search" class="sr-only">Search</label>
              <input type="hidden"/>
              <input type="text" class="form-control" name="search" id="q" placeholder="search">
              <button class="input-group-addon" type="submit"><i class="fa fa-search"></i></button>
              <span class="input-group-addon close-search"><i class="fa fa-times"></i></span>
            </div><!--/.input-group-->
          </form>
        </div><!--/.col-lg-2 col-md-4 -->
      </div><!--/.container-->
    </div><!--/.top-search-->
</div><!--/.top-nav-main-->
  <div class="container top-lead-news custom-container">
</div><?php /**PATH C:\xampp\htdocs\project\resources\views/partial/front/header.blade.php ENDPATH**/ ?>