* {
  margin: 0;
  padding: 0;
  font-family: "Times New Roman", Times, serif;
  box-sizing: border-box;
}
body {
  background: #fff;
}
.app-header {
  background-color: #4a90e2;
  color: white;
  text-align: center;
  padding: 1rem 0;
  font-family: Arial, sans-serif;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.app-header h1 {
  margin: 0;
  font-size: 2rem;
}
.card {
  width: 90%;
  max-width: 470px;
  background: linear-gradient(135deg, #024b57, #0893a8);
  color: #fff;
  margin: 100px auto 0;
  border-radius: 20px;
  padding: 40px 35px;
  text-align: center;
}
.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;
}
.search button img {
  width: 16px;
}
.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 img {
  width: 40px;
  margin-right: 10px;
}
.humidity,
.wind {
  font-size: 28px;
  margin-top: -6px;
}
.weather {
  display: none;
}
.error {
  text-align: left;
  margin-left: 10px;
  font-style: 14px;
  margin-top: 10px;
  display: none;
}

.history {
  margin-top: 30px;
  color: #fff;
  text-align: left;
}

.history ul {
  list-style: none;
  padding-left: 0;
}

.history li {
  padding: 5px 10px;
  border-bottom: 1px solid #fff5;
}
/* 🔘 Icon button */
.history-toggle {
  position: absolute;
  top: 30px;
  right: 30px;
  cursor: pointer;
  z-index: 1001;
}

.history-toggle img {
  width: 30px;
}

/* 📋 Slide-in History Panel */
.history-panel {
  position: fixed;
  top: 0;
  right: -300px; /* hidden by default */
  width: 280px;
  height: 100%;
  background-color: #024b57;
  color: white;
  padding: 20px;
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.3);
  transition: right 0.3s ease;
  z-index: 1000;
}

.history-panel.active {
  right: 0; /* slide in */
}

.history-panel h3 {
  margin-bottom: 15px;
}

.history-panel ul {
  list-style: none;
  padding: 0;
}

.history-panel li {
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
}

#clearHistoryBtn {
  margin-top: 15px;
  padding: 10px;
  width: 100%;
  border: none;
  background-color: #ff4d4d;
  color: white;
  font-size: 16px;
  border-radius: 5px;
  cursor: pointer;
}

#clearHistoryBtn:hover {
  background-color: #e60000;
}

.history-toggle img {
  width: 30px;
  position: absolute;
  top: 0;
  right: 0;
}

@media (max-width: 768px) {
  .card {
    margin: 50px 20px;
    padding: 30px 25px;
  }

  .search input {
    height: 50px;
    font-size: 16px;
    padding: 8px 20px;
  }

  .search button {
    width: 50px;
    height: 50px;
  }

  .search button img {
    width: 14px;
  }

  .weather-icon {
    width: 140px;
    margin-top: 20px;
  }

  .weather h1 {
    font-size: 60px;
  }

  .weather h2 {
    font-size: 35px;
  }

  .details {
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
    padding: 0;
  }

  .col {
    justify-content: center;
  }

  .humidity,
  .wind {
    font-size: 24px;
  }
  .history-panel {
    width: 80%;
    right: -80%;
  }

  .history-panel.active {
    right: 0;
  }

  .history-toggle {
    top: 20px;
    right: 20px;
  }

  .history-panel h3 {
    font-size: 20px;
  }

  .history-panel li {
    font-size: 16px;
    padding: 8px;
  }
}

@media (max-width: 480px) {
  .weather h1 {
    font-size: 50px;
  }

  .weather h2 {
    font-size: 30px;
  }

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

  .humidity,
  .wind {
    font-size: 20px;
  }

  .weather-icon {
    width: 120px;
  }
  .history-panel {
    width: 100%;
    right: -100%;
    padding: 15px;
  }

  .history-panel h3 {
    font-size: 18px;
  }

  .history-panel li {
    font-size: 14px;
    padding: 6px;
  }

  #clearHistoryBtn {
    padding: 8px;
    font-size: 14px;
  }
}
@media screen and (max-width: 600px) {
  .app-header h1 {
    font-size: 1.5rem;
  }

  .search input {
    width: 70%;
    font-size: 1rem;
  }

  .search button {
    font-size: 1rem;
    padding: 0.4rem 0.6rem;
  }

  .weather {
    font-size: 0.9rem;
  }

  .history-toggle {
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    padding: 0.4rem 0.6rem;
  }

  #historyPanel {
    width: 80vw;
    padding-top: 3rem; /* Make space so button doesn't overlap content inside */
  }

  #clearHistoryBtn {
    margin-top: 1rem;
    font-size: 0.9rem;
    padding: 0.4rem 0.6rem;
  }
}
