/* List Page Specific Styles */
#animal-list {
  margin: 120px 50px 0px 50px; /* Top margin for header, bottom margin for footer */
  padding: 0vw 10vw;
}

#animal-list .search-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

#animal-list .search-container input[type="text"],
#animal-list .search-container select {
  padding: 8px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

#animal-list .search-container button {
  padding: 8px 16px;
  font-size: 16px;
  border: none;
  background-color: #007BFF;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
}

/* Use CSS grid for tile container */
#animal-list .tile-container {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px 10px;
}

/* Animal tile styling */
#animal-list .animal-tile {
  display: flex;
  flex-direction: column;
  width: 100%;
  aspect-ratio: 1 / 1;
  text-decoration: none;
  color: #333;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#animal-list .animal-tile:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Image takes up 80% of tile */
#animal-list .animal-tile img {
  height: 75%;
  width: 100%;
  object-fit: cover;
}

/* Info area (name and species) takes up bottom 20% */
#animal-list .tile-info {
  min-height: 25%;
  padding: 5px 10px;
  background-color: #f8f8f8;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#animal-list .tile-info h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #000000;
}

#animal-list .tile-info p {
  margin: 0;
  font-size: 16px;
  color: #000000;
}

/* Mobile adaptation: 2 tiles per row on small screens */
@media (max-width: 600px) {
  /* 1) Shrink the section padding so it’s not 10vw on mobile */
  #animal-list {
    margin: 20px 10px;
    padding: 0 10px;       /* small fixed padding, not 10vw */
  }

  /* 2) Two columns, full‐width grid‐container */
  #animal-list .tile-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 10px;
    width: 100%;
    padding: 0;
  }

  /* 3) Each tile remains a square, flex splits children 80/20 */
  #animal-list .animal-tile {
    display: flex;
    flex-direction: column;
    width: 100%;
    aspect-ratio: 1 / 1;        /* stay square */
    text-decoration: none;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  #animal-list .animal-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }

  /* 4) Image gets 8 parts out of 10 (80%) */
  #animal-list .animal-tile img {
    height: 70%;
    width: 100%;
    object-fit: cover;
  }

  /* 5) Info gets 2 parts out of 10 (20%) */
  #animal-list .tile-info {
    height: 30%;
    padding: 5px 10px;
    background-color: #f8f8f8;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;     /* include padding in that 20% */
  }
  #animal-list .tile-info h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #000;
  }
  #animal-list .tile-info p {
    margin: 0;
    font-size: 16px;
    color: #000;
  }
}
