<!DOCTYPE html>
<html lang="hu">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}Recept Importáló{% endblock %}</title>
    <style>
        :root {
            --bg: #1a1a2e;
            --surface: #16213e;
            --surface2: #0f3460;
            --accent: #e94560;
            --accent-hover: #d63851;
            --text: #eee;
            --text-dim: #aab;
            --success: #2ecc71;
            --warning: #f39c12;
            --danger: #e74c3c;
            --border: #2a2a4a;
            --input-bg: #1a1a3e;
            --radius: 8px;
        }

        * { box-sizing: border-box; margin: 0; padding: 0; }

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

        /* --- Nav --- */
        nav {
            background: var(--surface);
            border-bottom: 1px solid var(--border);
            padding: 0.75rem 1.5rem;
            display: flex;
            align-items: center;
            gap: 1.5rem;
        }
        nav .brand {
            font-size: 1.25rem;
            font-weight: 700;
            color: var(--accent);
            text-decoration: none;
        }
        nav a {
            color: var(--text-dim);
            text-decoration: none;
            padding: 0.4rem 0.75rem;
            border-radius: var(--radius);
            transition: background 0.15s, color 0.15s;
        }
        nav a:hover, nav a.active {
            background: var(--surface2);
            color: var(--text);
        }
        nav .version {
            margin-left: auto;
            font-size: 0.8rem;
            color: var(--text-dim);
        }

        /* --- Layout --- */
        .container {
            max-width: 900px;
            margin: 2rem auto;
            padding: 0 1rem;
        }

        /* --- Cards --- */
        .card {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 1.5rem;
            margin-bottom: 1.5rem;
        }
        .card h2 {
            margin-bottom: 1rem;
            font-size: 1.25rem;
        }

        /* --- Forms --- */
        label {
            display: block;
            margin-bottom: 0.3rem;
            font-weight: 500;
            color: var(--text-dim);
            font-size: 0.9rem;
        }
        input[type="text"], input[type="url"], input[type="password"], textarea {
            width: 100%;
            padding: 0.6rem 0.8rem;
            background: var(--input-bg);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            color: var(--text);
            font-size: 0.95rem;
            margin-bottom: 1rem;
            transition: border-color 0.15s;
        }
        input:focus, textarea:focus {
            outline: none;
            border-color: var(--accent);
        }
        textarea { resize: vertical; min-height: 80px; font-family: inherit; }

        /* --- Buttons --- */
        .btn {
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
            padding: 0.6rem 1.2rem;
            border: none;
            border-radius: var(--radius);
            font-size: 0.95rem;
            font-weight: 600;
            cursor: pointer;
            transition: background 0.15s, transform 0.1s;
            color: #fff;
        }
        .btn:active { transform: scale(0.97); }
        .btn-primary { background: var(--accent); }
        .btn-primary:hover { background: var(--accent-hover); }
        .btn-secondary { background: var(--surface2); }
        .btn-secondary:hover { background: #1a4a7a; }
        .btn-success { background: var(--success); color: #111; }
        .btn-success:hover { background: #27ae60; }
        .btn:disabled { opacity: 0.5; cursor: not-allowed; }

        /* --- Alerts --- */
        .alert {
            padding: 0.75rem 1rem;
            border-radius: var(--radius);
            margin-bottom: 1rem;
            font-size: 0.9rem;
        }
        .alert-success { background: rgba(46,204,113,0.15); border: 1px solid var(--success); }
        .alert-warning { background: rgba(243,156,18,0.15); border: 1px solid var(--warning); }
        .alert-danger  { background: rgba(231,76,60,0.15); border: 1px solid var(--danger); }

        /* --- Spinner --- */
        .spinner {
            display: inline-block;
            width: 1.2rem;
            height: 1.2rem;
            border: 2px solid rgba(255,255,255,0.3);
            border-top-color: #fff;
            border-radius: 50%;
            animation: spin 0.6s linear infinite;
        }
        @keyframes spin { to { transform: rotate(360deg); } }

        /* --- Misc --- */
        .hidden { display: none !important; }
        .mb-1 { margin-bottom: 0.5rem; }
        .mb-2 { margin-bottom: 1rem; }
        .mt-1 { margin-top: 0.5rem; }
        .mt-2 { margin-top: 1rem; }
        .text-dim { color: var(--text-dim); }
        .text-success { color: var(--success); }
        .text-danger { color: var(--danger); }
        .text-warning { color: var(--warning); }
        .flex { display: flex; gap: 0.75rem; align-items: center; }
        .flex-wrap { flex-wrap: wrap; }
        .grow { flex: 1; }
    </style>
    {% block head %}{% endblock %}
</head>
<body>
    <nav>
        <a href="/" class="brand">Recept Importáló</a>
        <a href="/import" {% if request.path == '/import' %}class="active"{% endif %}>Importálás</a>
        <a href="/settings" {% if request.path == '/settings' %}class="active"{% endif %}>Beállítások</a>
        <span class="version">v{{ version }}</span>
    </nav>

    <div class="container">
        {% with messages = get_flashed_messages(with_categories=true) %}
        {% for cat, msg in messages %}
        <div class="alert alert-{{ cat }}">{{ msg }}</div>
        {% endfor %}
        {% endwith %}

        {% block content %}{% endblock %}
    </div>

    {% block scripts %}{% endblock %}
</body>
</html>
