<!-- [DEF:Navbar:Component] -->
<!--
@SEMANTICS: navbar, navigation, header, layout
@PURPOSE:   Main navigation bar for the application.
@LAYER:     UI
@RELATION:  USES -> $app/stores
-->
<script>
    import { page } from '$app/stores';
</script>

<header class="bg-white shadow-md p-4 flex justify-between items-center">
    <a
        href="/"
        class="text-3xl font-bold text-gray-800 focus:outline-none"
    >
        Superset Tools
    </a>
    <nav class="space-x-4">
        <a
            href="/"
            class="text-gray-600 hover:text-blue-600 font-medium {$page.url.pathname === '/' ? 'text-blue-600 border-b-2 border-blue-600' : ''}"
        >
            Dashboard
        </a>
        <a
            href="/migration"
            class="text-gray-600 hover:text-blue-600 font-medium {$page.url.pathname.startsWith('/migration') ? 'text-blue-600 border-b-2 border-blue-600' : ''}"
        >
            Migration
        </a>
        <a
            href="/tasks"
            class="text-gray-600 hover:text-blue-600 font-medium {$page.url.pathname.startsWith('/tasks') ? 'text-blue-600 border-b-2 border-blue-600' : ''}"
        >
            Tasks
        </a>
        <div class="relative inline-block group">
            <button class="text-gray-600 hover:text-blue-600 font-medium pb-1 {$page.url.pathname.startsWith('/tools') ? 'text-blue-600 border-b-2 border-blue-600' : ''}">
                Tools
            </button>
            <div class="absolute hidden group-hover:block bg-white shadow-lg rounded-md mt-1 py-2 w-48 z-10 border border-gray-100 before:absolute before:-top-2 before:left-0 before:right-0 before:h-2 before:content-[''] right-0">
                <a href="/tools/search" class="block px-4 py-2 text-sm text-gray-700 hover:bg-blue-50 hover:text-blue-600">Dataset Search</a>
                <a href="/tools/mapper" class="block px-4 py-2 text-sm text-gray-700 hover:bg-blue-50 hover:text-blue-600">Dataset Mapper</a>
                <a href="/tools/debug" class="block px-4 py-2 text-sm text-gray-700 hover:bg-blue-50 hover:text-blue-600">System Debug</a>
            </div>
        </div>
        <div class="relative inline-block group">
            <button class="text-gray-600 hover:text-blue-600 font-medium pb-1 {$page.url.pathname.startsWith('/settings') ? 'text-blue-600 border-b-2 border-blue-600' : ''}">
                Settings
            </button>
            <div class="absolute hidden group-hover:block bg-white shadow-lg rounded-md mt-1 py-2 w-48 z-10 border border-gray-100 before:absolute before:-top-2 before:left-0 before:right-0 before:h-2 before:content-[''] right-0">
                <a href="/settings" class="block px-4 py-2 text-sm text-gray-700 hover:bg-blue-50 hover:text-blue-600">General Settings</a>
                <a href="/settings/connections" class="block px-4 py-2 text-sm text-gray-700 hover:bg-blue-50 hover:text-blue-600">Connections</a>
            </div>
        </div>
    </nav>
</header>
<!-- [/DEF:Navbar:Component] -->
