<!DOCTYPE html>
<html lang="en" data-theme="dark">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>{% block title %}Brain MCP{% endblock %}</title>

    <!-- Vendored: Pico CSS (classless, dark mode by default) -->
    <link rel="stylesheet" href="/static/pico.min.css">
    <!-- Deep Space Neural theme -->
    <link rel="stylesheet" href="/static/brain.css">

    <!-- Vendored: htmx 2.0 (14KB, handles all interactivity) -->
    <script src="/static/htmx.min.js"></script>
    <!-- Vendored: Alpine.js (only used for onboarding wizard state) -->
    <script defer src="/static/alpine.min.js"></script>

    {% block head %}{% endblock %}
</head>
<body>
    <nav class="container">
        <ul>
            <li><a href="/"><strong>🧠 Brain MCP</strong></a></li>
        </ul>
        <ul>
            <li><a href="/" {% if active_page == 'home' %}class="active"{% endif %}>Home</a></li>
            <li><a href="/search" {% if active_page == 'search' %}class="active"{% endif %}>Search</a></li>
            <li><a href="/sources" {% if active_page == 'sources' %}class="active"{% endif %}>Connected Apps</a></li>
            <li><a href="/settings" {% if active_page == 'settings' %}class="active"{% endif %}>Settings</a></li>
        </ul>
    </nav>

    <main class="container">
        {% block content %}{% endblock %}
    </main>

    <footer class="container">
        <small>
            <a href="https://brainmcp.dev">brainmcp.dev</a> ·
            <a href="https://github.com/mordechaipotash/brain-mcp">GitHub</a> ·
            100% local · MIT Licensed
        </small>
    </footer>

    <script src="/static/brain.js"></script>
    {% block scripts %}{% endblock %}
</body>
</html>
