<!DOCTYPE html>
<html lang="pt-br">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <link rel="stylesheet" href="CSS/main.css" />
    <title>Pokedex</title>
</head>

<body>
    <header class="header flex">
        <ul class="header__list flex">
            <li id="blue-light" class="header__list__item circle"></li>
            <li>
                <a class="header__list__item" href="/">
                    <h2>Pokédex</h2>
                </a>
            </li>
            <li><a class="header__list__item bold" href="/cadastro">Cadastre um pokemon</a></li>
            <li><a class="header__list__item bold" href="/contato">Contato</a></li>

            <div class="header__circle-container flex">
                <div class="header__circle__item circle" id="red-light"></div>
                <div class="header__circle__item circle" id="yellow-light"></div>
                <div class="header__circle__item circle" id="green-light"></div>
            </div>
        </ul>
    </header>

    <main>
        <section href="" id="cards" class="cards flex">
            <h2>Pokémons</h2>

            <% pokedex.forEach((pokemon) => { %>

                <div class="card">
                    <img src="<%= pokemon.imagem %>" alt="" />

                    <h3>
                        <%= pokemon.nome %>
                    </h3>

                    <p class="descricao">
                        <%= pokemon.descricao %>
                    </p>

                    <p class="descricao">Tipo:
                        <%= pokemon.tipo %>
                    </p>


                    <button id="detalhes" class="btnDetails">
            <a class="btnDetails" href="/detalhes/<%= pokedex.indexOf(pokemon) %>" method="GET">+ Detalhes</a>
          </button>

                
                    <a id="apagar" href="/delete/<%= pokemon.id %>">Apagar</a>
                </div>
                <% }) %>
        </section>

        
    </main>

    <footer>
        <p>Todos os direitos reservados para chrisktventura &copy;</p>
        <p>
            Dados retirados de
            <a target="_blank" href="https://www.pokemon.com/br/pokedex/">Pokédex</a
        >
      </p>
    </footer>
  </body>
  <script src="/script.js"></script>
