body {
  font-family: "Nunito Sans", sans-serif;
  transition: 0.5s;
  background-color: hsl(0, 0%, 98%);
  color: black;
}
h3{
  cursor: pointer;
}
.dark-mode {
  transition: 0.5s;
  background-color: hsl(207, 26%, 17%);
  color: aliceblue;
}

header {
  display: flex;
  justify-content: space-between;
  padding: 20px;
  position: sticky;
}

header h3 {
  font-size: 18px;
  font-weight: 800;
}

.mode {
  display: flex;
  align-items: center;
  justify-items: center;
  cursor: pointer;
}

.image-white {
  background-image: url('assest/lightmode.png');
  width: 20px;
  height: 20px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.mode .image {
  background-image: url('assest/darkmode.png');
  width: 20px;
  height: 20px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.search-container {
  width: 500px;
  height: 20px;
  padding: 10px;
  display: flex;
  align-items: center;
  margin-left: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 -4px 6px rgba(0, 0, 0, 0.1), 4px 0 6px rgba(0, 0, 0, 0.1), -4px 0 6px rgba(0, 0, 0, 0.1);
}

input[type=text] {
  border: 0;
  padding: 10px;
  font-size: 16px;
  width: 200px;
  border-radius: 5px;
  transition: box-shadow 0.3s ease;
  outline: none;
  background-color: transparent;
}

input[type=text]:focus {
  outline: none;
}

.container {
  width: 100%;
  display: flex;
  flex-direction: row;
}

#countries {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.card {
  width: 250px;
  margin: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 -4px 6px rgba(0, 0, 0, 0.1), 4px 0 6px rgba(0, 0, 0, 0.1), -4px 0 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s;
  cursor: pointer;
}

.card .content {
  padding: 10px;
}

.card:hover {
  transform: scale(1.05);
}

.card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

/* Details */
.details-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 90%;
  max-width: 1200px;
  margin: 0px 0px 0px 40px;
  padding: 20px;
}

.details-container .left-container {
  flex: 1;
  max-width: 500px;
  margin: 0;
}

.details-container .left-container img {
  width: 90%;
  height: auto;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.details-container .right-container {
  flex: 1;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.right-container h1 {
  font-size: 2rem;
  margin-bottom: 10px;
  font-weight: bold;
}

.top-section {
  margin-right: 20px;
}

.right-container .top-section p,
.right-container .bottom-section p {
  margin: 5px 0;
  font-size: 1rem;
  line-height: 1.6;
}

.bottom {
  display: flex;
}

.border-countries {
  display: flex;
}

.border-country {
  padding: 8px 15px;
  color: black;
  font-size: 0.9rem;
  border: 0.4px solid #ddd;
  border-radius: 5px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s ease;
}

.border-countries a {
  color: black;
}

.back-button {
  margin-left: 20px;
}

/* Media Queries */
@media only screen and (max-width: 768px) {
  header {
      flex-direction: column;
      align-items: flex-start;
  }

  .search-container {
      width: 80%;
      margin-left: 2px;
      padding: 15px;
  }

  .container {
      flex-direction: column;
      align-items: center;
  }

  .details-container {
      flex-direction: column;
      align-items: center;
      margin: 0;
  }

  .details-container .left-container,
  .details-container .right-container {
      max-width: 100%;
      width: 100%;
  }

  .details-container .left-container img {
      width: 100%;
  }

  .right-container h1 {
      font-size: 1.5rem;
  }

  .right-container .top-section p,
  .right-container .bottom-section p {
      font-size: 0.9rem;
  }

  #countries {
   width: auto;
  }

  .card {
      width: 100%;
  }

  .mode .image, .image-white {
      width: 30px;
      height: 30px;
  }

}

/* Mobile Devices */
@media only screen and (max-width: 430px) {
  header h3 {
      font-size: 16px;
  }

  .mode {
      justify-content: flex-start;
  }

  .search-container {
      width: 90%;
      padding: 10px;
  }

  .details-container {
      width: 100%;
      padding: 10px;
  }

  .back-button {
      margin-left: 10px;
  }
  .card{
    margin: auto;
  }


}
