/* ------------------ GENERALES ------------------ */

body {
  font-family: "Smooch Sans", sans-serif;
  font-weight: 600; /* o el valor que prefieras: 100, 300, 600, etc. */
  font-optical-sizing: auto;
  font-style: normal;
  margin: 0;
  background: #333;
}

html,
body {
  overflow-x: hidden;
}

/* ------------------ INTRO ------------------ */
#intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  text-align: center;
  background: url("imagenes/pokestop.jpg") no-repeat center center fixed;
  background-size: cover;
  color: #ffffff;
  transition: opacity 0.5s ease;
}

#intro h1 {
  font-size: 3rem;
  margin-bottom: 20px;
  font-weight: bold;
  color: #ffffff;
  text-shadow: 0 0 5px #ff0000, 0 0 10px #ff0000, 0 0 20px #ff0000,
    0 0 40px #ff0000, 0 0 80px #ff0000;
}

#intro p {
  font-size: 1.2rem;
  color: #ffffff;
  text-shadow: 0 0 5px #ff0000, 0 0 10px #ff0000, 0 0 20px #ff0000,
    0 0 40px #ff0000, 0 0 80px #ff0000;
}

#intro.hide {
  opacity: 0;
  pointer-events: none;
}

#contenido {
  display: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

#contenido.active {
  display: block;
  opacity: 1;
}

/* ------------------ HEADER ------------------ */
.logoPrincipal {
  display: flex;
  padding: 0.7rem;
  margin-bottom: 10px;
  background-color: red;
  min-height: 100px;
  color: white;
  font-size: medium;
  align-items: center;
  justify-content: center;
}

.logoPrincipal img {
  width: 200px;
}

/* ------------------ BUSCADOR ------------------ */
#formBusquedaPrincipal {
  margin-left: 7.7%;
}

.buscador {
  background: #333;
  color: white;
  padding: 1rem;
  border-radius: 10px;
}

.buscador h1 {
  margin-top: 0;
  font-size: 30px;
}

.abrirFiltro {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-bottom: 10px;
}

@media (max-width: 200px) {
  .abrirFiltro h5 {
    width: 120px;
    gap: 0px;
  }
}

@media (max-width: 175px) {
  .abrirFiltro h5 {
    width: 70px;
    gap: 0px;
  }
}

.abrirFiltro h5 {
  color: white;
  text-align: center;
  margin: 0px;
  font-size: 16px;
}

.abrirFiltro img {
  width: 20px;
  height: 20px;
  margin: 0px;
}

