<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Irrelevante 3 Years</title>
<link rel="icon" type="image/png" href="assets/logoirr.png">
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700;900&display=swap" rel="stylesheet">

<script>
tailwind.config = {
  theme: {
    extend: {
      colors: { primary: "#e02020" },
      fontFamily: { poppins: ["Poppins", "sans-serif"] }
    }
  }
}
</script>
<meta name="referrer" content="no-referrer-when-downgrade">
<style>
.custom-scroll::-webkit-scrollbar{
width:6px;
}

.custom-scroll::-webkit-scrollbar-track{
background:transparent;
}

.custom-scroll::-webkit-scrollbar-thumb{
background:#e02020;
border-radius:999px;
}

.custom-scroll::-webkit-scrollbar-thumb:hover{
background:#ff3a3a;
}

.custom-scroll{
scrollbar-width:thin;
scrollbar-color:#e02020 transparent;
}
</style>
</head>

<body class="bg-black text-white font-poppins overflow-x-hidden scroll-smooth">

<header class="fixed top-0 w-full z-50 bg-zinc-950 border-b border-zinc-900 shadow-lg shadow-black/40">
  <div class="max-w-7xl mx-auto px-4 md:px-6 flex items-center justify-between h-16 md:h-24">

    <a href="/">
      <img src="assets/logoirr.png" class="w-12 md:w-20 lg:w-24 object-contain">
    </a>
    
    <nav class="hidden md:flex gap-10 text-sm font-medium text-gray-400">
    <a href="/status" class="hover:text-primary transition">Status</a>
    <a href="/authentication" class="hover:text-primary transition">2FA Authenticator</a>
      <a href="/features" class="hover:text-primary transition">Funcionalidades</a>
      <a href="/pricing" class="hover:text-primary transition">Preços</a>
      <a href="/faq" class="hover:text-primary transition">FAQ</a>
    </nav>

    <div class="hidden md:flex items-center gap-4 relative">

<a href="https://discord.gg/irrelevante" target="_blank"
  class="border border-zinc-700 px-5 py-2.5 rounded-lg text-sm hover:border-primary hover:bg-primary/10 transition inline-block">
  Discord
</a>

      <div class="relative">
    <button id="authButton"
    class="flex items-center gap-2 border border-zinc-700 px-5 py-2 rounded-lg text-sm hover:border-primary hover:bg-primary/10 transition">
    </button>

        <div id="authDropdown"
          class="absolute right-0 mt-2 w-40 bg-zinc-900 border border-zinc-800 rounded-xl shadow-xl hidden opacity-0 scale-95 transition-all duration-200 origin-top-right">
          <a href="/profile" class="block px-4 py-3 text-sm hover:bg-zinc-800 rounded-t-xl transition">
            Perfil
          </a>
          <button id="logoutBtn"
            class="w-full text-left px-4 py-3 text-sm hover:bg-zinc-800 rounded-b-xl transition">
            Sair
          </button>
        </div>
      </div>

    </div>

    <button id="menuBtn" class="md:hidden text-white text-3xl leading-none">
  ☰
</button>
  </div>

<div id="mobileMenu" class="fixed inset-0 z-40 hidden md:hidden">

  <div id="mobileOverlay" class="absolute inset-0 bg-black opacity-0 transition-opacity duration-300"></div>

  <div id="mobileDrawer"
    class="absolute right-0 top-0 h-full w-80 max-w-[85%] bg-black border-l border-zinc-800 translate-x-full transition-transform duration-300 flex flex-col">

    <div class="px-6 py-6 border-b border-zinc-800 flex items-center justify-between">
      <img src="assets/logoirr.png" class="w-10">
      <button id="closeMobile" class="text-white text-3xl leading-none">×</button>
    </div>

    <div class="flex flex-col gap-6 px-6 py-8 text-gray-300 text-lg">
    <a href="/status" class="hover:text-primary transition">Status</a>
