<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{ page_title }} - CoreLogger</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <style>
        :root {
            --primary-bg: #0d1117;
            --secondary-bg: #161b22;
            --tertiary-bg: #21262d;
            --border-color: #30363d;
            --text-primary: #f0f6fc;
            --text-secondary: #8b949e;
            --accent-blue: #58a6ff;
            --accent-green: #3fb950;
            --success: #238636;
            --error: #da3633;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif;
            line-height: 1.6;
            color: var(--text-primary);
            background: var(--primary-bg);
            min-height: 100vh;
        }

        .navbar {
            background: var(--secondary-bg) !important;
            border-bottom: 1px solid var(--border-color);
        }

        .navbar-brand {
            color: var(--text-primary) !important;
            font-weight: 600;
        }

        .navbar-nav .nav-link {
            color: var(--text-secondary) !important;
            margin: 0 0.5rem;
            padding: 0.5rem 1rem !important;
            border-radius: 6px;
            transition: all 0.2s ease;
        }

        .navbar-nav .nav-link:hover {
            color: var(--text-primary) !important;
            background: var(--tertiary-bg);
        }

        .main-container {
            max-width: 1400px;
            margin: 0 auto;
            padding: 2rem;
        }

        .card {
            background: var(--secondary-bg);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            margin-bottom: 1.5rem;
        }

        .card-body {
            padding: 1.5rem;
        }

        .btn {
            border-radius: 6px;
            font-weight: 500;
            border: none;
            cursor: pointer;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            transition: all 0.2s ease;
        }

        .btn-primary {
            background: var(--accent-blue);
            color: white;
        }

        .btn-success {
            background: var(--success);
            color: white;
        }

        .form-control,
        .form-select {
            background: var(--tertiary-bg);
            border: 1px solid var(--border-color);
            color: var(--text-primary);
        }

        .form-control:focus,
        .form-select:focus {
            border-color: var(--accent-blue);
            box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1.5rem;
            margin-bottom: 2rem;
        }

        .stat-card {
            background: var(--secondary-bg);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 1.5rem;
            text-align: center;
        }

        .stat-number {
            font-size: 2.5rem;
            font-weight: bold;
            color: var(--accent-blue);
        }

        .thought-item {
            background: var(--secondary-bg);
            border: 1px solid var(--border-color);
            border-left: 4px solid var(--accent-blue);
            border-radius: 8px;
            padding: 1.5rem;
            margin-bottom: 1rem;
        }

        .thought-meta {
            color: var(--text-secondary);
            font-size: 0.9rem;
            margin-bottom: 1rem;
        }

        .thought-content {
            color: var(--text-primary);
        }

        .progress {
            background: var(--tertiary-bg);
        }

        .progress-bar {
            background: var(--accent-green);
        }

        .alert-danger {
            background: rgba(218, 54, 51, 0.1);
            border: 1px solid var(--error);
            color: #ff7b72;
        }
    </style>
</head>

<body>
    <nav class="navbar navbar-expand-lg">
        <div class="container-fluid">
            <a class="navbar-brand" href="/dashboard">
                <i class="fas fa-brain"></i> CoreLogger
            </a>
            <div class="navbar-nav ms-auto">
                <a class="nav-link" href="/dashboard"><i class="fas fa-tachometer-alt"></i> Dashboard</a>
                <a class="nav-link" href="/thoughts"><i class="fas fa-list"></i> AI Interactions</a>
                <a class="nav-link" href="/search"><i class="fas fa-search"></i> Search</a>
                <a class="nav-link" href="/chat"><i class="fas fa-comments"></i> AI Chat</a>
            </div>
        </div>
    </nav>
    <div class="main-container">
        {% block content %}{% endblock %}
    </div>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>

</html>