.filtros {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.tipos {
  display: grid;
  grid-template-columns: repeat(3, 150px);
  gap: 15px;
  justify-items: center;
  align-items: center;
  margin: 10px 0px;
}

@media (max-width: 500px) {
  .tipos {
    grid-template-columns: repeat(2, 150px);
  }
}

@media (max-width: 900px) {
  .filtros {
    grid-template-columns: repeat(1, minmax(180px, 1fr));
  }
}

@media (max-width: 330px) {
  .tipos {
    grid-template-columns: repeat(1, 150px);
  }
}

.filtroTipos,
.filtroAltura,
.filtroPeso {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.filtroTipos h4 {
  margin: 0px;
  text-align: center;
  font-size: 20px;
}

.tipos div {
  border: 1px solid #ddd;
  width: 100px;
  height: 22px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 5px;
  text-align: center;
}

.agua,
.aguaCard {
  background: #6390f0;
  color: white;
}
.fuego,
.fuegoCard {
  background: #ee8130;
  color: white;
}
.planta,
.plantaCard {
  background: #7ac74c;
  color: white;
}
.electrico,
.electricoCard {
  background: #f7d02c;
  color: #333;
}
.tierra,
.tierraCard {
  background: #e2bf65;
  color: #333;
}
.roca,
.rocaCard {
  background: #b6a136;
  color: white;
}
.psiquico,
.psiquicoCard {
  background: #f95587;
  color: white;
}
.lucha,
.luchaCard {
  background: #c22e28;
  color: white;
}
.fantasma,
.fantasmaCard {
  background: #735797;
  color: white;
}
.hielo,
.hieloCard {
  background: #96d9d6;
  color: #333;
}
.veneno,
.venenoCard {
  background: #a33ea1;
  color: white;
}
.volador,
.voladorCard {
  background: #a98ff3;
  color: #333;
}
.normal,
.normalCard {
  background: #a8a77a;
  color: #333;
}
.dragon,
.dragonCard {
  background: #6f35fc;
  color: white;
}
.bicho,
.bichoCard {
  background: #a6b91a;
  color: #333;
}
.siniestro,
.siniestroCard {
  background: #705746;
  color: white;
}
.hada,
.hadaCard {
  background: #d685ad;
  color: #333;
}
.acero,
.aceroCard {
  background: #b7b7ce;
  color: #333;
}

.filtroTamanos {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
  gap: 10px;
}

.filtroTamanos h4 {
  margin: 0px;
  font-size: 20px;
}

.alturas,
.pesos {
  min-width: 400px;
  height: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-around;
  margin: 5px 0px;
}

@media (max-width: 450px) {
  .alturas,
  .pesos {
    flex-direction: column;
    gap: 15px;
    margin: 10px 0px;
  }
}

@media (max-width: 460px) {
  .imgYDescripcion,
  .pokemonDatos,
  .pokemonEstadisticas,
  .pokemonLineaEvolutiva {
    width: 60%;
  }
  .pokemonInfoGeneral,
  .pokemonStatsYEvos {
    align-items: center;
  }
  .imgYDescripcion {
    height: 300px !important;
    flex-direction: column;
    padding-bottom: 10px !important;
  }
  .imgYDescripcion #detalleImg {
    width: 170px;
  }
  .imgYDescripcion #detalleTitulo {
    margin: 0px;
  }
  .pokemonDatos {
    height: 130px !important;
  }
  .pokemonDatos h3,
  .pokemonEstadisticas h3,
  .pokemonLineaEvolutiva h3 {
    margin-top: 0px !important;
  }

  .pokemonEstadisticas .stats {
    width: 100%;
    display: grid;
    grid-template-columns: 20% 10% 70% !important; /* 3 columnas: nombre corto, valor numérico y barra */
    align-items: center;
  }

  /* Ocultamos las palabras largas */
  .stats > div:nth-child(4n + 1) {
    display: none !important;
  }

  /* Mostramos las palabras cortas */
  .stats > div:nth-child(4n + 2) {
    display: block !important;
    opacity: 1;
    width: auto;
    text-align: end;
  }

  /* Valor numérico */
  .stats > div:nth-child(4n + 3) {
    margin-left: 0 !important;
    text-align: end;
  }

  /* Barra */
  .stats > div:nth-child(4n + 4) {
    margin-left: 7px !important;
  }

  .pokemonLineaEvolutiva {
    height: 120px !important;
  }

  #detalleEvoluciones {
    margin-top: 0px !important;
    gap: 15px !important;
  }

  #detalleEvoluciones img {
    width: 50px !important;
    height: 50px !important;
  }
}

.alturas div,
.pesos div {
  background-color: white;
  width: 100px;
  height: 100px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tipos div,
.alturas div,
.pesos div {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  font-size: 17px;
}

.filtros .tipos div:hover,
.alturas div:hover,
.pesos div:hover {
  outline: 2px solid #cc0000; /* borde rojo */
  transform: scale(1.05); /* un poco más grande */
}

.filtros .tipos div.activo,
.alturas div.activo,
.pesos div.activo {
  transform: scale(1.05); /* un poco más grande */
}

.alturas img {
  width: 80px;
  height: 80px;
}

.pesos img {
  width: 60px;
  height: 60px;
}

.buscador .busqueda label {
  display: block;
  margin-bottom: 5px;
  font-size: 20px;
}

.botonesBusqueda {
  display: flex;
  justify-content: start;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.buscador .busqueda input {
  width: 250px;
  padding: 0.5rem;
  border-radius: 5px;
  border: none;
}

#btnLupa {
  background: #cc0000;
  border: none;
  padding: 7px;
  color: white;
  font-weight: bold;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#btnLupa img {
  width: 24px;
  height: 23px;
}

.botonesFiltro {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 40px;
  margin: 30px 0px 15px 0px;
}

@media (max-width: 300px) {
  .botonesFiltro {
    flex-direction: column;
    gap: 15px;
  }
}

#btnBusqueda {
  background: #cc0000;
  border: none;
  padding: 0.7rem 1rem;
  color: white;
  font-weight: bold;
  border-radius: 5px;
  cursor: pointer;
}

