<!DOCTYPE html>
<html lang="en" class="scroll-smooth">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@yield('title') - {{ \App\Models\Setting::val('site_name', 'Admin Portal') }}</title>
    
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <script src="https://cdn.tailwindcss.com"></script>
    <style>
        body { font-family: 'Inter', sans-serif; background-color: #0f172a; color: #f8fafc; overscroll-behavior-y: auto; }
        ::-webkit-scrollbar { width: 6px; }
        ::-webkit-scrollbar-track { background: #0f172a; }
        ::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
    </style>
</head>
<body class="min-h-screen antialiased selection:bg-blue-500 selection:text-white">

    <div id="sidebarOverlay" class="fixed inset-0 bg-black/60 z-30 hidden lg:hidden backdrop-blur-sm transition-opacity" onclick="toggleSidebar()"></div>

    @include('admin.layouts.menu')

    <div class="flex flex-col min-h-screen transition-all duration-300 lg:ml-64">
        
        <header class="sticky top-0 h-16 flex items-center justify-between px-4 lg:px-8 border-b border-[#334155] bg-[#0f172a]/95 backdrop-blur-sm z-20 shadow-sm">
            <button class="text-gray-400 hover:text-white lg:hidden transition-colors" onclick="toggleSidebar()">
                <i class="fa-solid fa-bars text-2xl"></i>
            </button>
            
            <div class="flex items-center gap-6 ml-auto">
                <div class="w-10 h-10 rounded-lg bg-red-500/10 text-red-500 flex items-center justify-center border border-red-500/20 shadow-sm" title="Admin">
                    <i class="fa-solid fa-user-shield text-lg"></i>
                </div>
                
                <form action="{{ route('admin.logout') }}" method="POST" class="m-0 border-l border-[#334155] pl-6">
                    @csrf
                    <button type="submit" class="text-gray-400 hover:text-white transition-colors flex items-center gap-2 font-medium">
                        <i class="fa-solid fa-right-from-bracket text-lg"></i>
                        <span class="hidden sm:inline">Sign Out</span>
                    </button>
                </form>
            </div>
        </header>

        <main class="flex-1 p-4 lg:p-8 overflow-x-hidden">
            @yield('content')
        </main>
    </div>

    <script>
        function toggleSidebar() {
            const sidebar = document.getElementById('sidebar');
            const overlay = document.getElementById('sidebarOverlay');
            sidebar.classList.toggle('-translate-x-full');
            overlay.classList.toggle('hidden');
        }
    </script>
</body>
</html>
