<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
  <title>Filament Price Change Summary</title>
  <style>
    .table-container {
      overflow-x: auto;
    }
    .price-drop {
      color: #28a745; /* Green for price drop */
      font-weight: bold;
    }
    .price-rise {
      color: #dc3545; /* Red for price rise */
      font-weight: bold;
    }
  </style>
</head>
<body>
  <div class="container py-5">
    <h1 class="mb-4">Filament Price Change Summary</h1>
    <p class="lead">Here's the latest update on filament prices from your tracker:</p>
    <div class="table-container">
      <table class="table table-striped table-bordered">
        <thead class="thead-dark">
          <tr>
            <th>Filament Name</th>
            <th>Brand</th>
            <th>New Price</th>
            <th>Old Price</th>
            <th>Change</th>
            <th>Amazon Link</th>
          </tr>
        </thead>
        <tbody>
          {% for filament in filaments %}
          <tr>
            <td>{{ filament.filamentName }}</td>
            <td>{{ filament.brand }}</td>
            <td>{{ filament.newPrice }}</td>
            <td>{{ filament.oldPrice }}</td>
            <td class="price-drop">{{ filament.priceChange }}</td>
            <td><a href="{{ filament.amazonUrl }}" target="_blank">View on Amazon</a></td>
          </tr>
          {% endfor %}
        </tbody>
      </table>
    </div>
    <p class="mt-4">
      Visit your <a href="{{ dashboardUrl }}" target="_blank">dashboard</a> for more details.
    </p>
  </div>
</body>
</html>