#btnResetear {
  background: grey;
  border: none;
  padding: 0.7rem 1rem;
  color: white;
  font-weight: bold;
  border-radius: 5px;
  cursor: pointer;
}

#btnBusqueda:hover {
  background: #990000;
}

#btnResetear:hover {
  background: rgb(100, 100, 100);
}

#formBusquedaAvanzada {
  display: block; /* siempre ocupa lugar en el flujo */
  max-height: 0; /* empieza cerrado */
  opacity: 0; /* invisible */
  overflow: hidden; /* oculta lo que sobra */
  transform: scaleY(0.95); /* un poquito comprimido */
  transition: max-height 1s ease, opacity 1s ease, transform 1s ease;
}

#formBusquedaAvanzada.active {
  max-height: 1700px; /* dale un valor mayor a la altura real del formulario */
  opacity: 1;
  transform: scaleY(1);
}

/* ------------------ RESULTADOS ------------------ */
#resultadosPokedex,
#detallePokemon {
  background-color: white;
  padding: 20px;
  border-radius: 5px;
  margin: 0px 15px 0px 15px;
}

#detallePokemon {
  display: none;
}

#resultadosPokedex h2 {
  color: #000000;
  margin: 0px 0px 15px 5px;
}

.lista {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* Cartas de Pokémon más chicas */
.pokemon-card {
  border: 2px solid #ddd;
  border-radius: 8px;
  padding: 0.5rem;
  width: 170px; /* antes 150px */
  text-align: center;
  background: white;
  transition: transform 0.2s;
}

.pokemon-card img {
  width: 160px; /* imagen más compacta */
  height: auto;
}

.pokemon-card h3 {
  font-size: 1.25rem; /* título más pequeño */
  margin: 0.5rem 0 0.2rem 0;
}

.pokemon-card p {
  font-size: 0.9rem; /* texto más chico */
  margin: 0;
}

.tiposCard {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin-bottom: 5px;
}

.tiposCard div {
  border: 1px solid #ddd;
  width: 60px;
  height: 18px;
  font-size: 0.85rem;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 3px;
  text-align: center;
}

.pokemon-card:hover {
  transform: scale(1.05);
  border-color: #cc0000;
}

.contenedor-resultados {
  display: flex;
  gap: 2rem;
}

.lista {
  flex: 1;
}

.detalle {
  flex: 1;
  background: #fff;
  border: 2px solid #ddd;
  border-radius: 10px;
  padding: 1rem;
}

.detalle img {
  width: 150px;
}

.evoluciones {
  margin-top: 1rem;
  display: flex;
  gap: 1rem;
}

.evoluciones img {
  width: 80px;
  cursor: pointer;
  transition: transform 0.2s;
}

.evoluciones img:hover {
  transform: scale(1.1);
}

.pokemon-card.seleccionado {
  border: 3px solid #cc0000;
  background: #ffeaea;
}

#detallePokemon img {
  width: 200px;
}

#btnVolver {
  background: #cc0000;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  cursor: pointer;
  margin-bottom: 1rem;
}

/* Responsive: en pantallas chicas, aún más compactas */
@media (max-width: 615px) {
  .pokemon-card {
    width: 90px;
    padding: 0.4rem;
  }
  .pokemon-card img {
    width: 60px;
  }
  .pokemon-card h3 {
    font-size: 0.9rem;
  }
  .tiposCard div {
    font-size: 0.75rem;
  }
  .pokemon-card p {
    font-size: 0.8rem;
  }
}

@media (max-height: 600px) {
  .pokemon-card {
    width: 90px;
    padding: 0.4rem;
  }
  .pokemon-card img {
    width: 60px;
  }
  .pokemon-card h3 {
    font-size: 0.9rem;
  }
  .tiposCard div {
    font-size: 0.075rem;
  }
  .pokemon-card p {
    font-size: 0.8rem;
  }
}

/* ------------------ DETALLE DE POKÉMON ------------------ */
.paginaPokemon {
  width: 100%;
  display: flex;
  flex-direction: row;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  padding-bottom: 10px;
}

.allDetallePokemon {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 5px;
}