<a href="/authentication" class="hover:text-primary transition">2FA Authenticator</a>
      <a href="/features" class="hover:text-primary transition">Funcionalidades</a>
      <a href="/pricing" class="hover:text-primary transition">Preços</a>
      <a href="/faq" class="hover:text-primary transition">FAQ</a>

<a href="https://discord.gg/irrelevante" target="_blank"
  class="mt-4 inline-block border border-zinc-700 px-5 py-3 rounded-xl hover:border-primary transition">
  Discord
</a>

      <div id="mobileAuthArea" class="mt-6"></div>
    </div>

  </div>
</div>
</header>

<section id="home" class="min-h-screen flex items-center relative overflow-hidden pt-24 md:pt-32">

<!-- Background Logo -->
<div class="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 opacity-10 pointer-events-none z-0">
<img src="assets/logoirrapagadavermelha.png"
class="w-[260px] sm:w-[380px] md:w-[700px] lg:w-[500px]
scale-100 md:scale-[2.5] lg:scale-[3]">
</div>

<div class="relative z-10 max-w-7xl mx-auto px-4 md:px-6 grid md:grid-cols-[1fr_560px] gap-20 items-center">

<!-- LEFT SIDE -->
<div class="text-center md:text-left mt-6 md:mt-0 relative">

<div class="absolute -z-10 top-10 left-1/2 md:left-0 -translate-x-1/2 md:translate-x-0">
<div class="w-[280px] h-[280px] md:w-[500px] md:h-[500px] bg-primary/25 rounded-full blur-[130px]"></div>
</div>

<img src="assets/logoirr.png"
class="w-32 sm:w-40 md:w-56 mx-auto md:mx-0 mb-6">

<h1 class="text-3xl sm:text-4xl md:text-5xl lg:text-6xl font-extrabold leading-tight tracking-tight max-w-2xl">
Controle total.
<span class="block text-primary drop-shadow-[0_0_20px_rgba(224,32,32,0.6)]">
Performance máxima.
</span>
<span class="block text-white/80">
Resultado superior.
</span>
</h1>

<p class="text-gray-400 mt-6 max-w-md md:max-w-xl mx-auto md:mx-0 text-base md:text-lg leading-relaxed">
Tecnologia avançada, desempenho otimizado e recursos exclusivos
desenvolvidos para elevar sua performance a um novo patamar.
</p>

<div class="flex flex-col sm:flex-row gap-4 mt-8 justify-center md:justify-start">

<a href="https://youtu.be/U_WW8LXyABQ"
target="_blank"
class="border border-zinc-700 px-6 py-3 md:px-8 md:py-4 rounded-xl hover:border-primary transition w-full sm:w-auto inline-flex items-center justify-center">
Ver Demonstração
</a>

</div>

</div>

<!-- RIGHT SIDE COMMUNITY CARD -->
<div class="hidden md:block">

<div class="relative bg-gradient-to-b from-zinc-900/90 via-black to-black
border border-zinc-800 rounded-2xl p-10 shadow-2xl shadow-black/60 overflow-hidden">

<!-- Glow vermelho -->
<div class="absolute -top-20 -right-20 w-72 h-72 bg-primary/20 blur-[120px] rounded-full"></div>
<div class="absolute -bottom-20 -left-20 w-72 h-72 bg-primary/10 blur-[120px] rounded-full"></div>

<!-- Logo fundo -->
<div class="absolute inset-0 flex items-center justify-center pointer-events-none opacity-25">
<img src="assets/logoirrapagadavermelha.png"
class="w-[520px] translate-y-16 select-none">
</div>

<div class="relative z-10">
<h3 class="flex items-center justify-center gap-1 text-lg font-semibold tracking-wider mb-6 text-primary">

<img src="assets/logoirr.png"
class="w-14 h-14 object-contain opacity-70">

<span>Founders</span>

</h3>

<div id="foundersList" class="flex justify-center gap-10 mb-8"></div>

