<!DOCTYPE html>
<html lang="ko">
<head>
  <meta charset="UTF-8" />
  <title>{% block title %}RealNAS security{% endblock %}</title>
  <style>
    body {
      font-family: 'Malgun Gothic', Arial, sans-serif;
      background: #f8f9fb;
      color: #222;
      margin: 0;
      padding: 0;
    }
    .navbar {
      background: #24262b;
      color: white;
      padding: 8px 20px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 13px;
      flex-wrap: wrap;
    }
    .navbar a {
      color: #aee1ff;
      text-decoration: none;
      margin-left: 12px;
      transition: color 0.3s ease;
    }
    .navbar a:hover,
    .navbar a.active {
      color: white;
      text-decoration: underline;
    }
    .container {
      max-width: 1400px;
      margin: 20px auto;
      padding: 0 20px;
    }
    .flash-message {
      background: #fff5cc;
      border: 1px solid #ffd324;
      padding: 12px 15px;
      margin: 15px 0;
      border-radius: 6px;
      color: #665c00;
      font-size: 14px;
      box-shadow: 0 1px 4px rgba(255, 211, 36, 0.3);
    }
    button {
      background: #369;
      color: white;
      border: none;
      padding: 8px 16px;
      border-radius: 5px;
      cursor: pointer;
      transition: background 0.25s ease;
      font-size: 14px;
    }
    button:hover {
      background: #246;
    }
    input[type="text"], select {
      padding: 8px 10px;
      margin-right: 12px;
      border: 1px solid #ccc;
      border-radius: 6px;
      font-size: 14px;
      width: 250px;
      max-width: 100%;
      box-sizing: border-box;
    }
    .flex-row {
      display: flex;
      align-items: center;
      margin-bottom: 15px;
      flex-wrap: wrap;
    }
    .flex-row label {
      margin-right: 8px;
      font-weight: 600;
      color: #444;
    }
    .status-good {
      color: #2a9d8f;
      font-weight: 700;
    }
    .status-bad {
      color: #e76f51;
      font-weight: 700;
    }
    @media (max-width: 768px) {
      .navbar {
        font-size: 12px;
      }
      input[type="text"] {
        width: 100%;
        margin-bottom: 10px;
      }
      .flex-row {
        flex-direction: column;
        align-items: flex-start;
      }
      button {
        width: 100%;
      }
    }
  </style>
</head>
<body>

<div class="navbar">
  <div><strong>RealNAS Security - 보안관리</strong></div>
  <div>
    <a href="{{ url_for('crowdsec_dashboard') }}" class="{% if request.endpoint == 'crowdsec_dashboard' %}active{% endif %}">대시보드</a>
    <a href="{{ url_for('crowdsec_blocks') }}" class="{% if request.endpoint == 'crowdsec_blocks' %}active{% endif %}">차단 목록</a>
    <a href="{{ url_for('crowdsec_logs') }}" class="{% if request.endpoint == 'crowdsec_logs' %}active{% endif %}">로그 조회</a>
    <a href="{{ url_for('crowdsec_scenarios') }}" class="{% if request.endpoint == 'crowdsec_scenarios' %}active{% endif %}">시나리오 관리</a>
    <a href="{{ url_for('logout') }}">로그아웃</a>
  </div>
</div>

<div class="container">
  {% with messages = get_flashed_messages() %}
    {% if messages %}
      <div class="flash-message">
        {% for message in messages %}
          <div>{{ message }}</div>
        {% endfor %}
      </div>
    {% endif %}
  {% endwith %}

  {% block content %}
  <!-- 각 페이지에서 내용을 채워 넣음 -->
  {% endblock %}
</div>

</body>
</html>
