* {
  margin: 0;
  padding: 0;
  font-family: "Poppins", sans-serif;
  box-sizing: border-box;
}

body {
  background: #222;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
}

.card {
  width: 90%;
  max-width: 470px;
  background: linear-gradient(135deg, #00feba, #5b548a);
  color: #fff;
  margin: 10px auto 0;
  border-radius: 20px;
  padding: 40px 35px;
  text-align: center;
  transition: transform 0.3s;
}

.search {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.search input {
  border: 0;
  outline: 0;
  background: #ebfffc;
  color: #555;
  padding: 10px 25px;
  height: 60px;
  border-radius: 30px;
  flex: 1;
  margin-right: 16px;
  font-size: 18px;
}

.search button {
  border: 0;
  outline: 0;
  background: #ebfffc;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  cursor: pointer;
  transition: 0.2s ease;
}

.search button:hover {
  background: #d4f1ec;
  transform: scale(1.05);
}

.search button i {
  color: #555;
  font-size: 20px;
}

.weather-icon {
  width: 170px;
  margin-top: 30px;
}

.weather h1 {
  font-size: 80px;
  font-weight: 500;
}

.weather h2 {
  font-size: 45px;
  font-weight: 400;
  margin-top: -10px;
}

.details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  margin-top: 50px;
}

.col {
  display: flex;
  align-items: center;
  text-align: left;
}

.col i {
  font-size: 40px;
  margin-right: 10px;
}

.humidity,
.wind {
  font-size: 28px;
  margin-top: -6px;
}

.weather {
  display: none;
}

.weather.active {
  display: block;
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.error {
  text-align: left;
  margin-left: 10px;
  font-size: 14px;
  margin-top: 10px;
  display: none;
}

.error p {
  color: #ffcccc;
  font-weight: 600;
}

/* --- RESPONSIVE DESIGN FOR MOBILE --- */
@media (max-width: 500px) {
  .card {
    width: 90%;
    /* Reduce side padding from 35px to 20px to give content more room */
    padding: 30px 20px; 
  }

  .search {
    /* Stack elements if needed, but here we just reduce spacing */
    gap: 10px; 
  }

  .search input {
    /* Make text slightly smaller and padding tighter */
    padding: 10px 15px;
    height: 50px; /* Reduce height slightly */
    font-size: 16px;
    margin-right: 10px; /* Reduce gap between input and button */
  }

  .search button {
    /* Make the button slightly smaller to fit better */
    width: 50px;
    height: 50px;
  }

  .search button img {
    width: 16px; /* Adjust icon size inside button if needed */
  }
  
  .weather-icon {
    width: 140px; /* Make the main icon slightly smaller on mobile */
    margin-top: 20px;
  }

  .weather h1 {
    font-size: 60px; /* Adjust temperature font size */
  }

  .weather h2 {
    font-size: 35px; /* Adjust city font size */
  }

  .details {
    padding: 0 10px; /* Reduce internal padding for details */
    margin-top: 30px;
  }
  
  .col i {
      font-size: 30px; /* Smaller icons for wind/humidity */
  }
}