<div class="w-full h-px bg-gradient-to-r from-transparent via-zinc-700 to-transparent my-8"></div>

<h3 class="flex items-center justify-center gap-3 text-lg font-semibold tracking-wider mb-6 text-primary">

<svg xmlns="http://www.w3.org/2000/svg"
class="w-6 h-6 flex-shrink-0"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round">

<path d="M17 21v-2a4 4 0 0 0-3-3.87"/>
<path d="M7 21v-2a4 4 0 0 1 3-3.87"/>
<circle cx="12" cy="7" r="4"/>
<path d="M23 21v-2a4 4 0 0 0-3-3.87"/>
<path d="M1 21v-2a4 4 0 0 1 3-3.87"/>

</svg>

<span>Members</span>

</h3>

<div class="max-h-[220px] overflow-y-auto custom-scroll pr-2">
  <div id="membersList"
  class="grid grid-cols-4 gap-x-6 gap-y-6 justify-items-center">
  </div>
</div>
</div>

</div>

</div>

</div>

</section>

<section id="features" class="py-0 md:py-24 bg-zinc-950">
  <div class="max-w-7xl mx-auto px-4 md:px-6 text-center">
    <h2 class="text-2xl md:text-4xl font-bold mb-10 md:mb-12">Funcionalidades</h2>
    <div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-6 md:gap-8">
      <div class="bg-zinc-900 p-6 md:p-8 rounded-2xl border border-zinc-800 hover:border-primary transition">
        <h3 class="text-lg md:text-xl font-semibold mb-4">Interface Moderna</h3>
        <p class="text-gray-400">Design limpo, responsivo e otimizado para performance.</p>
      </div>
      <div class="bg-zinc-900 p-6 md:p-8 rounded-2xl border border-zinc-800 hover:border-primary transition">
        <h3 class="text-lg md:text-xl font-semibold mb-4">Atualizações Frequentes</h3>
        <p class="text-gray-400">Sistema constantemente atualizado com novos recursos.</p>
      </div>
      <div class="bg-zinc-900 p-6 md:p-8 rounded-2xl border border-zinc-800 hover:border-primary transition">
        <h3 class="text-lg md:text-xl font-semibold mb-4">Suporte Premium</h3>
        <p class="text-gray-400">Equipe dedicada pronta para ajudar você.</p>
      </div>
    </div>
  </div>
</section>

