@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;500;600&display=swap");
:root {
  --primary-color: #5598fd;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  display: flex;
  justify-content: center;
  min-height: 100vh;
  min-width: 1000px;
  padding: 20px;
  background: var(--primary-color);
  background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
    url("./cd.jpg");
  background-size: cover;
  background-position: center;
  transition: background-image 0.3s ease;
}

img {
  width: 100%;
}

.wrapper {
  display: flex;
  width: 1200px;
  min-width: 900px;
  border-radius: 20px;
  overflow: hidden;
}

.sidebar {
  width: 30%;
  min-width: 250px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.815);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.search {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
  margin-top: 20px;
  position: relative;
}

.search input {
  width: 100%;
  height: 40px;
  border: 1px solid #ced4da;
  border-top-left-radius: 5px;
  border-bottom-left-radius: 5px;
  padding: 0 15px;
  font-size: 14px;
  color: #495057;
}

.search input:focus {
  outline: none;
  border: 1px solid var(--primary-color);
}

.search button {
  min-width: 40px;
  height: 40px;
  border: none;
  border-top-right-radius: 5px;
  border-bottom-right-radius: 5px;
  background: var(--primary-color);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

.search ul {
  max-height: 300px;
  overflow-y: auto;
  position: absolute;
  width: 100%;
  top: 40px;
  border-radius: 5px;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  background-color: #fff;
}

.search ul li {
  padding: 10px 15px;
  border-bottom: 1px solid #f1f1f1;
  cursor: pointer;
  text-transform: capitalize;
}

.search ul li:last-child {
  border-bottom: none;
}

.search ul li:hover {
  background-color: #f1f1f1;
}

.search ul li.active {
  background-color: #f1f1f1;
}

.weather-icon {
  width: 100%;
  height: auto;
  max-height: 100px;
  text-align: center;
  margin-top: 20px;
  margin-bottom: 100px;
}

.weather-icon #icon {
  width: 70%;
  object-fit: cover;
}

.temperature {
  display: flex;
}

.temperature #temp {
  font-size: 70px;
  font-weight: 100;
  line-height: 1;
}

.temperature span {
  font-size: 40px;
  margin-top: -10px;
  display: block;
}

.divider {
  width: 100%;
  height: 1px;
  background: #e9ecef;
  margin: 20px 0;
}

.condition-rain {
  font-size: 12px;
  text-transform: capitalize;
}

.condition-rain div {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.condition-rain div i {
  width: 20px;
}

.location {
  display: flex;
  align-items: center;
  font-size: 14px;
  gap: 10px;
  margin-top: 10px;
}

.main {
  width: 100%;
  min-width: 400px;
  padding: 20px 40px;
  background-color: #f6f6f8;
  position: relative;
  padding-bottom: 90px;
}

.main nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.main nav .options {
  display: flex;
  gap: 20px;
  align-items: center;
}

.main nav .options button {
  border: none;
  background: none;
  font-size: 16px;
  font-weight: 600;
  color: #495057;
  cursor: pointer;
  text-transform: capitalize;
}

.main nav .options button.active {
  color: var(--primary-color);
}

.main nav .units button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #1a1a1a;
  background-color: #fff;
}

.main nav .units button.active {
  color: #fff;
  background-color: #1a1a1a;
}

.main .cards {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 50px;
}

.cards .card {
  width: 100px;
  height: 130px;
  border-radius: 20px;
  color: #1a1a1a;
  background-color: #fff;
  text-align: center;
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card h2 {
  font-size: 15px;
  font-weight: 600;
}

.card .card-icon {
  width: 50%;
  margin: 0 auto;
}

.card .day-temp {
  font-size: 12px;
  display: flex;
  justify-content: center;
  display: flex;
}

.highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 50px;
}

.highlights .heading {
  width: 100%;
  font-size: 20px;
  font-weight: 600;
  text-transform: capitalize;
}

.card2 {
  width: 250px;
  height: 150px;
  border-radius: 20px;
  color: #1a1a1a;
  background-color: #fff;
  padding: 10px 20px;
  display: flex;
  flex-direction: column;
}

.card2 .card-heading {
  color: #c2c2c2;
}

.card2 .content {
  margin-top: 20px;
}

