{% extends 'base.html' %}
{% block content %}
<section class="hero-grid">
  <article class="card spotlight">
    <div class="section-heading">
      <div>
        <p class="eyebrow">Primary profile</p>
        <h2>{{ summary['profile']['display_name'] }} / {{ summary['profile']['persona'] }}</h2>
      </div>
      <span class="badge bronze">{{ summary['profile']['house_style'] }}</span>
    </div>
    <p class="muted">{{ summary['profile']['notes'] }}</p>
    <div class="stats-grid">
      <div><span>Agenda</span><strong>{{ summary['counts']['agenda'] }}</strong></div>
      <div><span>Reminders</span><strong>{{ summary['counts']['reminders'] }}</strong></div>
      <div><span>Lists</span><strong>{{ summary['counts']['lists'] }}</strong></div>
      <div><span>Notes</span><strong>{{ summary['counts']['notes'] }}</strong></div>
    </div>
    <div class="spotlight-visuals" aria-label="Ravenclaw common-room imagery">
      <figure class="visual-medallion framed-medallion">
        <img src="/static/images/owl-engraving.jpg" alt="Vintage owl engraving used as a scholarly crest substitute">
        <figcaption>Owl engraving crest</figcaption>
      </figure>
      <figure class="visual-medallion room-medallion">
        <img src="/static/images/blue-interior.jpg" alt="Blue-toned interior painting with elegant room details">
        <figcaption>Blue interior study corner</figcaption>
      </figure>
    </div>
  </article>

  <article class="card quick-add-card">
    <div class="section-heading">
      <div>
        <p class="eyebrow">Quick action</p>
        <h2>Capture a note before it disappears</h2>
      </div>
      <span class="badge">Minerva quick add</span>
    </div>
    <form method="post" action="/quick-actions/notes" class="stack-form">
      <label>Title
        <input type="text" name="title" placeholder="School follow-up, errand, reminder..." required>
      </label>
      <label>Note
        <textarea name="body" rows="4" placeholder="Write the useful fragment and keep moving." required></textarea>
      </label>
      <label>Category
        <input type="text" name="category" value="note" placeholder="note, reminder, meal, school">
      </label>
      <button type="submit">Save quick note</button>
    </form>
    <figure class="inline-ornament">
      <img src="/static/images/art-nouveau-frame.svg" alt="Art Nouveau ornamental frame accent">
      <figcaption>Ornamental frame accent for the quick-capture panel.</figcaption>
    </figure>
  </article>
</section>

<section class="dashboard-grid">
  <article class="card">
    <div class="section-heading"><div><p class="eyebrow">Agenda</p><h2>Today at a glance</h2></div></div>
    <ul class="timeline-list">
      {% for item in summary['agenda'] %}
      <li>
        <strong>{{ item.time_label }}</strong>
        <span>{{ item.title }}</span>
        <p class="muted">{{ item.detail }}</p>
      </li>
      {% endfor %}
    </ul>
  </article>

  <article class="card">
    <div class="section-heading"><div><p class="eyebrow">Reminders</p><h2>Loose ends</h2></div></div>
    <ul class="plain-list">
      {% for item in summary['reminders'] %}
      <li>
        <strong>{{ item.title }}</strong>
        <span class="pill subtle">{{ item.urgency }}</span>
      </li>
      {% endfor %}
    </ul>
  </article>

  <article class="card">
    <div class="section-heading"><div><p class="eyebrow">Lists</p><h2>Household lanes</h2></div></div>
      {% for block in summary['lists'] %}
    <div class="subcard">
      <h3>{{ block['title'] }}</h3>
      <ul class="check-list">
        {% for item in block['items'] %}
        <li class="{{ 'done' if item['done'] else '' }}">{{ item['label'] }}</li>
        {% endfor %}
      </ul>
    </div>
    {% endfor %}
  </article>

  <article class="card notes-card">
    <div class="section-heading"><div><p class="eyebrow">Notes</p><h2>Recent captures</h2></div></div>
    {% for item in summary['notes'][:5] %}
    <div class="note-item {{ 'pinned' if item['pinned'] else '' }}">
      <div class="note-head">
        <h3>{{ item['title'] }}</h3>
        <span class="pill subtle">{{ item['category'] }}</span>
      </div>
      <p>{{ item['body'] }}</p>
      <p class="muted tiny">{{ item['source'] }}{% if item['created_at'] %} · {{ item['created_at'] }}{% endif %}</p>
    </div>
    {% endfor %}
  </article>

  <article class="card">
    <div class="section-heading"><div><p class="eyebrow">Useful links</p><h2>Launch points</h2></div></div>
    <ul class="plain-list links-list">
      {% for item in summary['links'] %}
      <li>
        <a href="{{ item.url }}">{{ item.label }}</a>
        <p class="muted">{{ item.note }}</p>
      </li>
      {% endfor %}
    </ul>
  </article>

  <article class="card">
    <div class="section-heading"><div><p class="eyebrow">Meal ideas</p><h2>Dinner sparks</h2></div></div>
    <ul class="plain-list">
      {% for item in summary['meal_ideas'] %}
      <li>
        <strong>{{ item.title }}</strong>
        <p class="muted">{{ item.detail }}</p>
      </li>
      {% endfor %}
    </ul>
  </article>

  <article class="card">
    <div class="section-heading"><div><p class="eyebrow">Shortcuts</p><h2>Fast household moves</h2></div></div>
    <ul class="plain-list">
      {% for item in summary['shortcuts'] %}
      <li>
        <strong>{{ item.label }}</strong>
        <p class="muted">{{ item.hint }}</p>
      </li>
      {% endfor %}
    </ul>
  </article>

  <article class="card">
    <div class="section-heading"><div><p class="eyebrow">Quick actions</p><h2>Minerva prompts</h2></div></div>
    <ul class="plain-list">
      {% for item in summary['quick_actions'] %}
      <li>
        <strong>{{ item.label }}</strong>
        <p class="muted">{{ item.detail }}</p>
      </li>
      {% endfor %}
    </ul>
  </article>
</section>
{% endblock %}