<section id="pricing" class="py-20 md:py-24 bg-black">
  <div class="max-w-[1400px] mx-auto px-4 md:px-6 text-center">
    <h2 class="text-2xl md:text-4xl font-bold mb-4">Planos e Preços</h2>
    <p class="text-gray-400 mb-12 md:mb-16">Escolha o plano ideal para suas necessidades</p>

    <!-- PC mais "gordinho": gap menor no md -->
    <div class="grid grid-cols-1 md:grid-cols-3 gap-8 md:gap-8">

      <!-- 3 DAYS -->
      <div class="bg-zinc-900 border border-zinc-800 rounded-2xl p-6 md:p-8 text-left hover:border-primary hover:shadow-xl hover:shadow-red-500/20 hover:-translate-y-2 transition-all">
        <h3 class="text-xl md:text-2xl font-semibold mb-3">FiveM Generator Diário</h3>
        <p class="text-gray-400 mb-5 md:mb-4">Tem direito de acesso por 1 dia ao programa</p>

        <div class="flex items-end gap-2 mb-6 md:mb-5">
          <span class="text-3xl md:text-4xl font-bold">R$11.99</span>
          <span class="text-gray-400">/ único</span>
        </div>

        <ul class="space-y-4 md:space-y-3 mb-7 md:mb-7">
          <li class="flex items-center gap-3">
            <svg class="w-5 h-5 text-primary flex-shrink-0" viewBox="0 0 24 24" fill="currentColor">
              <path d="M10.49 15.51c-.2 0-.39-.08-.53-.22L7.45 12.78a.75.75 0 111.06-1.06l1.98 1.98 4.99-4.99a.75.75 0 111.06 1.06l-5.52 5.52c-.14.14-.33.22-.53.22z"/>
            </svg>
            Acesso completo a todas as funcionalidades
          </li>

          <li class="flex items-center gap-3">
            <svg class="w-5 h-5 text-primary flex-shrink-0" viewBox="0 0 24 24" fill="currentColor">
              <path d="M10.49 15.51c-.2 0-.39-.08-.53-.22L7.45 12.78a.75.75 0 111.06-1.06l1.98 1.98 4.99-4.99a.75.75 0 111.06 1.06l-5.52 5.52c-.14.14-.33.22-.53.22z"/>
            </svg>
            Suporte exclusivo em nosso servidor oficial no Discord
          </li>

          <li class="flex items-center gap-3">
            <svg class="w-5 h-5 text-primary flex-shrink-0" viewBox="0 0 24 24" fill="currentColor">
              <path d="M10.49 15.51c-.2 0-.39-.08-.53-.22L7.45 12.78a.75.75 0 111.06-1.06l1.98 1.98 4.99-4.99a.75.75 0 111.06 1.06l-5.52 5.52c-.14.14-.33.22-.53.22z"/>
            </svg>
            Experiência completa e otimizada
          </li>

          <li class="flex items-center gap-3">
            <svg class="w-5 h-5 text-primary flex-shrink-0" viewBox="0 0 24 24" fill="currentColor">
              <path d="M10.49 15.51c-.2 0-.39-.08-.53-.22L7.45 12.78a.75.75 0 111.06-1.06l1.98 1.98 4.99-4.99a.75.75 0 111.06 1.06l-5.52 5.52c-.14.14-.33.22-.53.22z"/>
            </svg>
            Geração ilimitada de contas Rockstar
          </li>

          <li class="flex items-center gap-3">
            <svg class="w-5 h-5 text-primary flex-shrink-0" viewBox="0 0 24 24" fill="currentColor">
              <path d="M10.49 15.51c-.2 0-.39-.08-.53-.22L7.45 12.78a.75.75 0 111.06-1.06l1.98 1.98 4.99-4.99a.75.75 0 111.06 1.06l-5.52 5.52c-.14.14-.33.22-.53.22z"/>
            </svg>
            Geração ilimitada de contas Steam
          </li>
        </ul>

        <button
          class="buy-btn w-full bg-primary py-3 md:py-3.5 rounded-lg font-semibold
