/**
 * Shared base layout for all Airpero platform (SaaS) emails.
 * Wraps any HTML content in the branded header, warning bar, and footer.
 *
 * @param {string} htmlContent - The inner content to inject into the card
 * @param {string} title - The HTML <title> for the email
 */
export const baseEmailLayout = ({ htmlContent, title = "Airpero Platform" }) => `<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>${title}</title>
  <style>
    /* ─── RESET ─── */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    body {
      font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
      background-color: #0d0d1a;
      -webkit-font-smoothing: antialiased;
    }

    /* ─── WRAPPER ─── */
    .email-wrapper { width: 100%; padding: 32px 16px; }
    .email-card {
      max-width: 600px;
      margin: 0 auto;
      background: #ffffff;
      border-radius: 12px;
      overflow: hidden;
      box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    }

    /* ─── HEADER ─── */
    .email-header {
      background: linear-gradient(135deg, #1a0533 0%, #2d0a5e 50%, #0f0826 100%);
      padding: 28px 40px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 2px solid #7c3aed;
    }
    .email-header .brand-name {
      font-size: 26px;
      font-weight: 800;
      color: #ffffff;
      letter-spacing: 0.5px;
    }
    .email-header .brand-name span { color: #a78bfa; }
    .email-header .badge {
      font-size: 11px;
      font-weight: 600;
      color: #a78bfa;
      background: rgba(124, 58, 237, 0.15);
      border: 1px solid rgba(167, 139, 250, 0.3);
      border-radius: 20px;
      padding: 4px 12px;
      letter-spacing: 0.5px;
      text-transform: uppercase;
    }

    /* ─── CONTENT ─── */
    .email-content {
      background: #fff;
      padding: 40px;
      color: #1a1a2e;
    }
    .email-content p {
      font-size: 15px;
      line-height: 1.75;
      color: #444;
      margin-bottom: 16px;
    }
    .email-content strong { color: #1a1a2e; }

    /* ─── WARNING STRIP ─── */
    .email-warning {
      background: linear-gradient(135deg, #2d0a5e, #1a0533);
      padding: 18px 40px;
      border-top: 1px solid rgba(167, 139, 250, 0.2);
    }
    .email-warning p {
      font-size: 12.5px;
      color: rgba(255,255,255,0.8);
      line-height: 1.6;
    }
    .email-warning strong { color: #a78bfa; }

    /* ─── FOOTER ─── */
    .email-footer {
      background: #0f0826;
      padding: 24px 40px;
      text-align: center;
      border-top: 1px solid rgba(167, 139, 250, 0.15);
    }
    .email-footer p {
      font-size: 12px;
      color: rgba(255,255,255,0.4);
      line-height: 1.6;
    }
    .email-footer a { color: #a78bfa; text-decoration: none; }

    /* ─── RESPONSIVE ─── */
    @media screen and (max-width: 600px) {
      .email-wrapper { padding: 12px 8px; }
      .email-header { padding: 20px 20px; }
      .email-content { padding: 28px 20px; }
      .email-warning { padding: 16px 20px; }
      .email-footer { padding: 20px; }
    }
  </style>
</head>
<body>
  <div class="email-wrapper">
    <div class="email-card">

      <!-- HEADER -->
      <div class="email-header">
        <span class="brand-name">Air<span>pero</span></span>
        <span class="badge">Merchant Platform</span>
      </div>

      <!-- MAIN CONTENT -->
      <div class="email-content">
        ${htmlContent}
      </div>

      <!-- SECURITY WARNING -->
      <div class="email-warning">
        <p>
          <strong>🔒 Security Notice:</strong> Airpero will never ask for your password, PIN, or secret key via email.
          If you did not request this email, please ignore it and consider
          <a href="mailto:support@airpero.com" style="color:#a78bfa;">contacting support</a>.
        </p>
      </div>

      <!-- FOOTER -->
      <div class="email-footer">
        <p>
          © ${new Date().getFullYear()} Airpero Inc. All rights reserved.<br />
          <a href="https://airpero.com">airpero.com</a> &nbsp;·&nbsp;
          <a href="mailto:support@airpero.com">support@airpero.com</a>
        </p>
      </div>

    </div>
  </div>
</body>
</html>`;
