<!DOCTYPE html>
<html lang="en" class="h-100">

<head>
  <meta charset="UTF-8">
  <title>{% block title %}PixelMinds{% 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 %}
  <meta name="viewport" content="width=device-width, initial-scale=1">
  {% load static %}
  <link href="{% static 'bootstrap/dist/css/bootstrap.min.css' %}" rel="stylesheet">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
  <link rel="stylesheet" href="{% static 'css/custom.css' %}?v={{ deployment_timestamp }}">
  {% block head %}{% endblock %}
</head>

<body class="d-flex flex-column h-100">
  <header>
    <nav class="navbar navbar-expand-lg navbar-light bg-white border-bottom shadow-sm">
      <div class="container-fluid">
        <a class="navbar-brand fw-bold" href="/">PixelMinds</a>
        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
          <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarSupportedContent">
          <ul class="navbar-nav me-auto mb-2 mb-lg-0">
            <li class="nav-item">
              <a class="nav-link" href="/">Home</a>
            </li>
            <li class="nav-item">
              <a class="nav-link" href="{% url 'core:about' %}">About</a>
            </li>
             <li class="nav-item">
              <a class="nav-link" href="{% url 'core:contact' %}">Contact</a>
            </li>
            {% if user.is_authenticated %}
            <li class="nav-item">
              <a class="nav-link" href="{% url 'core:dashboard' %}">Dashboard</a>
            </li>
            {% endif %}
          </ul>
          <ul class="navbar-nav">
            {% if user.is_authenticated %}
              <li class="nav-item dropdown">
                <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
                  <i class="bi bi-person-circle"></i> {{ user.username }}
                </a>
                <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
                  <li><a class="dropdown-item" href="{% url 'password_change' %}">Change Password</a></li>
                  {% if user.is_staff %}
                  <li><a class="dropdown-item" href="{% url 'admin:index' %}">Admin</a></li>
                  {% endif %}
                  <li><hr class="dropdown-divider"></li>
                  <li><a class="dropdown-item" href="{% url 'logout' %}">Logout</a></li>
                </ul>
              </li>
            {% else %}
              <li class="nav-item">
                <a class="nav-link" href="{% url 'login' %}">Login</a>
              </li>
              <li class="nav-item">
                <a href="{% url 'core:signup' %}" class="btn btn-primary">Sign Up</a>
              </li>
            {% endif %}
          </ul>
        </div>
      </div>
    </nav>
  </header>

  <main class="flex-shrink-0">
    {% block content %}{% endblock %}
  </main>

  <footer class="footer mt-auto py-5 bg-light border-top">
    <div class="container">
      <div class="row">
        <div class="col-md-4 mb-3">
          <h5>PixelMinds</h5>
          <p class="text-muted">Your personal health companion. Take control of your well-being.</p>
        </div>
        <div class="col-6 col-md-2 mb-3">
          <h5>Links</h5>
          <ul class="nav flex-column">
            <li class="nav-item mb-2"><a href="/" class="nav-link p-0 text-muted">Home</a></li>
            <li class="nav-item mb-2"><a href="{% url 'core:dashboard' %}" class="nav-link p-0 text-muted">Dashboard</a></li>
            <li class="nav-item mb-2"><a href="{% url 'core:about' %}" class="nav-link p-0 text-muted">About</a></li>
            <li class="nav-item mb-2"><a href="{% url 'core:contact' %}" class="nav-link p-0 text-muted">Contact</a></li>
          </ul>
        </div>
        <div class="col-6 col-md-2 mb-3">
          <h5>Legal</h5>
          <ul class="nav flex-column">
            <li class="nav-item mb-2"><a href="{% url 'core:privacy_policy' %}" class="nav-link p-0 text-muted">Privacy Policy</a></li>
            <li class="nav-item mb-2"><a href="#" class="nav-link p-0 text-muted">Terms of Service</a></li>
          </ul>
        </div>
        <div class="col-md-4 mb-3">
            <h5>Follow Us</h5>
            <a href="#" class="text-muted me-3"><i class="bi bi-twitter fs-4"></i></a>
            <a href="#" class="text-muted me-3"><i class="bi bi-instagram fs-4"></i></a>
            <a href="#" class="text-muted"><i class="bi bi-facebook fs-4"></i></a>
        </div>
      </div>
      <div class="d-flex flex-column flex-sm-row justify-content-between py-4 my-4 border-top">
        <p class="text-muted">&copy; 2025 PixelMinds, Inc. All rights reserved.</p>
      </div>
    </div>
  </footer>

  <script src="{% static 'bootstrap/dist/js/bootstrap.bundle.min.js' %}"></script>
</body>

</html>