hover:opacity-90 hover:scale-[1.02] active:scale-[0.98]
transition-all duration-200 shadow-lg shadow-red-500/20"
          data-plan="threedays">
          Comprar Agora
        </button>
      </div>

      <!-- WEEKLY -->
      <div class="bg-zinc-900 border border-zinc-800 rounded-2xl p-6 md:p-8 text-left hover:border-primary hover:shadow-xl hover:shadow-red-500/20 hover:-translate-y-2 transition-all">
        <h3 class="text-xl md:text-2xl font-semibold mb-3">FiveM Generator Semanal</h3>
        <p class="text-gray-400 mb-5 md:mb-4">Tem direito de acesso por 7 dias ao programa</p>

        <div class="flex items-end gap-2 mb-6 md:mb-5">
          <span class="text-3xl md:text-4xl font-bold">R$69.90</span>
          <span class="text-gray-400">/ único</span>
        </div>

        <ul class="space-y-4 md:space-y-3 mb-7 md:mb-7">
          <li class="flex items-center gap-3">
            <svg class="w-5 h-5 text-primary flex-shrink-0" viewBox="0 0 24 24" fill="currentColor">
              <path d="M10.49 15.51c-.2 0-.39-.08-.53-.22L7.45 12.78a.75.75 0 111.06-1.06l1.98 1.98 4.99-4.99a.75.75 0 111.06 1.06l-5.52 5.52c-.14.14-.33.22-.53.22z"/>
            </svg>
            Acesso completo a todas as funcionalidades
          </li>

          <li class="flex items-center gap-3">
            <svg class="w-5 h-5 text-primary flex-shrink-0" viewBox="0 0 24 24" fill="currentColor">
              <path d="M10.49 15.51c-.2 0-.39-.08-.53-.22L7.45 12.78a.75.75 0 111.06-1.06l1.98 1.98 4.99-4.99a.75.75 0 111.06 1.06l-5.52 5.52c-.14.14-.33.22-.53.22z"/>
            </svg>
            Suporte exclusivo em nosso servidor oficial no Discord
          </li>

          <li class="flex items-center gap-3">
            <svg class="w-5 h-5 text-primary flex-shrink-0" viewBox="0 0 24 24" fill="currentColor">
              <path d="M10.49 15.51c-.2 0-.39-.08-.53-.22L7.45 12.78a.75.75 0 111.06-1.06l1.98 1.98 4.99-4.99a.75.75 0 111.06 1.06l-5.52 5.52c-.14.14-.33.22-.53.22z"/>
            </svg>
            Experiência completa e otimizada
          </li>

          <li class="flex items-center gap-3">
            <svg class="w-5 h-5 text-primary flex-shrink-0" viewBox="0 0 24 24" fill="currentColor">
              <path d="M10.49 15.51c-.2 0-.39-.08-.53-.22L7.45 12.78a.75.75 0 111.06-1.06l1.98 1.98 4.99-4.99a.75.75 0 111.06 1.06l-5.52 5.52c-.14.14-.33.22-.53.22z"/>
            </svg>
            Geração ilimitada de contas Rockstar
          </li>

          <li class="flex items-center gap-3">
            <svg class="w-5 h-5 text-primary flex-shrink-0" viewBox="0 0 24 24" fill="currentColor">
              <path d="M10.49 15.51c-.2 0-.39-.08-.53-.22L7.45 12.78a.75.75 0 111.06-1.06l1.98 1.98 4.99-4.99a.75.75 0 111.06 1.06l-5.52 5.52c-.14.14-.33.22-.53.22z"/>
            </svg>
            Geração ilimitada de contas Steam
          </li>
        </ul>

        <button
          class="buy-btn w-full bg-primary py-3 md:py-3.5 rounded-lg font-semibold
