{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>{% block title %}{{ meta_title|default:"MileLedger" }}{% endblock %}</title>
  <meta name="description" content="{% block meta_description %}{{ meta_description|default:project_description|default:'IRS-friendly mileage tracking and reporting.' }}{% endblock %}">
  {% if project_image_url %}
  <meta property="og:image" content="{{ project_image_url }}">
  <meta property="twitter:image" content="{{ project_image_url }}">
  {% endif %}
  <link rel="preconnect" href="https://fonts.googleapis.com">
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Manrope:wght@500;600;700;800&display=swap" rel="stylesheet">
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
  <link rel="stylesheet" href="{% static 'css/custom.css' %}?v={{ deployment_timestamp }}">
  {% block head %}{% endblock %}
</head>
<body>
  <div class="site-shell">
    <div class="hero-orb orb-1"></div>
    <div class="hero-orb orb-2"></div>
    <div class="hero-grid"></div>
    <header class="site-header sticky-top">
      <nav class="navbar navbar-expand-lg app-navbar">
        <div class="container-xxl px-3 px-lg-4">
          <a class="navbar-brand brand-lockup" href="{% url 'home' %}">
            <span class="brand-badge">ML</span>
            <span>
              <span class="brand-name">MileLedger</span>
              <span class="brand-tag">IRS-friendly vehicle log</span>
            </span>
          </a>
          <button class="navbar-toggler nav-toggle" type="button" data-bs-toggle="collapse" data-bs-target="#mainNav" aria-controls="mainNav" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
          </button>
          <div class="collapse navbar-collapse" id="mainNav">
            <ul class="navbar-nav ms-auto align-items-lg-center gap-lg-2">
              <li class="nav-item"><a class="nav-link" href="{% url 'home' %}">Dashboard</a></li>
              <li class="nav-item"><a class="nav-link" href="{% url 'trip_list' %}">Trips</a></li>
              <li class="nav-item"><a class="nav-link" href="{% url 'report_view' %}">Reports</a></li>
              <li class="nav-item"><a class="nav-link" href="/admin/">Admin</a></li>
              <li class="nav-item ms-lg-2"><a class="btn btn-primary app-btn-primary" href="{% url 'trip_create' %}">Log trip</a></li>
            </ul>
          </div>
        </div>
      </nav>
    </header>

    <main>
      {% if messages %}
      <div class="container-xxl px-3 px-lg-4 pt-4">
        {% for message in messages %}
        <div class="alert alert-{{ message.tags|default:'info' }} app-alert mb-3" role="alert">{{ message }}</div>
        {% endfor %}
      </div>
      {% endif %}
      {% block content %}{% endblock %}
    </main>
  </div>

  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
  {% block scripts %}{% endblock %}
</body>
</html>
