<!DOCTYPE html>
<html lang="<?php echo e(str_replace('_', '-', app()->getLocale())); ?>" class="scroll-smooth">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <?php
        $siteSettings = \App\Models\Setting::pluck('setting_value', 'setting_key');
        $siteName = $siteSettings->get('site_name', 'Bikash Barta');
        $seoDesc = $siteSettings->get(
            'seo_description',
            'Odisha\'s leading news portal — local, national, and international news.',
        );
        $gaId = $siteSettings->get('google_analytics_id', '');
        $socialFb = $siteSettings->get('social_facebook', '#');
        $socialYt = $siteSettings->get('social_youtube', '#');
        $socialIg = $siteSettings->get('social_instagram', '#');
    ?>
    <title><?php echo e($pageTitle ?? $siteName . ' | News Portal'); ?></title>
    <meta name="description" content="<?php echo e($metaDescription ?? $seoDesc); ?>">

    <!-- Fonts: Anek Odia & Roboto -->
    <link rel="stylesheet" href="<?php echo e(asset('css/frontend.css')); ?>">
    <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=Anek+Odia:wght@100..800&family=Inter:wght@300;400;500;600;700;800&family=Roboto:wght@300;400;500;700&display=swap"
        rel="stylesheet">

    <!-- Font Awesome for icons -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">

    <script src="https://cdn.tailwindcss.com"></script>
    <script src="<?php echo e(asset('js/tailwind-config.js')); ?>"></script>

    <!-- Open Graph / Social Sharing Meta -->
    <meta property="og:type" content="website">
    <meta property="og:site_name" content="<?php echo e($siteName ?? 'Bikash Barta'); ?>">
    <meta property="og:title" content="<?php echo e($pageTitle ?? $siteName . ' | News Portal'); ?>">
    <meta property="og:description" content="<?php echo e($metaDescription ?? $seoDesc); ?>">
    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(isset($ogImage)): ?>
        <meta property="og:image" content="<?php echo e($ogImage); ?>">
    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
    <?php echo $__env->yieldPushContent('meta'); ?>
    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($gaId ?? ''): ?>
        <script async src="https://www.googletagmanager.com/gtag/js?id=<?php echo e($gaId); ?>"></script>
        <script>
            window.dataLayer = window.dataLayer || [];

            function gtag() {
                dataLayer.push(arguments);
            }
            gtag('js', new Date());
            gtag('config', '<?php echo e($gaId); ?>');
        </script>
    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
    <?php echo \Livewire\Mechanisms\FrontendAssets\FrontendAssets::styles(); ?>

</head>