hover:opacity-90 hover:scale-[1.02] active:scale-[0.98]
transition-all duration-200 shadow-lg shadow-red-500/20"
          data-plan="weekly">
          Comprar Agora
        </button>
      </div>

      <!-- MONTHLY (POPULAR) -->
      <div class="relative bg-zinc-900 border border-primary rounded-2xl p-6 md:p-8 text-left shadow-lg shadow-primary/10 hover:shadow-2xl hover:shadow-red-500/30 hover:-translate-y-2 transition-all">
        <div class="absolute -top-4 left-1/2 -translate-x-1/2 bg-primary px-4 py-1 rounded-full text-sm font-semibold">Mais Popular</div>

        <h3 class="text-xl md:text-2xl font-semibold mb-3 mt-4">FiveM Generator Mensal</h3>
        <p class="text-gray-400 mb-5 md:mb-4">Tem direito de acesso por 31 dias ao programa</p>

        <div class="flex items-end gap-2 mb-6 md:mb-5">
          <span class="text-3xl md:text-4xl font-bold">R$129.90</span>
          <span class="text-gray-400">/ único</span>
        </div>

        <ul class="space-y-4 md:space-y-3 mb-7 md:mb-7">
          <li class="flex items-center gap-3">
            <svg class="w-5 h-5 text-primary flex-shrink-0" viewBox="0 0 24 24" fill="currentColor">
              <path d="M10.49 15.51c-.2 0-.39-.08-.53-.22L7.45 12.78a.75.75 0 111.06-1.06l1.98 1.98 4.99-4.99a.75.75 0 111.06 1.06l-5.52 5.52c-.14.14-.33.22-.53.22z"/>
            </svg>
            Acesso completo a todas as funcionalidades
          </li>

          <li class="flex items-center gap-3">
            <svg class="w-5 h-5 text-primary flex-shrink-0" viewBox="0 0 24 24" fill="currentColor">
              <path d="M10.49 15.51c-.2 0-.39-.08-.53-.22L7.45 12.78a.75.75 0 111.06-1.06l1.98 1.98 4.99-4.99a.75.75 0 111.06 1.06l-5.52 5.52c-.14.14-.33.22-.53.22z"/>
            </svg>
            Suporte exclusivo em nosso servidor oficial no Discord
          </li>

          <li class="flex items-center gap-3">
            <svg class="w-5 h-5 text-primary flex-shrink-0" viewBox="0 0 24 24" fill="currentColor">
              <path d="M10.49 15.51c-.2 0-.39-.08-.53-.22L7.45 12.78a.75.75 0 111.06-1.06l1.98 1.98 4.99-4.99a.75.75 0 111.06 1.06l-5.52 5.52c-.14.14-.33.22-.53.22z"/>
            </svg>
            Experiência completa e otimizada
          </li>

          <li class="flex items-center gap-3">
            <svg class="w-5 h-5 text-primary flex-shrink-0" viewBox="0 0 24 24" fill="currentColor">
              <path d="M10.49 15.51c-.2 0-.39-.08-.53-.22L7.45 12.78a.75.75 0 111.06-1.06l1.98 1.98 4.99-4.99a.75.75 0 111.06 1.06l-5.52 5.52c-.14.14-.33.22-.53.22z"/>
            </svg>
            Geração ilimitada de contas Rockstar
          </li>

          <li class="flex items-center gap-3">
            <svg class="w-5 h-5 text-primary flex-shrink-0" viewBox="0 0 24 24" fill="currentColor">
              <path d="M10.49 15.51c-.2 0-.39-.08-.53-.22L7.45 12.78a.75.75 0 111.06-1.06l1.98 1.98 4.99-4.99a.75.75 0 111.06 1.06l-5.52 5.52c-.14.14-.33.22-.53.22z"/>
            </svg>
            Geração ilimitada de contas Steam
          </li>
        </ul>

        <button
          class="buy-btn w-full bg-primary py-3 md:py-3.5 rounded-lg font-semibold
hover:opacity-90 hover:scale-[1.02] active:scale-[0.98]
transition-all duration-200 shadow-lg shadow-red-500/20"
          data-plan="monthly">
          Comprar Agora
        </button>
      </div>

    </div>
  </div>
</section>

<section id="faq" class="py-20 md:py-24 bg-zinc-950">
  <div class="max-w-4xl mx-auto px-4 md:px-6">
    <h2 class="text-2xl md:text-4xl font-bold mb-10 md:mb-12 text-center">FAQ</h2>
    <div class="space-y-4 md:space-y-6">
      <div class="border border-zinc-800 rounded-xl p-5 md:p-6 bg-zinc-900/60 hover:border-primary hover:shadow-lg hover:shadow-red-500/20 hover:-translate-y-1 transition-all">
        <h3 class="font-semibold mb-2">É seguro usar?</h3>
        <p class="text-gray-400">Sim, utilizamos métodos avançados para garantir segurança.</p>
      </div>
      <div class="border border-zinc-800 rounded-xl p-5 md:p-6 bg-zinc-900/60 hover:border-primary hover:shadow-lg hover:shadow-red-500/20 hover:-translate-y-1 transition-all">
        <h3 class="font-semibold mb-2">Tem suporte?</h3>
        <p class="text-gray-400">Sim, oferecemos suporte via Discord.</p>
      </div>
    </div>
  </div>
</section>

<footer class="py-8 md:py-10 border-t border-zinc-900 text-center text-gray-500 text-xs md:text-sm">
  © 2026 Irrelevante. Todos os direitos reservados.
