/* Global styles */
body, html {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

main {
  width: 100%;
}

/* Container for the search and filter bar */
.search-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  width: 70%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  padding-top: 1vw;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  max-width: 100%; 
  box-sizing: border-box;
  padding-bottom: 2vw;
}

/* Styling the input box for the search bar */
.search-bar input {
  width: 90%; 
  max-width: 400px;
  padding: 0.5vw 1vw;
  font-size: 1rem !important;
  margin-bottom: 0.8vw;
  border: 1px solid #ccc;
  box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.2);
  border-radius: 10vw;
  box-sizing: border-box;
}

/* Styling filter buttons */
.filter-bar button {
  width: 60px;
  padding: 1vw auto;
  font-size: 1rem !important;
  margin: 0.5vw;
  border: none;
  border-radius: 5px;
  box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  text-align: center;
  box-sizing: border-box;
  transition: all 0.3s ease;
}

.filter-bar button:hover {
  background-color: #e0e0e0;
}

/* Participants grid */
.participants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); 
  gap: 2vw;
  width: 100%;
  justify-items: center;
}

.participant:hover {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.participant {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  width: 150px; 
  height: 220px;
  overflow: hidden;
  border-radius: 10px;
}

.participant-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.participant-photo {
  background-color: #eee; 
  transition: filter 0.3s ease;
  filter: blur(10px);
}

.participant-photo.loaded {
  filter: blur(0);
}

.team-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  z-index: 1; 
}

.participant h2 {
  position: absolute;
  bottom: 10px;
  color: white;
  font-size: 1rem;
  z-index: 2; 
}

.heart-icon {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 24px;
  height: 24px;
  background-image: url('../icons/heart.png');
  background-size: cover;
  z-index: 10;
}

.participant {
  position: relative;
}

@media (max-width: 600px) {
  .participants-grid {
    grid-template-columns: repeat(2, 1fr); 
  }

  .participant {
    width: 120px !important; 
    height: 190px !important;
  }

  .participant h2 {
    bottom: 1px;
  }

  main {
    width: 80%;
  }

  .search-bar {
    padding-top : 3vw;
  }

  .filter-bar {
    padding-bottom: 8vw;
  }

  .filter-bar button {
    font-size: 0.8rem !important;
    padding: 0.5vw;
    width: 45px;
  }

  .search-bar input {
    font-size: 0.7rem  !important;
    padding: 2vw 3vw;
    margin-bottom: 3vw;
  }
}