.card2 .content p:first-child {
  text-align: center;
  font-size: 30px;
}

.card2 .content p:nth-child(2) {
  font-size: 12px;
  margin-top: 20px;
  text-align: left;
}

.credits {
  text-align: center;
  font-size: 12px;
  color: #c2c2c2;
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
}
@media (max-width: 768px) {
  body {
    padding: 10px;
    min-width: unset;
  }

  .wrapper {
    flex-direction: column;
    width: 100%;
    min-width: unset;
  }

  .sidebar {
    width: 100%;
    min-width: unset;
    padding: 15px;
  }

  .main {
    width: 100%;
    padding: 20px;
  }

  .main .cards,
  .highlights {
    justify-content: center;
    margin-top: 30px;
  }

  .highlights .heading {
    text-align: center;
  }

  .cards .card,
  .highlights .card2 {
    width: 100%;
    height: auto;
    margin-bottom: 15px;
  }

  .search input {
    font-size: 12px;
  }

  .temperature #temp {
    font-size: 40px;
  }

  .temperature span {
    font-size: 20px;
  }

  .condition-rain div {
    gap: 5px;
  }

  .main nav .options button {
    font-size: 14px;
  }

  .card h2 {
    font-size: 14px;
  }

  .card .day-temp {
    font-size: 11px;
  }

  .card2 .content p:first-child {
    font-size: 24px;
  }

  .card2 .content p:nth-child(2) {
    font-size: 10px;
  }
  .weather-icon #icon {
    width: 50%;
  }
  .card .card-icon {
    width: 40%;
  }
}

/* Small screen adjustments */
@media (max-width: 500px) {
  /* Search input adjustments */
  .search input {
    font-size: 12px; /* Slightly bigger */
    padding: 5px;
  }

  /* Temperature and unit adjustments */
  .temperature #temp {
    font-size: 35px; /* Bigger for visibility */
  }

  .temperature span {
    font-size: 20px; /* Bigger for clarity */
    margin-left: 3px; /* Add some space between temp and unit */
  }

  /* Icon size adjustments */
  .weather-icon #icon {
    width: 50%; /* Slightly larger to maintain visibility */
  }

  /* Card adjustments */
  .cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Center the cards */
    gap: 10px; /* Reduce gap between cards */
    margin-top: 30px; /* Add some space from the top */
  }
  .cards .card {
    width: 80px; /* Smaller width for better fit */
    height: 100px; /* Adjust height proportionally */
    padding: 5px; /* Reduce padding for compactness */
  }

  .cards .card-icon {
    width: 40%; /* Smaller icon */
  }

  /* Text size adjustments inside cards */
  .card h2 {
    font-size: 13px; /* Slightly bigger text */
  }

  .card .day-temp {
    font-size: 10px; /* Smaller font to fit content */
  }

  /* Highlight section adjustments */
  .highlights .card2 {
    width: 100%; /* Full width for better fit */
    height: auto; /* Auto height for flexibility */
    padding: 10px;
  }

  .card2 .content p:first-child {
    font-size: 22px; /* Larger font for legibility */
  }

  .card2 .content p:nth-child(2) {
    font-size: 10px; /* Adjust size for smaller screen */
  }

  /* Nav button adjustments */
  .main nav .options button {
    font-size: 12px; /* Smaller but readable */
  }
  .main nav .units button {
    width: 35px; /* Reduce width to fit smaller screen */
    height: 35px; /* Adjust height proportionally */
    font-size: 12px; /* Reduce font size for readability */
    border-radius: 50%; /* Keep circular shape */
    display: flex; /* Center the text inside the circle */
    align-items: center; /* Center vertically */
    justify-content: center; /* Center horizontally */
    padding: 0; /* Remove padding to avoid overflow */
  }

  /* Additional styling for alignment */
  .main nav .units {
    display: flex;
    justify-content: flex-end; /* Keep button aligned to the right */
    margin-right: 35px; /* Add some space from the edge */
  }

  .main nav .options {
    flex-grow: 1; /* Ensure the options stay on the left */
  }
}

.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #fff;
  padding: 10px 0;
  text-align: center;
  font-size: 12px;
  color: #495057;
  border-top: 1px solid #e9ecef;
}