</footer>

<script>
document.addEventListener("DOMContentLoaded", () => {

    const menuBtn = document.getElementById("menuBtn");
    const mobileMenu = document.getElementById("mobileMenu");
    const mobileDrawer = document.getElementById("mobileDrawer");
    const mobileOverlay = document.getElementById("mobileOverlay");
    const closeMobile = document.getElementById("closeMobile");

  const authButton = document.getElementById("authButton");
  const authDropdown = document.getElementById("authDropdown");
  const logoutBtn = document.getElementById("logoutBtn");
  const mobileAuthArea = document.getElementById("mobileAuthArea");

  menuBtn?.addEventListener("click", () => {
    mobileMenu.classList.remove("hidden");
    requestAnimationFrame(() => {
      mobileOverlay.classList.remove("opacity-0");
      mobileOverlay.classList.add("opacity-100");
      mobileDrawer.classList.remove("translate-x-full");
      mobileDrawer.classList.add("translate-x-0");
    });
  });

function openDrawer() {
  mobileMenu.classList.remove("hidden");
  requestAnimationFrame(() => {
    mobileOverlay.classList.remove("opacity-0");
    mobileOverlay.classList.add("opacity-100");
    mobileDrawer.classList.remove("translate-x-full");
    mobileDrawer.classList.add("translate-x-0");
  });
}

function closeDrawer() {
  mobileOverlay.classList.remove("opacity-100");
  mobileOverlay.classList.add("opacity-0");
  mobileDrawer.classList.remove("translate-x-0");
  mobileDrawer.classList.add("translate-x-full");
  setTimeout(() => {
    mobileMenu.classList.add("hidden");
  }, 300);
}

menuBtn?.addEventListener("click", openDrawer);
closeMobile?.addEventListener("click", closeDrawer);
mobileOverlay?.addEventListener("click", closeDrawer);

mobileDrawer?.addEventListener("click", (e) => {
  e.stopPropagation();
});



  function toggleDropdown(e) {
    e?.stopPropagation();
    if (authDropdown.classList.contains("hidden")) {
      authDropdown.classList.remove("hidden");
      requestAnimationFrame(() => {
        authDropdown.classList.remove("opacity-0","scale-95");
        authDropdown.classList.add("opacity-100","scale-100");
      });
    } else {
      authDropdown.classList.add("opacity-0","scale-95");
      setTimeout(() => authDropdown.classList.add("hidden"), 200);
    }
  }

  document.addEventListener("click", () => {
    authDropdown?.classList.add("opacity-0","scale-95");
    setTimeout(() => authDropdown?.classList.add("hidden"), 200);
  });

  authDropdown?.addEventListener("click", e => e.stopPropagation());

  async function logout() {
    await fetch("/api/logout", { method: "POST" });
    window.location.reload();
  }

  logoutBtn?.addEventListener("click", logout);

  function setupGuest() {
    authButton.textContent = "Login";
    authButton.onclick = () => window.location.href = "/login";
    mobileAuthArea.innerHTML = `
      <a href="/login" class="bg-primary px-6 py-3 rounded-lg text-center font-semibold">
        Login
      </a>
    `;
  }

function setupLoggedUser(user) {

  const username = user.username || user.discordUsername || "Usuário";

  let avatarHtml = `
    <div class="w-6 h-6 bg-primary/20 text-primary flex items-center justify-center rounded-md text-xs font-bold">
      ${username.charAt(0).toUpperCase()}
    </div>
  `;

  if (user.discordId && user.discordAvatar) {
    const isAnimated = user.discordAvatar.startsWith("a_");

    const avatarUrl = `https://cdn.discordapp.com/avatars/${user.discordId}/${user.discordAvatar}.${isAnimated ? "gif" : "png"}?size=64`;

    avatarHtml = `
      <img src="${avatarUrl}"
        class="w-6 h-6 rounded-md object-cover border border-zinc-700">
    `;
  }

  authButton.innerHTML = `
    ${avatarHtml}
    <span class="text-[#ff0000]">${username}</span>
  `;

  authButton.onclick = toggleDropdown;

  mobileAuthArea.innerHTML = `
    <div class="mt-6 p-4 bg-zinc-900 rounded-xl border border-zinc-800 flex flex-col gap-3">

      <div class="flex items-center gap-3">
        ${avatarHtml}
        <span class="font-semibold text-[#ff0000]">${username}</span>
      </div>

      <a href="/profile"
        class="bg-zinc-800 hover:bg-zinc-700 transition px-4 py-2 rounded-lg text-center">
        Perfil
      </a>

      <button id="mobileLogout"
        class="border border-zinc-700 hover:border-red-500 text-red-500 px-4 py-2 rounded-lg transition">
        Sair
      </button>

    </div>
  `;

  document.getElementById("mobileLogout")?.addEventListener("click", logout);
}
async function checkUser() {
  try {
    const res = await fetch("/api/user");
    if (!res.ok) return setupGuest();

    const { success, ...user } = await res.json();
    success ? setupLoggedUser(user) : setupGuest();

  } catch {
    setupGuest();
  }
}

document.querySelectorAll('a[href="/features"], a[href="/pricing"], a[href="/faq"]').forEach(link => {
  link.addEventListener("click", function(e) {

    if (window.location.pathname === "/") {
      e.preventDefault();

      const sectionId = this.getAttribute("href").replace("/", "");
      const target = document.getElementById(sectionId);

      if (target) {
        target.scrollIntoView({
          behavior: "smooth",
          block: "start"
        });
      }

      closeDrawer?.();
    }

  });
});

const path = window.location.pathname.replace("/", "");

if (path === "features" || path === "pricing" || path === "faq") {

  const target = document.getElementById(path);

  if (target) {
    setTimeout(() => {
      target.scrollIntoView({
        behavior: "smooth",
        block: "start"
      });
    }, 100);
  }

}


  checkUser();
});
document.querySelectorAll(".buy-btn").forEach(button => {
  button.addEventListener("click", async () => {

    const plan = button.dataset.plan;

    try {

      const userRes = await fetch("/api/user");
      const userData = await userRes.json();

      if (!userData.success) {
        window.location.href = "/login";
        return;
      }

      const response = await fetch("/api/payment/create", {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify({ plan })
      });

      const data = await response.json();

      if (!data.success) {
        alert("Erro ao criar pagamento.");
        return;
      }

      window.location.href = `/checkout/${data.orderId}`;

    } catch {
      alert("Erro ao processar pagamento.");
    }

  });


});

async function loadDiscordMembers(){

const res = await fetch("/api/discord/roles");
const data = await res.json();

const foundersDiv = document.getElementById("foundersList");
const membersDiv = document.getElementById("membersList");

foundersDiv.innerHTML="";
membersDiv.innerHTML="";

data.founders.forEach(user=>{

foundersDiv.innerHTML += `
<div class="flex flex-col items-center group w-20">
<img src="${user.avatar}"
class="w-16 h-16 rounded-xl border border-zinc-700 group-hover:border-primary group-hover:shadow-lg group-hover:shadow-red-500/30 transition duration-300">
<span class="text-xs text-gray-400 mt-2 text-center truncate w-full">
${user.name}
</span>
</div>
`;
});

data.members.forEach(user=>{

membersDiv.innerHTML += `
<div class="flex flex-col items-center group w-16">
<img src="${user.avatar}"
class="w-11 h-11 rounded-lg border border-zinc-700 group-hover:border-primary group-hover:shadow-lg group-hover:shadow-red-500/30 transition duration-300">
<span class="text-[10px] text-gray-500 mt-1 text-center truncate w-full">
${user.name}
</span>
</div>
`;

});

}

loadDiscordMembers();


</script>

</body>
</html>