{% extends 'adminapp/master.html' %}
{% load static %}

{% block content %}
  <div class="page-content">
    <div class="container-fluid">
      <!-- Page Title -->
      <div class="row">
        <div class="col-12">
          <div class="page-title-box">
            <h4 class="mb-0 fw-semibold">Reply to Enquiry</h4>
            <ol class="breadcrumb mb-0">
              <li class="breadcrumb-item">
                <a href="{% url 'index' %}"><i class="bi bi-house-door-fill me-1"></i>Dashboard</a>
              </li>
              <li class="breadcrumb-item">
                <a href="{% url 'manageenquiries' %}">Enquiries</a>
              </li>
              <li class="breadcrumb-item active text-primary">Reply</li>
            </ol>
          </div>
        </div>
      </div>

      <div class="row">
        <div class="col-lg-8 mx-auto">
          <div class="card">
            <div class="card-header">
              <h4 class="card-title mb-0">Enquiry Details</h4>
            </div>
            <div class="card-body">
              <p>
                <strong>From:</strong> {{ enquiry.email }}
              </p>
              <p>
                <strong>Subject:</strong> {{ enquiry.subject }}
              </p>
              <p>
                <strong>Message:</strong> {{ enquiry.message }}
              </p>

              <!-- Reply Form -->
              <form method="post">
                {% csrf_token %}
                

                <!-- Trigger Modal Button -->
                <button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#confirmModal"><i class="bx bx-send"></i> Send Reply</button>

                <a href="{% url 'manageenquiries' %}" class="btn btn-secondary"><i class="bx bx-arrow-back"></i> Cancel</a>

                <!-- Confirmation Modal -->
                <div class="modal fade" id="confirmModal" tabindex="-1" aria-labelledby="confirmModalLabel" aria-hidden="true">
                  <div class="modal-dialog">
                    <div class="modal-content">
                      <div class="modal-header">
                        <h5 class="modal-title" id="confirmModalLabel">Confirm Reply</h5>
                        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                      </div>
                      <div class="modal-body">Are you sure you want to send this reply?</div>
                      <div class="modal-footer">
                        <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
                        <button type="submit" class="btn btn-success">Yes, Send</button>
                      </div>
                    </div>
                  </div>
                </div>
              </form>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
{% endblock %}
