{% extends "showcase/cabinet/base_client.html" %}
{% load i18n %}

{% block title %}My Appointments{% endblock title %}
{% block page_title %}My Appointments{% endblock page_title %}

{% block cabinet_content %}

{# ─── Stats row ─── #}
<div class="row g-3 mb-4">
  <div class="col-md-4">
    <div class="card border-0 shadow-sm h-100">
      <div class="card-body d-flex align-items-center gap-3">
        <div class="rounded-circle d-flex align-items-center justify-content-center"
             style="width:48px;height:48px;background:#ede9fe;flex-shrink:0;">
          <span class="bi bi-calendar-check fs-5" style="color:#7c3aed;"></span>
        </div>
        <div>
          <div class="text-muted" style="font-size:.75rem;">Upcoming</div>
          <div class="fw-bold fs-4">3</div>
        </div>
      </div>
    </div>
  </div>
  <div class="col-md-4">
    <div class="card border-0 shadow-sm h-100">
      <div class="card-body d-flex align-items-center gap-3">
        <div class="rounded-circle d-flex align-items-center justify-content-center"
             style="width:48px;height:48px;background:#dcfce7;flex-shrink:0;">
          <span class="bi bi-check-circle fs-5" style="color:#16a34a;"></span>
        </div>
        <div>
          <div class="text-muted" style="font-size:.75rem;">Completed</div>
          <div class="fw-bold fs-4">12</div>
        </div>
      </div>
    </div>
  </div>
  <div class="col-md-4">
    <div class="card border-0 shadow-sm h-100">
      <div class="card-body d-flex align-items-center gap-3">
        <div class="rounded-circle d-flex align-items-center justify-content-center"
             style="width:48px;height:48px;background:#fef9c3;flex-shrink:0;">
          <span class="bi bi-clock fs-5" style="color:#ca8a04;"></span>
        </div>
        <div>
          <div class="text-muted" style="font-size:.75rem;">Pending</div>
          <div class="fw-bold fs-4">1</div>
        </div>
      </div>
    </div>
  </div>
</div>

{# ─── Upcoming appointments ─── #}
<div class="card border-0 shadow-sm mb-4">
  <div class="card-header bg-white border-0 pt-3 pb-0 d-flex align-items-center justify-content-between">
    <h6 class="fw-semibold mb-0">Upcoming Appointments</h6>
    <button class="btn btn-sm btn-primary">+ Book Now</button>
  </div>
  <div class="card-body p-0">
    <table class="table table-hover mb-0">
      <thead class="table-light">
        <tr>
          <th class="ps-4" style="font-size:.75rem;font-weight:600;color:#64748b;">DATE AND TIME</th>
          <th style="font-size:.75rem;font-weight:600;color:#64748b;">SERVICE</th>
          <th style="font-size:.75rem;font-weight:600;color:#64748b;">SPECIALIST</th>
          <th style="font-size:.75rem;font-weight:600;color:#64748b;">STATUS</th>
          <th></th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td class="ps-4">
            <div class="fw-semibold">25 March 2026</div>
            <div class="text-muted" style="font-size:.8rem;">14:00 — 15:00</div>
          </td>
          <td>Haircut + styling</td>
          <td>
            <div class="d-flex align-items-center gap-2">
              <span class="rounded-circle d-flex align-items-center justify-content-center fw-bold text-white"
                    style="width:28px;height:28px;background:#7c3aed;font-size:.7rem;">AM</span>
              Anna M.
            </div>
          </td>
          <td><span class="badge" style="background:#dcfce7;color:#16a34a;">Confirmed</span></td>
          <td class="text-end pe-3">
            <button class="btn btn-sm btn-outline-secondary">Cancel</button>
          </td>
        </tr>
        <tr>
          <td class="ps-4">
            <div class="fw-semibold">1 April 2026</div>
            <div class="text-muted" style="font-size:.8rem;">11:00 — 12:30</div>
          </td>
          <td>Manicure</td>
          <td>
            <div class="d-flex align-items-center gap-2">
              <span class="rounded-circle d-flex align-items-center justify-content-center fw-bold text-white"
                    style="width:28px;height:28px;background:#3b82f6;font-size:.7rem;">OK</span>
              Olga K.
            </div>
          </td>
          <td><span class="badge" style="background:#fef9c3;color:#ca8a04;">Pending</span></td>
          <td class="text-end pe-3">
            <button class="btn btn-sm btn-outline-secondary">Cancel</button>
          </td>
        </tr>
        <tr>
          <td class="ps-4">
            <div class="fw-semibold">10 April 2026</div>
            <div class="text-muted" style="font-size:.8rem;">16:00 — 17:00</div>
          </td>
          <td>Coloring</td>
          <td>
            <div class="d-flex align-items-center gap-2">
              <span class="rounded-circle d-flex align-items-center justify-content-center fw-bold text-white"
                    style="width:28px;height:28px;background:#7c3aed;font-size:.7rem;">AM</span>
              Anna M.
            </div>
          </td>
          <td><span class="badge" style="background:#dcfce7;color:#16a34a;">Confirmed</span></td>
          <td class="text-end pe-3">
            <button class="btn btn-sm btn-outline-secondary">Cancel</button>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
</div>

{# ─── Past appointments ─── #}
<div class="card border-0 shadow-sm">
  <div class="card-header bg-white border-0 pt-3 pb-0 d-flex align-items-center justify-content-between">
    <h6 class="fw-semibold mb-0">History</h6>
    <span class="text-muted" style="font-size:.8rem;">12 records</span>
  </div>
  <div class="card-body p-0">
    <table class="table table-hover mb-0">
      <thead class="table-light">
        <tr>
          <th class="ps-4" style="font-size:.75rem;font-weight:600;color:#64748b;">Date</th>
          <th style="font-size:.75rem;font-weight:600;color:#64748b;">SERVICE</th>
          <th style="font-size:.75rem;font-weight:600;color:#64748b;">SPECIALIST</th>
          <th style="font-size:.75rem;font-weight:600;color:#64748b;">TOTAL</th>
          <th style="font-size:.75rem;font-weight:600;color:#64748b;">STATUS</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td class="ps-4 text-muted">10 March 2026</td>
          <td>Haircut</td>
          <td>Anna M.</td>
          <td>$25</td>
          <td><span class="badge" style="background:#dcfce7;color:#16a34a;">Completed</span></td>
        </tr>
        <tr>
          <td class="ps-4 text-muted">20 February 2026</td>
          <td>Manicure + pedicure</td>
          <td>Olga K.</td>
          <td>$60</td>
          <td><span class="badge" style="background:#dcfce7;color:#16a34a;">Completed</span></td>
        </tr>
        <tr>
          <td class="ps-4 text-muted">5 February 2026</td>
          <td>Coloring</td>
          <td>Anna M.</td>
          <td>$95</td>
          <td><span class="badge" style="background:#dcfce7;color:#16a34a;">Completed</span></td>
        </tr>
        <tr>
          <td class="ps-4 text-muted">18 January 2026</td>
          <td>Haircut + styling</td>
          <td>Anna M.</td>
          <td>$40</td>
          <td><span class="badge" style="background:#dcfce7;color:#16a34a;">Completed</span></td>
        </tr>
        <tr>
          <td class="ps-4 text-muted">3 January 2026</td>
          <td>Manicure</td>
          <td>Olga K.</td>
          <td>$30</td>
          <td><span class="badge" style="background:#dcfce7;color:#16a34a;">Completed</span></td>
        </tr>
        <tr>
          <td class="ps-4 text-muted">15 December 2025</td>
          <td>Coloring</td>
          <td>Anna M.</td>
          <td>$95</td>
          <td><span class="badge" style="background:#dcfce7;color:#16a34a;">Completed</span></td>
        </tr>
        <tr>
          <td class="ps-4 text-muted">28 November 2025</td>
          <td>pedicure</td>
          <td>Olga K.</td>
          <td>$35</td>
          <td><span class="badge" style="background:#dcfce7;color:#16a34a;">Completed</span></td>
        </tr>
        <tr>
          <td class="ps-4 text-muted">10 November 2025</td>
          <td>Haircut</td>
          <td>Anna M.</td>
          <td>$25</td>
          <td><span class="badge" style="background:#fee2e2;color:#dc2626;">Cancelled</span></td>
        </tr>
        <tr>
          <td class="ps-4 text-muted">22 October 2025</td>
          <td>Manicure + pedicure</td>
          <td>Olga K.</td>
          <td>$35</td>
          <td><span class="badge" style="background:#dcfce7;color:#16a34a;">Completed</span></td>
        </tr>
        <tr>
          <td class="ps-4 text-muted">5 October 2025</td>
          <td>Coloring</td>
          <td>Anna M.</td>
          <td>$60</td>
          <td><span class="badge" style="background:#dcfce7;color:#16a34a;">Completed</span></td>
        </tr>
      </tbody>
    </table>
  </div>

  {# Pagination #}
  <div class="card-footer bg-white border-0 d-flex align-items-center justify-content-between py-3 px-4">
    <span class="text-muted" style="font-size:.8rem;">Showing 10 of 12</span>
    <nav>
      <ul class="pagination pagination-sm mb-0">
        <li class="page-item disabled">
          <a class="page-link" href="#">«</a>
        </li>
        <li class="page-item active">
          <a class="page-link" href="#" style="background:var(--cab-primary);border-color:var(--cab-primary);">1</a>
        </li>
        <li class="page-item">
          <a class="page-link" href="#">2</a>
        </li>
        <li class="page-item">
          <a class="page-link" href="#">»</a>
        </li>
      </ul>
    </nav>
  </div>
</div>

{% endblock %}