<body class="antialiased selection:bg-brand-blue/10 selection:text-brand-blue">

    <!-- Top Bar -->
    <div class="bg-brand-dark text-slate-400 py-2 px-4 md:px-6 border-b border-slate-800">
        <div
            class="max-w-7xl mx-auto flex justify-between items-center text-[10px] md:text-xs font-medium tracking-tight">
            <div class="flex items-center gap-6">
                <span class="hidden md:flex items-center gap-2"><i class="fa-regular fa-calendar text-brand-blue"></i>
                    <?php echo e(now()->format('l, d F Y')); ?></span>
                <div class="flex gap-4 items-center border-l border-slate-700 pl-6 h-4">
                    <a href="<?php echo e($socialFb ?: '#'); ?>" target="<?php echo e($socialFb ? '_blank' : '_self'); ?>" rel="noopener"
                        class="hover:text-white transition-colors"><i class="fa-brands fa-facebook-f"></i></a>
                    <a href="#" class="hover:text-white transition-colors"><i
                            class="fa-brands fa-x-twitter"></i></a>
                    <a href="<?php echo e($socialYt ?: '#'); ?>" target="<?php echo e($socialYt ? '_blank' : '_self'); ?>" rel="noopener"
                        class="hover:text-white transition-colors"><i class="fa-brands fa-youtube"></i></a>
                    <a href="<?php echo e($socialIg ?: '#'); ?>" target="<?php echo e($socialIg ? '_blank' : '_self'); ?>" rel="noopener"
                        class="hover:text-white transition-colors"><i class="fa-brands fa-instagram"></i></a>
                </div>
            </div>
            <div class="flex items-center gap-5 uppercase tracking-wider font-bold">
                <a href="<?php echo e(route('about')); ?>" class="hover:text-white transition-colors"><?php echo e(__('nav.about')); ?></a>
                <a href="<?php echo e(route('contact')); ?>" class="hover:text-white transition-colors"><?php echo e(__('nav.contact')); ?></a>
                
                <a href="<?php echo e(route('career')); ?>"
                    class="bg-brand-red text-white px-3 py-1 rounded-sm hover:scale-105 transition-all duration-300 animate-pulse shadow-lg shadow-brand-red/50 flex items-center gap-2">
                    <i class="fa-solid fa-user-pen text-[10px]"></i>
                    Reporter Apply
                </a>
                <div class="flex items-center border border-slate-700 rounded-sm overflow-hidden hidden">
                    <a href="<?php echo e(route('lang.switch', 'en')); ?>"
                       class="px-2 py-0.5 text-[10px] font-black tracking-wider transition-colors <?php echo e(app()->getLocale() === 'en' ? 'bg-brand-blue text-white' : 'hover:text-white'); ?>">EN</a>
                    <a href="<?php echo e(route('lang.switch', 'or')); ?>"
                       class="px-2 py-0.5 text-[10px] font-black tracking-wider transition-colors border-l border-slate-700 <?php echo e(app()->getLocale() === 'or' ? 'bg-brand-blue text-white' : 'hover:text-white'); ?>">ଓଡ଼ିଆ</a>
                </div>
            </div>
        </div>
    </div>

    <!-- Logo Section -->
    <header class="py-6 md:py-8 px-4 md:px-6 bg-white">
        <div class="max-w-7xl mx-auto flex items-center justify-between gap-8">
            <div class="hidden lg:flex flex-1 items-center gap-4 group cursor-default">
                <div
                    class="p-3 bg-brand-light rounded-md border border-slate-100 group-hover:border-slate-200 transition-colors">
                    <i id="weather-icon" class="fa-solid fa-cloud-sun-rain text-3xl text-brand-blue"></i>
                </div>
                <div>
                    <div class="flex items-center gap-2">
                        <span id="weather-temp" class="text-xl font-bold text-slate-800">--°C</span>
                        <button id="weather-refresh" title="Refresh weather"
                            class="text-slate-300 hover:text-brand-blue transition-colors text-xs leading-none mt-0.5">
                            <i class="fa-solid fa-rotate-right"></i>
                        </button>
                    </div>
                    <p id="weather-city" class="text-[10px] text-slate-400 font-bold uppercase tracking-wider">
                        Loading...</p>
                </div>
            </div>

            <div class="flex-shrink-0 text-center">
                <a href="<?php echo e(route('home')); ?>" class="inline-block">
                    <div class="relative">
                        <img src="<?php echo e(asset('images/logo.png')); ?>" alt="Bikash Barta Logo"
                            class="h-12 md:h-16 w-auto mx-auto">
                    </div>
                </a>
            </div>

            <div class="flex-1 flex justify-end items-center gap-3">
                <form action="<?php echo e(route('search')); ?>" method="GET" class="relative hidden md:block">
                    <input type="text" name="q" value="<?php echo e(request('q')); ?>" placeholder="<?php echo e(__('nav.search_placeholder')); ?>"
                        class="w-48 lg:w-64 bg-slate-50 border border-slate-200 rounded-md px-4 py-2 pr-10 text-sm focus:ring-1 focus:ring-brand-blue focus:bg-white transition-all outline-none text-slate-600 placeholder:text-slate-400">
                    <button type="submit"
                        class="absolute right-3 top-1/2 -translate-y-1/2 text-slate-300 hover:text-brand-blue transition-colors">
                        <i class="fa-solid fa-magnifying-glass"></i>
                    </button>
                </form>
                <button id="mobile-menu-btn"
                    class="md:hidden w-10 h-10 flex items-center justify-center rounded-md bg-slate-100 text-slate-900 border border-slate-200"
                    aria-label="Open menu" aria-expanded="false">
                    <i class="fa-solid fa-bars-staggered text-lg"></i>
                </button>
            </div>
        </div>
    </header>

    <!-- Mobile Navigation Drawer -->
    <div id="mobile-nav" class="hidden fixed inset-0 z-[100] md:hidden">
        <div id="mobile-nav-backdrop" class="absolute inset-0 bg-black/50"></div>
        <div class="absolute top-0 left-0 h-full w-72 bg-white shadow-xl flex flex-col">
            <div class="flex items-center justify-between px-5 py-4 border-b border-slate-200">
                <span class="font-black text-slate-900 text-lg tracking-tight uppercase">BIKASH <span
                        class="text-brand-blue">BARTA</span></span>
                <button id="mobile-menu-close"
                    class="w-9 h-9 flex items-center justify-center rounded-md bg-slate-100 text-slate-600"
                    aria-label="Close menu">
                    <i class="fa-solid fa-xmark text-base"></i>
                </button>
            </div>
            <nav class="flex-1 overflow-y-auto py-4">
                <ul class="text-sm font-bold text-slate-700 font-odia">
                    <li><a href="<?php echo e(route('home')); ?>"
                            class="flex items-center gap-3 px-5 py-3 hover:bg-slate-50 hover:text-brand-blue transition-colors border-b border-slate-100"><i
                                class="fa-solid fa-house text-brand-blue w-4"></i> <?php echo e(__('nav.home')); ?></a></li>
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::openLoop(); ?><?php endif; ?><?php $__currentLoopData = App\Models\Category::all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::startLoop($loop->index); ?><?php endif; ?>
                        <li><a href="<?php echo e(route('category', $category->slug)); ?>"
                                class="flex items-center gap-3 px-5 py-3 hover:bg-slate-50 hover:text-brand-blue transition-colors border-b border-slate-100"><i
                                    class="fa-solid fa-chevron-right text-slate-300 w-4 text-xs"></i>
                                <?php echo e($category->name); ?></a></li>
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::endLoop(); ?><?php endif; ?><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::closeLoop(); ?><?php endif; ?>
                    <li><a href="<?php echo e(route('gallery')); ?>"
                            class="flex items-center gap-3 px-5 py-3 hover:bg-slate-50 hover:text-brand-blue transition-colors border-b border-slate-100"><i
                                class="fa-solid fa-chevron-right text-slate-300 w-4 text-xs"></i> <?php echo e(__('nav.gallery')); ?></a></li>
                </ul>
            </nav>
        </div>
    </div>

    <!-- Main Navigation -->
    <nav class="sticky top-0 z-50 bg-white border-y border-slate-200 px-4 md:px-6 shadow-sm">
        <div class="max-w-7xl mx-auto">
            <ul
                class="flex items-center overflow-x-auto no-scrollbar whitespace-nowrap text-[13px] md:text-[15px] font-bold text-slate-700">
                <li><a href="<?php echo e(route('home')); ?>"
                        class="inline-flex items-center justify-center w-12 h-12 text-brand-blue border-r border-slate-200 hover:bg-slate-50 transition-colors"><i
                            class="fa-solid fa-house"></i></a></li>
                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::openLoop(); ?><?php endif; ?><?php $__currentLoopData = App\Models\Category::all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::startLoop($loop->index); ?><?php endif; ?>
                    <li><a href="<?php echo e(route('category', $category->slug)); ?>"
                            class="px-5 py-3 inline-block hover:text-brand-blue transition-colors font-odia border-r border-slate-200"><?php echo e($category->name); ?></a>
                    </li>
                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::endLoop(); ?><?php endif; ?><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::closeLoop(); ?><?php endif; ?>
                <li><a href="<?php echo e(route('gallery')); ?>"
                        class="px-5 py-3 inline-block hover:text-brand-blue transition-colors font-odia border-r border-slate-200"><?php echo e(__('nav.gallery')); ?></a>
                </li>
                <li class="ml-auto hidden lg:flex items-center gap-3">
                    <span class="flex h-2 w-2 relative">
                        <span
                            class="animate-ping absolute inline-flex h-full w-full rounded-full bg-brand-red opacity-75"></span>
                        <span class="relative inline-flex rounded-full h-2 w-2 bg-brand-red"></span>
                    </span>
                    <a href="#" class="text-brand-red uppercase tracking-wider text-[11px] font-black"><?php echo e(__('nav.live_updates')); ?></a>
                </li>
            </ul>
        </div>
    </nav>

    <!-- Breaking News Ticker -->
    <?php
        $breakingNews = App\Models\BreakingNews::where('is_active', true)->latest()->take(10)->get();
    ?>
    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($breakingNews->count() > 0): ?>
        <div class="bg-slate-50 border-b border-slate-200 px-4 md:px-6 relative z-40">
            <div class="max-w-7xl mx-auto flex items-center h-10">
                <div
                    class="bg-brand-red text-white px-3 py-1 text-[10px] font-black uppercase tracking-wider rounded-sm flex items-center gap-2 mr-4 shrink-0">
                    <i class="fa-solid fa-bolt-lightning text-[8px]"></i>
                    <?php echo e(__('nav.breaking')); ?>

                </div>
                <div class="flex-1 overflow-hidden">
                    <div class="ticker-wrapper font-odia font-bold text-slate-700 text-[13px]">
                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::openLoop(); ?><?php endif; ?><?php $__currentLoopData = $breakingNews; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $news): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::startLoop($loop->index); ?><?php endif; ?>
                            <span class="px-6 flex items-center gap-3 border-r border-slate-200 whitespace-nowrap">
                                <?php echo e($news->content); ?>

                                <span class="text-[9px] text-slate-400"><?php echo e($news->created_at->format('H:i')); ?></span>
                            </span>
                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::endLoop(); ?><?php endif; ?><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::closeLoop(); ?><?php endif; ?>
                        
                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::openLoop(); ?><?php endif; ?><?php $__currentLoopData = $breakingNews; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $news): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::startLoop($loop->index); ?><?php endif; ?>
                            <span class="px-6 flex items-center gap-3 border-r border-slate-200 whitespace-nowrap">
                                <?php echo e($news->content); ?>

                                <span class="text-[9px] text-slate-400"><?php echo e($news->created_at->format('H:i')); ?></span>
                            </span>
                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::endLoop(); ?><?php endif; ?><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::closeLoop(); ?><?php endif; ?>
                    </div>
                </div>
            </div>
        </div>
    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

    <?php echo e($slot); ?>


    <footer class="bg-brand-dark text-white pt-16 pb-8 px-4 md:px-6 mt-12 border-t border-slate-800">
        <div class="max-w-7xl mx-auto grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-12">
            <div class="space-y-6">
                <a href="<?php echo e(route('home')); ?>" class="inline-block">
                    <img src="<?php echo e(asset('images/logo.png')); ?>" alt="Bikash Barta Logo" class="h-20 w-auto">
                </a>
                <p class="text-xs text-slate-400 leading-relaxed font-odia">
                    <?php echo e(__('nav.footer_desc')); ?>

                </p>
                <div class="flex gap-3">
                    <a href="<?php echo e($socialFb ?: '#'); ?>" target="<?php echo e($socialFb ? '_blank' : '_self'); ?>" rel="noopener"
                        class="w-8 h-8 bg-white/5 border border-white/10 rounded-sm flex items-center justify-center hover:bg-brand-blue hover:border-brand-blue transition-colors"><i
                            class="fa-brands fa-facebook-f text-xs"></i></a>
                    <a href="#"
                        class="w-8 h-8 bg-white/5 border border-white/10 rounded-sm flex items-center justify-center hover:bg-brand-blue hover:border-brand-blue transition-colors"><i
                            class="fa-brands fa-x-twitter text-xs"></i></a>
                    <a href="<?php echo e($socialYt ?: '#'); ?>" target="<?php echo e($socialYt ? '_blank' : '_self'); ?>" rel="noopener"
                        class="w-8 h-8 bg-white/5 border border-white/10 rounded-sm flex items-center justify-center hover:bg-brand-blue hover:border-brand-blue transition-colors"><i
                            class="fa-brands fa-youtube text-xs"></i></a>
                    <a href="<?php echo e($socialIg ?: '#'); ?>" target="<?php echo e($socialIg ? '_blank' : '_self'); ?>" rel="noopener"
                        class="w-8 h-8 bg-white/5 border border-white/10 rounded-sm flex items-center justify-center hover:bg-brand-blue hover:border-brand-blue transition-colors"><i
                            class="fa-brands fa-instagram text-xs"></i></a>
                </div>
                <address class="not-italic text-xs text-slate-400 leading-relaxed">
                    <i class="fa-solid fa-location-dot text-brand-red mr-1"></i>
                    Ethics Aurovilla Duplex 5, Raghunathpur, Bhubaneswar, Pin 751024<br>
                    Plot No. 2016 (Est. 2016)
                </address>
            </div>

            <div>
                <h3 class="text-sm font-bold mb-6 border-l-2 border-brand-red pl-4 uppercase tracking-wider">
                    <?php echo e(__('nav.information')); ?></h3>
                <ul class="space-y-3 text-xs text-slate-400 uppercase tracking-widest font-bold">
                    <li><a href="<?php echo e(route('about')); ?>" class="hover:text-white transition-colors"><?php echo e(__('nav.about_us')); ?></a></li>
                    <li><a href="<?php echo e(route('contact')); ?>" class="hover:text-white transition-colors"><?php echo e(__('nav.contact_us')); ?></a></li>
                    <li><a href="<?php echo e(route('career')); ?>" class="hover:text-white transition-colors"><?php echo e(__('nav.career')); ?></a></li>
                    <li><a href="<?php echo e(route('legal', 'privacy-policy')); ?>"
                            class="hover:text-white transition-colors"><?php echo e(__('nav.privacy')); ?></a></li>
                    <li><a href="<?php echo e(route('legal', 'terms-and-conditions')); ?>"
                            class="hover:text-white transition-colors"><?php echo e(__('nav.terms')); ?></a></li>
                    <li><a href="<?php echo e(route('faq')); ?>"
                            class="hover:text-white transition-colors"><?php echo e(__('nav.faq')); ?></a></li>
                </ul>
            </div>

            <div>
                <h3 class="text-sm font-bold mb-6 border-l-2 border-brand-red pl-4 uppercase tracking-wider font-odia">
                    <?php echo e(__('nav.categories')); ?></h3>
                <ul class="grid grid-cols-2 gap-3 text-sm text-slate-400 font-odia">
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::openLoop(); ?><?php endif; ?><?php $__currentLoopData = App\Models\Category::all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::startLoop($loop->index); ?><?php endif; ?>
                        <li><a href="<?php echo e(route('category', $category->slug)); ?>"
                                class="hover:text-white transition-colors"><?php echo e($category->name); ?></a></li>
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::endLoop(); ?><?php endif; ?><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::closeLoop(); ?><?php endif; ?>
                </ul>
            </div>

            <div>
                <h3 class="text-sm font-bold mb-6 border-l-2 border-brand-red pl-4 uppercase tracking-wider"><?php echo e(__('nav.updates')); ?></h3>
                <p class="text-xs text-slate-400 mb-4"><?php echo e(__('nav.newsletter_footer')); ?></p>
                <?php
