<!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=Playfair+Display:wght@400;500;600;700&family=Open+Sans:wght@300;400;500;600&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 area - positioned in the white space */
    .content {
      position: absolute;
      top: 28mm;
      left: 0;
      right: 0;
      text-align: center;
    }

    .main-title {
      font-family: 'Playfair Display', Georgia, serif;
      font-size: 52pt;
      font-weight: 700;
      letter-spacing: 14px;
      color: #1a1a1a;
      text-transform: uppercase;
      margin-bottom: 2mm;
    }

    .subtitle {
      font-family: 'Open Sans', Arial, sans-serif;
      font-size: 18pt;
      font-weight: 400;
      color: #333;
      letter-spacing: 1px;
      margin-bottom: 18mm;
    }

    .course-section {
      margin-top: 5mm;
    }

    .course-title {
      font-family: 'Playfair Display', Georgia, serif;
      font-size: 32pt;
      font-weight: 600;
      color: #1a1a1a;
      margin-bottom: 3mm;
    }

    .course-modules {
      font-family: 'Open Sans', Arial, sans-serif;
      font-size: 13pt;
      font-weight: 500;
      color: #333;
      line-height: 1.5;
      margin-bottom: 2mm;
    }

    .course-dates {
      font-family: 'Open Sans', Arial, sans-serif;
      font-size: 12pt;
      font-weight: 400;
      color: #444;
    }

    .participant-name {
      font-family: 'Playfair Display', Georgia, serif;
      font-size: 36pt;
      font-weight: 600;
      color: #1a1a1a;
      margin-top: 14mm;
    }

    /* Footer section with signatures */
    .footer-section {
      position: absolute;
      bottom: 28mm;
      left: 25mm;
      right: 25mm;
      display: flex;
      justify-content: space-between;
      align-items: flex-end;
    }

    .date-location {
      font-family: 'Open Sans', Arial, sans-serif;
      font-size: 11pt;
      color: #333;
    }

    .signatures {
      display: flex;
      gap: 25mm;
    }

    .signature {
      text-align: center;
      min-width: 55mm;
    }

    .signature-image {
      height: 18mm;
      margin-bottom: 1mm;
      object-fit: contain;
    }

    .signature-line {
      width: 55mm;
      height: 0.4mm;
      background: #333;
      margin: 0 auto 2mm auto;
    }

    .signature-name {
      font-family: 'Open Sans', Arial, sans-serif;
      font-size: 10pt;
      font-weight: 600;
      color: #1a1a1a;
    }

    .signature-title {
      font-family: 'Open Sans', Arial, sans-serif;
      font-size: 9pt;
      font-weight: 400;
      color: #555;
    }

    .certificate-id {
      position: absolute;
      bottom: 20mm;
      right: 25mm;
      font-family: 'Open Sans', Arial, sans-serif;
      font-size: 7pt;
      color: #999;
      letter-spacing: 0.5px;
    }
  </style>
</head>
<body>
  <div class="certificate">
    <div class="content">
      <h1 class="main-title">O S V E D Č E N I E</h1>
      <p class="subtitle">o absolvovaní kurzu</p>

      <div class="course-section">
        <h2 class="course-title">{{courseTitle}}</h2>
        {{#if courseModules}}
        <p class="course-modules">{{courseModules}}</p>
        {{/if}}
        {{#if dateRange}}
        <p class="course-dates">{{dateRange}}</p>
        {{/if}}
      </div>

      <h3 class="participant-name">{{participantName}}</h3>
    </div>

    <div class="footer-section">
      <div class="date-location">
        V Bratislave {{issueDate}}
      </div>

      <div class="signatures">
        <div class="signature">
          <img src="{{signatureZdarilek}}" alt="Podpis" class="signature-image" />
          <div class="signature-line"></div>
          <p class="signature-name">Mgr. Tomáš Zdarílek</p>
          <p class="signature-title">lektor</p>
        </div>
        <div class="signature">
          <img src="{{signatureGablasova}}" alt="Podpis" class="signature-image" />
          <div class="signature-line"></div>
          <p class="signature-name">Ing. Jana Gablasová</p>
          <p class="signature-title">konateľ</p>
        </div>
      </div>
    </div>

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