@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Poppins", Arial, sans-serif;
  background-color: #121212;
  color: #ffffff;
  margin: 0;
  padding: 20px;
  font-size: 16px;
  line-height: 1.6;
}

header {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin-bottom: 30px;
  padding: 0 20px;
}

h2 {
  margin: 0;
  text-align: center;
  font-size: 1.8rem;
}

a {
  text-decoration: none;
  color: orange;
}

/* nav img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
} */

#challenges-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  padding: 0 10px;
}

.challenge-card {
  background-color: #1e1e1e;
  border-radius: 10px;
  padding: 20px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.challenge-card:hover {
  transform: translateY(-10px);
}

.challenge-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 5px;
  margin-bottom: 15px;
}

.challenge-card h3 {
  margin: 0 0 10px 0;
  font-size: 1.1rem;
}

.day {
  margin-left: 5px;
}

button {
  background-color: #16a34a;
  color: white;
  font-weight: 500;
  margin-top: 10px;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  transition: transform 0.3s ease;
  font-size: 1rem;
}

button:hover {
  /* background-color: #1fb857; */
  transform: perspective(200px) translateZ(10px);
}

.modal {
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.modal-content {
  background-color: #1e1e1e;
  margin: 0;
  padding: 20px;
  border-radius: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: auto;
  position: relative;
}

#challenge-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: cover;
  margin-bottom: 15px;
}

.close-button {
  color: #ff2020;
  font-size: 40px;
  cursor: pointer;
  position: absolute;
  top: 10px;
  right: 20px;
}

footer {
  margin-top: 15px;
  text-align: center;
  font-size: 1.2rem;
  width: 100%;
}

footer a {
  text-decoration: none;
  font-weight: 600;
  color: orange;
  transition: color 0.3s ease;
}

footer a:hover {
  color: orange;
}

.black-icon {
  fill: white;
}

/* Media Queries for Responsiveness */
@media screen and (min-width: 1024px) {
  .close-button {
    font-size: 50px;
    top: -15px;
    right: 30px;
  }
}
@media screen and (max-width: 768px) {
  body {
    font-size: 14px;
  }

  h2 {
    font-size: 1.5rem;
  }

  #challenges-container {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }

  .challenge-card img {
    height: 180px;
  }

  .modal-content {
    width: 100%;
    padding: 15px;
  }
  .close-button {
    font-size: 35px;
    top: -15px;
    right: 20px;
  }
}

@media screen and (max-width: 480px) {
  body {
    padding: 10px;
  }

  h2 {
    font-size: 1.2rem;
  }

  #challenges-container {
    grid-template-columns: 1fr;
  }

  .challenge-card {
    padding: 15px;
  }

  .challenge-card img {
    height: 160px;
  }

  button {
    padding: 8px 16px;
  }

  .modal-content {
    margin: 0% auto;
    padding: 10px;
    width: 100%;
  }
  .close-button {
    font-size: 50px;
    /* top: 5px; */
    right: 10px;
  }
  footer > p {
    font-size: 0.9rem;
  }
}