$__split = function ($name, $params = []) {
    return [$name, $params];
};
[$__name, $__params] = $__split('newsletter-form');

$__keyOuter = $__key ?? null;

$__key = null;
$__componentSlots = [];

$__key ??= \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::generateKey('lw-3331054887-0', $__key);

$__html = app('livewire')->mount($__name, $__params, $__key, $__componentSlots);

echo $__html;

unset($__html);
unset($__key);
$__key = $__keyOuter;
unset($__keyOuter);
unset($__name);
unset($__params);
unset($__componentSlots);
unset($__split);
?>
            </div>
        </div>

        <div
            class="max-w-7xl mx-auto border-t border-white/5 mt-16 pt-8 flex flex-col md:flex-row justify-between items-center gap-4 text-[10px] text-slate-500 uppercase tracking-widest font-bold">
            <p>© <?php echo e(date('Y')); ?> BIKASH BARTA. ALL RIGHTS RESERVED.</p>
        </div>
    </footer>

    <script>
        (function() {
            var btn = document.getElementById('mobile-menu-btn');
            var nav = document.getElementById('mobile-nav');
            var close = document.getElementById('mobile-menu-close');
            var backdrop = document.getElementById('mobile-nav-backdrop');

            function openNav() {
                nav.classList.remove('hidden');
                if (btn) btn.setAttribute('aria-expanded', 'true');
            }

            function closeNav() {
                nav.classList.add('hidden');
                if (btn) btn.setAttribute('aria-expanded', 'false');
            }
            if (btn) btn.addEventListener('click', openNav);
            if (close) close.addEventListener('click', closeNav);
            if (backdrop) backdrop.addEventListener('click', closeNav);
        })();
    </script>
    <script>
        (function() {
            var CACHE_KEY = 'bb_weather';
            var CACHE_TTL = 3 * 60 * 60 * 1000; // 3 hours

            var DEFAULT = {
                lat: 20.2961,
                lon: 85.8245,
                city: 'Bhubaneswar, Odisha'
            };

            var WMO_ICONS = {
                0: 'fa-sun', 1: 'fa-sun', 2: 'fa-cloud-sun', 3: 'fa-cloud',
                45: 'fa-smog', 48: 'fa-smog',
                51: 'fa-cloud-drizzle', 53: 'fa-cloud-drizzle', 55: 'fa-cloud-drizzle',
                61: 'fa-cloud-rain', 63: 'fa-cloud-rain', 65: 'fa-cloud-showers-heavy',
                71: 'fa-snowflake', 73: 'fa-snowflake', 75: 'fa-snowflake',
                80: 'fa-cloud-rain', 81: 'fa-cloud-showers-heavy', 82: 'fa-cloud-showers-heavy',
                95: 'fa-cloud-bolt', 96: 'fa-cloud-bolt', 99: 'fa-cloud-bolt',
            };

            function iconForCode(code) {
                if (WMO_ICONS[code]) return WMO_ICONS[code];
                if (code <= 3) return 'fa-cloud-sun';
                if (code <= 49) return 'fa-smog';
                if (code <= 69) return 'fa-cloud-rain';
                if (code <= 79) return 'fa-snowflake';
                return 'fa-cloud-bolt';
            }

            function getCache() {
                try {
                    var raw = localStorage.getItem(CACHE_KEY);
                    if (!raw) return null;
                    return JSON.parse(raw);
                } catch (e) { return null; }
            }

            function setCache(data) {
                try {
                    data.fetchedAt = Date.now();
                    localStorage.setItem(CACHE_KEY, JSON.stringify(data));
                } catch (e) {}
            }

            function isCacheValid(cache) {
                return cache && cache.fetchedAt && (Date.now() - cache.fetchedAt) < CACHE_TTL;
            }

            function applyWeather(temp, code, city) {
                var iconEl = document.getElementById('weather-icon');
                var tempEl = document.getElementById('weather-temp');
                var cityEl = document.getElementById('weather-city');
                if (!iconEl || !tempEl || !cityEl) return;
                iconEl.className = 'fa-solid ' + iconForCode(code) + ' text-3xl text-brand-blue';
                tempEl.textContent = temp + '\u00b0C';
                cityEl.textContent = city;
            }

            function setRefreshSpinning(spinning) {
                var btn = document.getElementById('weather-refresh');
                if (!btn) return;
                var icon = btn.querySelector('i');
                if (spinning) {
                    btn.disabled = true;
                    if (icon) icon.className = 'fa-solid fa-rotate-right fa-spin';
                } else {
                    btn.disabled = false;
                    if (icon) icon.className = 'fa-solid fa-rotate-right';
                }
            }

            function fetchAndCache(lat, lon, city) {
                setRefreshSpinning(true);
                var url = 'https://api.open-meteo.com/v1/forecast' +
                    '?latitude=' + lat + '&longitude=' + lon +
                    '&current=temperature_2m,weathercode&timezone=auto';

                fetch(url)
                    .then(function(r) { return r.json(); })
                    .then(function(d) {
                        var temp = Math.round(d.current.temperature_2m);
                        var code = d.current.weathercode;
                        setCache({ temp: temp, code: code, city: city, lat: lat, lon: lon });
                        applyWeather(temp, code, city);
                    })
                    .catch(function() {})
                    .finally(function() { setRefreshSpinning(false); });
            }

            function loadFromCacheOrFetch(lat, lon, city) {
                var cache = getCache();
                // Use cache if valid and same location (within ~1km tolerance)
                if (isCacheValid(cache) &&
                    Math.abs((cache.lat || 0) - lat) < 0.01 &&
                    Math.abs((cache.lon || 0) - lon) < 0.01) {
                    applyWeather(cache.temp, cache.code, cache.city);
                } else {
                    fetchAndCache(lat, lon, city);
                }
            }

            function init() {
                // Wire up refresh button
                var refreshBtn = document.getElementById('weather-refresh');
                if (refreshBtn) {
                    refreshBtn.addEventListener('click', function() {
                        var cache = getCache();
                        var lat = (cache && cache.lat) || DEFAULT.lat;
                        var lon = (cache && cache.lon) || DEFAULT.lon;
                        var city = (cache && cache.city) || DEFAULT.city;
                        fetchAndCache(lat, lon, city);
                    });
                }

                // Check localStorage first
                var cache = getCache();
                if (isCacheValid(cache)) {
                    applyWeather(cache.temp, cache.code, cache.city);
                    return;
                }

                // Try geolocation, fall back to default
                if (navigator.geolocation) {
                    navigator.geolocation.getCurrentPosition(
                        function(pos) {
                            var lat = pos.coords.latitude;
                            var lon = pos.coords.longitude;
                            fetch('https://nominatim.openstreetmap.org/reverse?lat=' + lat + '&lon=' + lon + '&format=json')
                                .then(function(r) { return r.json(); })
                                .then(function(geo) {
                                    var addr = geo.address || {};
                                    var city = addr.city || addr.town || addr.village || addr.county || 'Your Location';
                                    var state = addr.state || '';
                                    loadFromCacheOrFetch(lat, lon, city + (state ? ', ' + state : ''));
                                })
                                .catch(function() { loadFromCacheOrFetch(lat, lon, 'Your Location'); });
                        },
                        function() { loadFromCacheOrFetch(DEFAULT.lat, DEFAULT.lon, DEFAULT.city); },
                        { timeout: 5000 }
                    );
                } else {
                    loadFromCacheOrFetch(DEFAULT.lat, DEFAULT.lon, DEFAULT.city);
                }
            }

            init();
        })();
    </script>
    <?php echo \Livewire\Mechanisms\FrontendAssets\FrontendAssets::scripts(); ?>

</body>

</html>
<?php /**PATH D:\02-my freelance\00-DR_Padhi\DR_PADHI\resources\views/layouts/frontend.blade.php ENDPATH**/ ?>