<!DOCTYPE html>
<html lang="fr">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Modifier Réclamation</title>
  <style>
    body {
      font-family: 'Arial', sans-serif;
      background-color: #f4f4f9;
      color: #333;
      margin: 0;
      padding: 20px;
    }

    h2 {
      text-align: center;
      color: #4a90e2;
    }

    .container {
      max-width: 800px;
      margin: 0 auto;
      background-color: #fff;
      padding: 20px;
      border-radius: 8px;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }

    table {
      width: 100%;
      border-collapse: collapse;
      margin-bottom: 20px;
    }

    table th, table td {
      padding: 12px;
      border: 1px solid #ddd;
      text-align: left;
    }

    table th {
      background-color: #4a90e2;
      color: white;
      font-weight: bold;
    }

    table tr:nth-child(even) {
      background-color: #f9f9f9;
    }

    table tr:hover {
      background-color: #f1f1f1;
    }

    input[type="text"] {
      width: 100%;
      padding: 8px;
      border: 1px solid #ccc;
      border-radius: 4px;
      font-size: 14px;
    }

    button {
      display: block;
      width: 100%;
      padding: 12px;
      background-color: #4a90e2;
      color: white;
      border: none;
      border-radius: 4px;
      font-size: 16px;
      cursor: pointer;
      transition: background-color 0.3s;
    }

    button:hover {
      background-color: #357abd;
    }

    @media (max-width: 600px) {
      table th, table td {
        font-size: 14px;
        padding: 10px;
      }

      input[type="text"] {
        font-size: 12px;
      }

      button {
        font-size: 14px;
        padding: 10px;
      }
    }
  </style>
</head>
<body>
  <div class="container">
    <h2>Modifier Réclamation</h2>
    
    <form action="/details/<%= reclamationId %>/update" method="POST">
      <table>
        <thead>
          <tr>
            <th>Code</th>
            <th>Avis Qualité</th>
          </tr>
        </thead>
        <tbody>
          <% for(let i = 0; i < codes.length; i++) { %>
            <tr>
              <td><%= codes[i] %></td>
              <td><textarea type="text" name="avisqualite[]" value="<%= avis[i] %>" cols="20" rows="10"><%= avis[i] %></textarea></td>
            </tr>
          <% } %>
        </tbody>
      </table>
      <button type="submit" style="margin-bottom: 30px;">Modifier</button>
      <a href="/rapports" style="text-decoration: none;"><input type="button">Retour</a>
    </form>
  </div>
</body>
</html>