.pokemonAnterior,
.pokemonPosterior {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.botonesMediaChica {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0px 20px 0px;
  max-height: 0; /* empieza cerrado */
  opacity: 0; /* invisible */
  overflow: hidden; /* oculta lo que sobra */
}

.botonesMediaChica button {
  background: #cc0000;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 0.8rem;
  width: 100px;
  height: 30px;
  cursor: pointer;
}

@media (max-width: 630px) {
  .botonesMediaChica {
    max-height: 300px;
    opacity: 1;
  }
  .pokemonAnterior,
  .pokemonPosterior {
    opacity: 0;
    max-width: 0px;
    overflow: hidden;
  }
  .paginaPokemon {
    align-items: center;
    justify-content: center;
    gap: 0px;
  }
}

.pokemonAnterior button,
.pokemonPosterior button {
  background: #cc0000;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 2rem;
  width: 50px;
  height: 50px;
  cursor: pointer;
}

.pokemonAnterior button:hover,
.pokemonPosterior button:hover,
.botonesMediaChica button:hover {
  background: #a00000;
}

.imgYDescripcion,
.pokemonDatos,
.pokemonEstadisticas,
.pokemonLineaEvolutiva {
  background: #f1f1f1;
  border-radius: 8px;
  padding: 1rem;
  height: 180px;
}

.imgYDescripcion {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.pokemonDatos,
.pokemonLineaEvolutiva {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.pokemonEstadisticas {
  display: flex;
  flex-direction: column;
  align-items: start;
  justify-content: center;
  overflow: hidden; /* evita que las barras se salgan visualmente */
}

.descripcion {
  max-width: 300px;
}

.pokemonInfoGeneral,
.pokemonStatsYEvos {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%;
  width: 46%;
  min-width: 402px;
  margin-bottom: 1rem;
}

.pokemonLineaEvolutiva h3,
.pokemonEstadisticas h3 {
  width: 100%;
  text-align: center;
  margin: 5px 0px 10px 0px;
  font-size: 24px;
}

.pokemonDatos h3 {
  width: 100%;
  text-align: start;
  margin: 5px 0px 10px 0px;
  padding-left: 40px;
  font-size: 24px;
}

.pokemonDatos div {
  width: auto;
  margin-bottom: 5px;
}

.pokemonEstadisticas .stats {
  width: 100%;
  display: grid;
  grid-template-columns: 20% 5% 75%;
  align-items: center;
}

.stats div {
  font-size: 18px;
  white-space: nowrap;
}

.stats > div:nth-child(4n + 1) {
  display: block;
  text-align: end;
}

.stats > div:nth-child(4n + 2) {
  display: none;
}

.stats > div:nth-child(4n + 3) {
  margin-left: 7px;
  text-align: end;
}

.stats > div:nth-child(4n + 4) {
  margin-left: 20px;
}

.barraHP,
.barraAtk,
.barraDef,
.barraAtkEsp,
.barraDefEsp,
.barraVel {
  height: 10px;
  background-color: #000000;
}

#detalleTipo,
#detalleAltura,
#detallePeso,
#detalleDescripcion {
  font-size: 18px;
}

#detalleDescripcion {
  padding: 0px 20px;
  margin: 0px;
}

#detalleEvoluciones img {
  width: 80px;
  height: 80px;
  padding: 5px;
  border-radius: 50%;
  border: 2px solid #ccc;
  cursor: pointer;
  transition: transform 0.2s;
}

#detalleEvoluciones img:hover {
  transform: scale(1.1);
}

/* Evoluciones estilo Pokédex */
#detalleEvoluciones {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  margin-top: 20px;
}

@keyframes shake {
  0% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  50% {
    transform: translateX(4px);
  }
  75% {
    transform: translateX(-4px);
  }
  100% {
    transform: translateX(0);
  }
}
#seleccionInfo {
  margin-top: 15px;
  padding: 10px 15px;
  background: #1a1a1a;
  color: #fff;
  font-size: 14px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid red;
  box-shadow: 0 0 10px 2px rgba(255, 0, 0, 0.7);
  animation: glow 1.5s infinite alternate;
}

#seleccionInfo b {
  color: #ff4d4d;
}

@keyframes glow {
  from {
    box-shadow: 0 0 5px 2px rgba(255, 0, 0, 0.5);
  }
  to {
    box-shadow: 0 0 20px 5px rgba(255, 0, 0, 1);
  }
}

/* ------------------ FOOTER ------------------ */
footer {
  background-color: #333;
  color: white;
  text-align: center;
  padding: 1rem;
}
