.pokedex-header {
    display: flex;;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    margin: 50px;
}

.pokedex-header form {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.pokedex-header input[type="text"] {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    width: 200px;
}

.pokedex-header button {
    padding: 10px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.pokedex-header button:hover {
    background-color: #0056b3;
}

.pokedex-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px; 
    width: 100%;
    height: 100%;

}

.pokemon-card {
    width: 270px; /* Aumente a largura */
    height: 350px; /* Aumente a altura */
    perspective: 1000px; /* Mantém a perspectiva 3D */
}

.pokemon-card img {
    max-width: 100%;
    height: auto;
}

.pokemon-card-inner {
    position: relative;
    width: 100%; /* Ajusta automaticamente à largura da .pokemon-card */
    height: 100%; /* Ajusta automaticamente à altura da .pokemon-card */
    transform-style: preserve-3d;
    transition: transform 1s;
}

.pokemon-card:hover .pokemon-card-inner {
    transform: rotateY(180deg); /* Gira a carta ao passar o mouse */
}

.pokemon-card-front,
.pokemon-card-back {
    position: absolute;
    width: 100%; /* Ajusta automaticamente à largura da .pokemon-card */
    height: 100%; /* Ajusta automaticamente à altura da .pokemon-card */
    backface-visibility: hidden; /* Esconde o lado de trás quando não visível */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid #ccc;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.pokemon-card-front {
    background-color: #f9f9f9;
}

.pokemon-card-back {
    background-color: #f1f1f1;
    transform: rotateY(180deg); /* Gira o verso da carta */
}

.paginate {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 30px 0 10px 0;
}

.paginate .pagination {
    display: flex;
    gap: 8px;
    list-style: none;
    padding: 0;
}

.paginate .pagination li {
    display: inline-block;
}

.paginate .pagination a,
.paginate .pagination span {
    padding: 8px 14px;
    border-radius: 5px;
    background: #e9ecef; /* cinza claro */
    color: #111;         /* sempre preto */
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
    border: none;
    min-width: 36px;
    text-align: center;
    box-sizing: border-box;
}

.paginate .pagination a:hover {
    background: #888; /* cinza médio ao passar o mouse */
    color: #fff;      /* branco ao passar o mouse */
}

.paginate .pagination .current {
    background: #bdbdbd; /* cinza um pouco mais escuro */
    color: #111;         /* preto */
    font-weight: bold;
    border: none;
    cursor: default;
    pointer-events: none;
    min-width: 36px;
    text-align: center;
    box-sizing: border-box;
}

/* Responsividade para a Pokédex */
@media (max-width: 1200px) {
    .pokedex-container {
        gap: 20px;
    }
    .pokemon-card {
        width: 220px;
        height: 300px;
    }
}

@media (max-width: 900px) {
    .pokedex-header {
        margin: 30px;
    }
    .pokedex-container {
        gap: 15px;
    }
    .pokemon-card {
        width: 180px;
        height: 250px;
    }
}

@media (max-width: 600px) {
    .pokedex-header {
        margin: 15px;
    }
    .pokedex-header h1 {
        font-size: 1.5rem;
    }
    .pokedex-header p {
        font-size: 1rem;
    }
    .pokedex-header input[type="text"] {
        width: 120px;
        font-size: 0.9rem;
    }
    .pokedex-container {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    .pokemon-card {
        width: 95vw;
        max-width: 350px;
        height: 180px;
    }
    .pokemon-card-inner {
        min-height: 180px;
    }
    .paginate {
        margin: 15px 0 5px 0;
        width: 100%;
        overflow-x: auto;
    }
    .paginate .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
    }
    .paginate .pagination li {
        margin-bottom: 4px;
    }
    .paginate .pagination a,
    .paginate .pagination span {
        padding: 6px 10px;
        font-size: 0.95rem;
        min-width: 28px;
    }
}

/* Garante que imagens não estourem o card */
.pokemon-card img {
    max-width: 90%;
    max-height: 120px;
    height: auto;
    object-fit: contain;
}
