<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>{% block title %}Notes Sharing Platform{% 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 %}
  
  <!-- Google Fonts -->
  <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=Lato:wght@400;700&family=Poppins:wght@600;700&display=swap" rel="stylesheet">

  <!-- Bootstrap CSS -->
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
  
  {% load static %}
  <link rel="stylesheet" href="{% static 'css/custom.css' %}?v={{ deployment_timestamp }}">
  
  {% block head %}{% endblock %}
</head>

<body>
  <nav class="navbar navbar-expand-lg navbar-light bg-light">
    <div class="container">
      <a class="navbar-brand" href="/">NotesShare</a>
      <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
        <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" href="#">My Notes</a>
            </li>
            <li class="nav-item">
              <a class="nav-link" href="#">Browse</a>
            </li>
            <li class="nav-item">
              <a class="btn btn-primary me-2" href="#">Upload</a>
            </li>
            <li class="nav-item dropdown">
              <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
                <span class="avatar">{{ user.email.0|upper }}</span>
              </a>
              <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
                <li><a class="dropdown-item" href="#">Profile</a></li>
                <li><hr class="dropdown-divider"></li>
                <li>
                  <form action="{% url 'logout' %}" method="post" class="d-inline">
                    {% csrf_token %}
                    <button type="submit" class="dropdown-item">Logout</button>
                  </form>
                </li>
              </ul>
            </li>
          {% else %}
            <li class="nav-item">
              <a class="nav-link" href="#">Browse</a>
            </li>
            <li class="nav-item">
              <a class="nav-link" href="{% url 'login' %}">Login</a>
            </li>
            <li class="nav-item">
              <a class="btn btn-primary" href="{% url 'signup' %}">Sign Up</a>
            </li>
            <li class="nav-item">
                <span class="avatar">G</span>
            </li>
          {% endif %}
        </ul>
      </div>
    </div>
  </nav>

  {% block content %}{% endblock %}

  <footer class="bg-light text-center text-lg-start mt-auto">
    <div class="container p-4">
      <p class="text-center">&copy; 2025 NotesShare. All Rights Reserved.</p>
    </div>
  </footer>

  <!-- Bootstrap JS -->
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
</body>

</html>
