<!DOCTYPE html>
<html lang="en">
{% load static %}
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>{% block title %}Referral Rewards{% endblock %}</title>
  {% if project_description %}
  <meta name="description" content="{{ project_description }}">
  <meta property="og:description" content="{{ project_description }}">
  <meta property="twitter:description" content="{{ project_description }}">
  {% endif %}
  {% if project_image_url %}
  <meta property="og:image" content="{{ project_image_url }}">
  <meta property="twitter:image" content="{{ project_image_url }}">
  {% endif %}
  
  <!-- Fonts -->
  <link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&family=Inter:wght@300;400;600&display=swap" rel="stylesheet">
  
  <!-- Bootstrap 5 CSS -->
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
  
  <!-- Custom CSS -->
  <link rel="stylesheet" href="{% static 'css/custom.css' %}?v={{ deployment_timestamp }}">
  
  <style>
    :root {
      --primary-navy: #1A2B3C;
      --accent-teal: #20C997;
      --highlight-coral: #FF7E67;
      --soft-pearl: #F8F9FA;
    }
    body {
      font-family: 'Inter', sans-serif;
      background-color: var(--soft-pearl);
      color: var(--primary-navy);
    }
    h1, h2, h3, h4, .navbar-brand {
      font-family: 'Montserrat', sans-serif;
      font-weight: 700;
    }
    .navbar {
      background-color: white;
      box-shadow: 0 2px 15px rgba(0,0,0,0.05);
      padding: 1rem 0;
    }
    .btn-primary {
      background-color: var(--accent-teal);
      border-color: var(--accent-teal);
      border-radius: 8px;
      padding: 0.6rem 1.5rem;
      font-weight: 600;
      transition: all 0.3s ease;
    }
    .btn-primary:hover {
      background-color: #1ba87e;
      border-color: #1ba87e;
      transform: translateY(-2px);
    }
    .btn-outline-primary {
      color: var(--primary-navy);
      border-color: var(--primary-navy);
      border-radius: 8px;
    }
    .btn-outline-primary:hover {
      background-color: var(--primary-navy);
      color: white;
    }
    .navbar-brand span {
        color: var(--accent-teal);
    }
  </style>
  {% block head %}{% endblock %}
</head>

<body>
  <nav class="navbar navbar-expand-lg navbar-light sticky-top">
    <div class="container">
      <a class="navbar-brand" href="{% url 'home' %}">Referral<span>Rewards</span></a>
      <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
        <span class="navbar-toggler-icon"></span>
      </button>
      <div class="collapse navbar-collapse" id="navbarNav">
        <ul class="navbar-nav ms-auto align-items-center">
          {% if user.is_authenticated %}
            <li class="nav-item">
              <a class="nav-link px-3" href="{% url 'dashboard' %}">Dashboard</a>
            </li>
            <li class="nav-item">
                <a class="nav-link px-3" href="/admin/">Admin</a>
            </li>
            <li class="nav-item">
              <a class="btn btn-outline-primary ms-lg-3" href="{% url 'logout' %}">Logout</a>
            </li>
          {% else %}
            <li class="nav-item">
              <a class="nav-link px-3" href="{% url 'login' %}">Login</a>
            </li>
            <li class="nav-item">
              <a class="btn btn-primary ms-lg-3" href="{% url 'signup' %}">Get Started</a>
            </li>
          {% endif %}
        </ul>
      </div>
    </div>
  </nav>

  <main>
    {% if messages %}
      <div class="container mt-4">
        {% for message in messages %}
          <div class="alert alert-{{ message.tags }} alert-dismissible fade show" role="alert">
            {{ message }}
            <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
          </div>
        {% endfor %}
      </div>
    {% endif %}

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

  <footer class="py-5 bg-white mt-5">
    <div class="container text-center">
      <p class="text-muted mb-0">&copy; 2026 Referral Rewards. All rights reserved.</p>
    </div>
  </footer>

  <!-- Bootstrap 5 JS Bundle -->
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
  {% block scripts %}{% endblock %}
</body>
</html>