<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Appointment Reminder</title>
    <style>
      body {
          font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
          line-height: 1.6;
          color: #333;
          max-width: 600px;
          margin: 0 auto;
          padding: 20px;
          background-color: {{tenant.backgroundColor}};
      }
      .email-container {
          background-color: white;
          padding: 30px;
          border-radius: 8px;
          box-shadow: 0 2px 4px rgba(0,0,0,0.1);
      }
      .header {
          text-align: center;
          border-bottom: 1px solid #eee;
          padding-bottom: 20px;
          margin-bottom: 30px;
      }
      .logo {
          font-size: 24px;
          font-weight: bold;
          color: {{tenant.primaryColor}};
      }
      h1 {
          color: #1f2937;
          font-size: 24px;
          margin-bottom: 20px;
      }
      h2 {
          color: #374151;
          font-size: 20px;
          margin-bottom: 15px;
      }
      .button {
          display: inline-block;
          background-color: {{tenant.primaryColor}};
          color: white !important;
          padding: 12px 24px;
          text-decoration: none;
          border-radius: 6px;
          font-weight: 500;
          margin: 10px 5px;
      }
      .button:hover {
          background-color: #1d4ed8;
      }
      .button-cancel {
          background-color: #dc2626;
      }
      .button-cancel:hover {
          background-color: #b91c1c;
      }
      .appointment-details {
          background-color: #f8fafc;
          padding: 20px;
          border-radius: 6px;
          border-left: 4px solid {{tenant.primaryColor}};
          margin: 20px 0;
      }
      .footer {
          margin-top: 30px;
          padding-top: 20px;
          border-top: 1px solid #eee;
          font-size: 14px;
          color: #6b7280;
          text-align: center;
      }
    </style>
  </head>
  <body>
    <div class="email-container">
      <div class="header">
        {{#if tenant.logo}}
        <img
          src="data:image/png;base64,{{tenant.logo}}"
          alt="{{tenant.longName}}"
          style="max-height: 60px; margin-bottom: 10px"
        />
        {{/if}}
        <div class="logo">{{tenant.longName}}</div>
      </div>

      <h1>Appointment Reminder</h1>

      <p>Hello {{recipient.name}},</p>

      <p>This is a reminder about your upcoming appointment:</p>

      <div class="appointment-details">
        <h2>Appointment Details</h2>
        <p><strong>Date:</strong> {{appointmentDate}}</p>
        <p><strong>Time:</strong> {{appointmentTime}}</p>
        {{#if location}}
        <p><strong>Location:</strong> {{location}}</p>
        {{/if}} {{#if description}}
        <p><strong>Description:</strong> {{description}}</p>
        {{/if}}
      </div>

      <div style="text-align: center">
        {{#if cancelUrl}}
        <a href="{{cancelUrl}}" class="button button-cancel">Cancel Appointment</a>
        {{/if}}
      </div>

      <div class="footer">
        <p>We look forward to seeing you!</p>
      </div>
    </div>
  </body>
</html>
