<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{ title }}</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <script>
        tailwind.config = {
            darkMode: 'class',
            theme: {
                extend: {}
            }
        }
    </script>
    <style>
        .diff {
            font-family: "Courier New", monospace;
            font-size: 1.15em;
            white-space: pre;
            margin-top: 1rem;
        }
        .diff-row {
            margin-bottom: 2px;
            line-height: 1.2;
        }
        .diff-green {
            color: #2e7d32;
            font-weight: bold;
        }
        .diff-red {
            color: #c62828;
            font-weight: bold;
        }
        .diff-grey {
            color: #9e9e9e;
        }
        .dark .diff-green {
            color: #4ade80;
        }
        .dark .diff-red {
            color: #f87171;
        }
        .dark .diff-grey {
            color: #9ca3af;
        }
        .inline-input {
            display: inline-block;
            max-width: 16ch;
            border: none;
            border-bottom: 2px solid #374151;
            background: transparent;
            padding: 0 4px;
            font-size: inherit;
            font-family: inherit;
            outline: none;
            color: inherit;
            text-align: center;
        }
        .inline-input:focus {
            border-bottom-color: #2563eb;
        }
        .dark .inline-input {
            border-bottom-color: #6b7280;
        }
        .dark .inline-input:focus {
            border-bottom-color: #60a5fa;
        }
        .fill-container {
            line-height: 2;
        }
    </style>
</head>
<body class="bg-gray-50 dark:bg-gray-900 min-h-screen transition-colors duration-200">
    <!-- Theme Toggle Button -->
    <div class="fixed top-4 right-4 z-50">
        <button id="theme-toggle" 
                class="p-2 rounded-lg bg-white dark:bg-gray-800 shadow-md border border-gray-200 dark:border-gray-700 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors duration-200"
                aria-label="Toggle dark mode">
            <!-- Sun Icon (shown in dark mode) -->
            <svg id="theme-icon-sun" class="hidden w-6 h-6 text-yellow-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"></path>
            </svg>
            <!-- Moon Icon (shown in light mode) -->
            <svg id="theme-icon-moon" class="w-6 h-6 text-gray-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"></path>
            </svg>
        </button>
    </div>
    
    <div class="container mx-auto px-4 py-8 max-w-4xl">
        {% block content %}{% endblock %}
    </div>
    <script type="module" src="/static/js/main.js"></script>
</body>
</html>
