<!DOCTYPE html>
<html lang="fr">

<head>
  <meta charset="UTF-8">
  <title>Compte-rendu d'audience</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      font-size: 12px;
      margin: 0;
      padding: 0;
    }

    .stats-header {
      background-color: #13855b;
      /* bleu primaire */
      color: white;
      padding: 20px;
      border-radius: 8px;
      margin-bottom: 20px;
    }

    .report-info {
      width: 100%;
      border-collapse: collapse;
      margin-bottom: 20px;
    }

    .report-info td {
      padding: 5px;
      border: none;
      vertical-align: top;
    }

    .label {
      font-weight: bold;
      color: #555;
      width: 30%;
    }

    .content-section {
      text-align: center;
      margin-bottom: 20px;
    }

    .report-content {
      border: 1px solid #ddd;
      border-radius: 4px;
      padding: 15px;
    }

    #footer {
      position: fixed;
      bottom: -30px;
      left: 0;
      right: 0;
      text-align: center;
      font-size: 14px;
      color: #555;
    }

    .watermark {
      position: fixed;
      top: 45%;
      left: 50%;
      transform: translate(-50%, -50%) rotate(-30deg);
      font-size: 80px;
      color: #664141ff;
      opacity: 0.1;
      z-index: -1;
      pointer-events: none;
      white-space: nowrap;
    }

    table.info {
      width: 100%;
      border-collapse: collapse;
      margin-bottom: 25px;
    }

    table.info td {
      border: 1px solid #ddd;
      padding: 8px;
      vertical-align: top;
    }
  </style>
</head>

<body>

  <div class="watermark">Audience Rectorat</div>

  <!-- Header -->
  <div class="stats-header">
    <h1 style="margin:0; font-size:18px; color:white">Compte-rendu d'audience</h1>
    <small style=" color:white">Audience : {{ $report->appointment->subject ?? '—' }}</small>
  </div>

  <table class="info">
    <tr>
      <td width="33%">
        <div class="label">Requérant</div>
        {{ $report->appointment->first_name }}
        {{ $report->appointment->last_name }} <br>
        {{ $report->appointment->email }}
      </td>

      <td width="33%">
        <div class="label">Autorité</div>
        {{ optional($report->appointment->service)->name ?? '—' }}
      </td>

      <td width="34%">
        <div class="label">Greffier</div>
        {{ $report->author->name }}
      </td>
    </tr>


    <tr>
      <td>
        <div class="label">Début</div>
        {{ \Carbon\Carbon::parse($report->start_date)->format('d/m/Y H:i') }}
      </td>

      <td>
        <div class="label">Lieu</div>
        {{ $report->place ?? '—' }}
      </td>
      <td>
        <div class="label">Fin</div>
        {{ $report->end_date ? \Carbon\Carbon::parse($report->end_date)->format('d/m/Y H:i') : '—' }}
      </td>
    </tr>
  </table>

  <!-- Contenu -->
  <div class="content-section">
    <h2>Compte-rendu</h2>
    <div class="report-content">
      {!! $report->content !!}
    </div>
  </div>

  <!-- Footer -->
  <div id="footer" style="background-color:#13855b; color:white">
    Généré par Audience Rectorat
  </div>

</body>

</html>