<script>
  import { t } from '$lib/translations';
  import { PUBLIC_IMAGE_BASE_URL } from '$env/static/public';
  import { isMobile } from '$lib/utils/isMobile';

  import BuyMeACoffeeIcon from '$lib/components/icons/BuyMeACoffeeIcon.svelte';
  import Head from '$lib/components/Head.svelte';

  const backgroundImage = isMobile()
    ? `${PUBLIC_IMAGE_BASE_URL}/t/f_webp/embroidery-viewer/route-wallpaper-mobile.webp`
    : `${PUBLIC_IMAGE_BASE_URL}/t/f_webp,w_1920,h_1080/embroidery-viewer/route-wallpaper.webp`;
</script>

<Head
  title="support-us.seo.title"
  description="support-us.seo.description"
  keywords="support-us.seo.keywords"
  url="support-us.seo.url"
/>

<section aria-labelledby="support-us">
  <div
    class="heading-container"
    style={`background: url(${backgroundImage}) center/cover no-repeat`}
  >
    <div class="overlay">
      <h1 id="support-us">{$t('support-us.title')}</h1>
      <p>
        <!-- eslint-disable-next-line svelte/no-at-html-tags -->
        {@html $t('support-us.description')}
      </p>

      <a
        class="bmac-button"
        href="https://buymeacoffee.com/embroideryviewerxyz"
        target="_blank"
      >
        <BuyMeACoffeeIcon size={30} />
        {$t('support-us.cta')}
      </a>
    </div>
  </div>
</section>

<style>
  .bmac-button {
    display: flex;
    align-items: center;
    text-decoration: none;
    background-color: #ffdd03;
    border: none;
    padding: 15px 20px;
    border-radius: 15px;
    font-weight: 700;
    color: black;
    gap: 10px;
    transition: transform 0.3s ease;
    margin-top: 100px;
  }

  .bmac-button:hover {
    transform: scale(1.1);
  }
  .heading-container {
    position: relative;
    z-index: 0;
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80%;
    z-index: 1;
    text-align: center;
    margin-bottom: 100px;
  }

  .heading-container h1 {
    font-size: clamp(3.5rem, 4vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
    margin-top: 0;
  }

  p {
    font-size: 1.4rem;
    line-height: 1.5;
  }

  strong {
    font-weight: 900;
  }

  @media (max-width: 768px) {
    .heading-container {
      width: 100%;
    }
    .heading-container h1 {
      font-size: clamp(2.5rem, 4vw, 3rem);
    }
    .bmac-button {
      margin-top: 20px;
    }

    p {
      font-size: 1rem;
    }
  }
</style>
