{% extends "base.html" %}
{% block title %}Material del bootcamp — {{ nombre }}{% endblock %}

{% block content %}
<section class="descargas-section">
  <h1 class="hello">Hola {{ nombre }}</h1>
  <p class="hello-sub">Acá tienes todo el material del bootcamp.</p>

  <div class="download-cards">
    {% for d in downloads %}
    <article class="download-card">
      <div class="dl-icon-wrap">
        {% if d.icon == 'code' %}
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg>
        {% elif d.icon == 'book' %}
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"/><path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"/></svg>
        {% else %}
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>
        {% endif %}
      </div>
      <h2>{{ d.title }}</h2>
      <p>{{ d.description }}</p>
      <p class="size">{% if d.available %}{{ d.size_mb }} MB{% else %}Próximamente{% endif %}</p>
      {% if d.available %}
      <a class="btn btn-primary" href="/download/{{ d.filename }}?token={{ token }}">
        Descargar
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
      </a>
      {% else %}
      <span class="btn btn-disabled" title="Archivo aún no disponible">No disponible</span>
      {% endif %}
    </article>
    {% endfor %}
  </div>
</section>
{% endblock %}
