<!DOCTYPE html>
<html lang="sk">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Osvedčenie - {{participantName}}</title>
  <style>
    @import url('https://fonts.googleapis.com/css2?family=Bahnschrift:wght@400;600;700&family=Open+Sans:wght@300;400;500;600;700&display=swap');

    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    @page {
      size: A4 landscape;
      margin: 0;
    }

    html, body {
      width: 297mm;
      height: 210mm;
      overflow: hidden;
    }

    body {
      font-family: 'Open Sans', Arial, sans-serif;
      background: #fff;
    }

    .certificate {
      width: 297mm;
      height: 210mm;
      position: relative;
      background-image: url('{{backgroundImage}}');
      background-size: cover;
      background-position: center;
      background-repeat: no-repeat;
    }

    /* Main content - centered in the white area */
    .main-content {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      text-align: center;
      margin-top: -15mm;
    }

    .participant-name {
      font-size: 28pt;
      font-weight: 700;
      color: #1a1a1a;
      margin-bottom: 8mm;
    }

    .course-title {
      font-family: 'Bahnschrift', 'Open Sans', Arial, sans-serif;
      font-size: 24pt;
      font-weight: 700;
      color: #1a1a1a;
      margin-bottom: 4mm;
    }

    .course-dates {
      font-size: 14pt;
      font-weight: 600;
      color: #1a1a1a;
      margin-bottom: 2mm;
    }

    .course-hours {
      font-size: 14pt;
      font-weight: 600;
      color: #1a1a1a;
    }

    /* Issue date - above "Dátum" at bottom left */
    .issue-date {
      position: absolute;
      bottom: 42mm;
      left: 28mm;
      font-size: 12pt;
      color: #333;
    }

    .certificate-id {
      position: absolute;
      bottom: 10mm;
      right: 18mm;
      font-size: 7pt;
      color: #666;
    }
  </style>
</head>
<body>
  <div class="certificate">
    <div class="main-content">
      <h3 class="participant-name">{{participantName}}</h3>
      <h2 class="course-title">{{courseTitle}}</h2>
      {{#if dateRange}}
      <p class="course-dates">{{dateRange}}</p>
      {{/if}}
      {{#if courseHours}}
      <p class="course-hours">v rozsahu {{courseHours}} hodín</p>
      {{/if}}
    </div>

    <div class="issue-date">{{issueDate}}</div>
    <div class="certificate-id">ID: {{certificateId}}</div>
  </div>
</body>
</html>
