<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Edit Global /etc/hosts File</title>
  <style>
    body { font-family: Arial, sans-serif; background: #f1f1f1; margin: 0; padding: 0; }
    .container { max-width: 800px; margin: 40px auto; background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 0 10px #ccc; }
    h1 { text-align: center; margin-bottom: 1em; }
    textarea { width: 100%; height: 400px; box-sizing: border-box; font-family: monospace; padding: 10px; }
    button { margin-top: 1em; padding: 10px 20px; background: #007bff; border: none; color: #fff; cursor: pointer; border-radius: 4px; }
    button:hover { background: #0056b3; }
    .links { text-align: center; margin-top: 10px; }
    .links a { color: #007bff; text-decoration: none; margin: 0 10px; }
    .links a:hover { text-decoration: underline; }
    .flash-messages { margin-top: 10px; color: #b30000; text-align: center; }
  </style>
</head>
<body>
  <div class="container">
    <h1>Edit Global /etc/hosts File</h1>
    {% with messages = get_flashed_messages(category_filter=["danger","success","info"]) %}
      {% if messages %}
        <div class="flash-messages">
          {% for message in messages %}
            <p>{{ message }}</p>
          {% endfor %}
        </div>
      {% endif %}
    {% endwith %}
    <form method="POST" action="{{ url_for('edit_local_hosts') }}">
      <textarea name="hosts_content" id="hosts_content">{{ content }}</textarea>
      <br/>
      <button type="submit">Save Changes</button>
    </form>
    <div class="links">
      <a href="{{ url_for('dashboard') }}">Go to Dashboard</a>
    </div>
  </div>
</body>
</html>