@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;400;600&display=swap');

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-image: url('https://hoangsonww.github.io/WeatherMate-App/utils/clouds.jpg');
  font-family: 'Poppins', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
  min-height: 100vh;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

#center {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  padding: 15px;
  margin: 10px;
  width: calc(100% - 20px);
  max-width: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.search-result-card {
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  padding: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  color: black !important;
}

.search-result-card:hover {
  background-color: #f0f0f0;
}

input {
  background-color: #fff;
  border: none;
  border-radius: 25px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  font-family: inherit;
  font-size: 1rem;
  padding: 1rem;
  min-width: 300px;
}

input:focus {
  outline: none;
}

.weather {
  font-size: 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.weather h2 {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0;
}

#search {
  background-color: #f5f5f5;
  margin-top: 30px;
}

#search:hover {
  background-color: #dcdcdc;
  transition: all 0.3s;
}

#img {
  height: 75px;
}

#btn {
  background-color: #ffffff;
  text-align: center;
  color: #000000;
  border-radius: 8px;
  font: inherit;
}

#toggle-temp {
  background-color: #ffffff;
  text-align: center;
  color: #000000;
  border-radius: 8px;
  margin-top: 12px;
}

#toggle-temp:hover {
  background-color: #dcdcdc;
  text-align: center;
}

#btn:hover {
  background-color: #dcdcdc;
  text-align: center;
}

#btn1 {
  background-color: #ffffff;
  text-align: center;
  color: #000000;
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

#btn2 {
  background-color: #ffffff;
  text-align: center;
  color: #000000;
  border-radius: 8px;
  padding: 8px;
}

#btn2:hover {
  background-color: #dcdcdc;
  text-align: center;
}

#btn1:hover {
  background-color: #dcdcdc;
  text-align: center;
}

#my-heading {
  text-align: center;
  color: black;
  margin-bottom: 10px;
}

#subhead {
  margin-top: 45px;
  text-align: center;
  color: #ff2424;
}

#favorites-section {
  background-color: #f5f5f5;
  max-height: 400px;
  overflow-y: auto;
  border-radius: 16px;
  padding: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
  width: 80%;
  max-width: 450px;
  margin-top: 30px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Style for the scrollbar */
#favorites-section::-webkit-scrollbar {
  width: 8px;
}

#favorites-section::-webkit-scrollbar-track {
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 10px;
}

#favorites-section::-webkit-scrollbar-thumb {
  background-color: #888;
  border-radius: 10px;
}

#favorites-section::-webkit-scrollbar-thumb:hover {
  background-color: #555;
}

#favorites-section div {
  padding: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  transition: background 0.3s;
}

#favorites-section div:last-child {
  border-bottom: none;
}

#favorites-section div:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

#favorites-section span {
  font-size: 1.1rem;
  transition: color 0.3s;
}

#favorites-section span:hover {
  color: #333;
}

#favorites-section button {
  padding: 5px 10px;
  font-size: 0.9rem;
  color: #fff;
  background-color: #ff6347;
  border-radius: 5px;
  transition: background-color 0.3s;
}

#favorites-section button:hover {
  background-color: #ff4500;
}

button {
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  margin-left: 10px;
  border-radius: 4px;
  background: none;
  color: white;
}

button:hover {
  background-color: #201a5b;
}

#favorites-section button {
  background: linear-gradient(135deg, #ff6347, #f44336);
  padding: 5px 12px;
  border-radius: 15px;
  color: white;
  font-weight: 500;
}

#favorites-section button:hover {
  background: linear-gradient(135deg, #f44336, #d32f2f);
}

#favorite-btn {
  background: none;
  color: grey;
  margin-left: 10px;
  position: relative;
  border-radius: 8px;
}

#favorite-btn:hover {
  background-color: #dcdcdc;
}

#favorite-btn:hover::after {
  content: 'Add to / Remove from favorites';
  position: absolute;
  top: -70px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #232323;
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
  pointer-events: none;
  z-index: 10;
}

.content {
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
  width: 600px;
  max-width: calc(100% - 20px);
  margin: 20px 0;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.content a {
  display: block;
  text-align: center;
  margin-top: 20px;
  color: dodgerblue;
  text-decoration: none;
  transition: color 0.3s;
}

.content a:hover {
  color: deepskyblue;
}

#forecast-btn {
  margin-top: 20px;
  padding: 8px 15px;
  background-color: #ffffff;
  text-align: center;
  color: #000000;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s;
}

#forecast-btn:hover {
  background-color: #efefef;
}

#forecast-display.weather {
  background-color: rgba(255, 255, 255, 0.9);
  margin-top: 15px;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

#forecast-display {
  display: none;
  margin-top: 20px;
  flex-wrap: wrap;
  justify-content: center;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

#forecast-display p {
  padding: 5px;
  margin: 5px 0;
  background: rgba(255, 255, 255, 0.8);
  text-align: center;
  font-weight: bold;
  border-radius: 8px;
}

.forecast-item {
  background: rgba(255, 255, 255, 0.8);
  padding: 10px 20px;
  margin: 10px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 10px;
}

.forecast-item:hover {
  background-color: #efefef;
  cursor: pointer;
}

.forecast-item img {
  width: 50px;
  height: 50px;
}

.chatbot {
  z-index: 1000;
  position: fixed;
  bottom: 10px;
  right: 10px;
  width: 300px;
  background-color: #fff;
  border: 1px solid #ccc;
  box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.15);
  border-radius: 10px;
  overflow: hidden;
}

#aqi-display {
  display: none;
  margin-top: 20px;
  padding: 15px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.chat-messages {
  max-height: 400px;
  overflow-y: auto;
  padding: 10px;
  background-color: #f5f5f5;
  border-bottom: 1px solid #ccc;
}

.chat-messages div {
  padding: 10px;
  margin: 5px;
  border-radius: 8px;
}

.chat-messages div:nth-child(odd) {
  background-color: #e1e1e1;
  align-self: flex-end;
  margin-right: 10%;
}

.chat-messages div:nth-child(even) {
  background-color: #c4c4ff;
  align-self: flex-start;
  margin-left: 10%;
}

.chat-input {
  width: 100%;
  padding: 10px;
  border: none;
  background-color: #534caf;
  color: white;
  outline: none;
  border-top: 1px solid #ccc;
  border-radius: 0px;
}

.chat-input::placeholder {
  color: #c4c4c4;
}

.chat-header {
  background-color: #534caf;
  color: white;
  padding: 10px;
  border-bottom: 1px solid #403890;
  font-size: 1.5rem;
  text-align: center;
}

.chat-title {
  font-weight: 400;
  font-size: 16.5px;
}

.aqi {
  padding: 10px;
  margin-top: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.aqi-text {
  font-weight: bold;
}

.aqi-1 {
  color: #17a102; /* Good */
}

.aqi-2 {
  color: #f57000; /* Fair */
}

.aqi-3 {
  color: #000000; /* Moderate */
}

.aqi-4 {
  color: #cc00c9; /* Poor */
}

.aqi-5 {
  color: #ff0000; /* Very Poor */
}

.aqi-unknown {
  color: #7e7e7e; /* Unknown */
}

#aqi-btn {
  margin-top: 20px;
  padding: 8px 15px;
  background-color: #ffffff;
  text-align: center;
  color: #000000;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s;
}

#aqi-btn:hover {
  background-color: #efefef;
}

.local-time {
  padding: 10px;
  margin-top: 10px;
  border-radius: 8px;
  text-align: center;
}

#humidity-rain-btn {
  margin-top: 20px;
  padding: 8px 15px;
  background-color: #ffffff;
  text-align: center;
  color: #000000;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s;
}

#humidity-rain-btn:hover {
  background-color: #efefef;
}

#humidity-rain-display {
  display: none;
  margin-top: 20px;
  flex-wrap: wrap;
  justify-content: center;
  background: white;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  color: black;
}

#refresh-weather {
  margin-top: 20px;
  padding: 8px 15px;
  background-color: #ffffff;
  text-align: center;
  color: #000000;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s;
}

#refresh-weather:hover {
  background-color: #efefef;
}

.local-advice {
  position: fixed;
  bottom: 0;
  left: 0;
  background: rgba(255, 255, 255, 0.9);
  padding: 10px;
  color: black;
  margin: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  font-size: 1em;
  z-index: 10;
}

.local-advice:hover {
  background-color: #dcdcdc;
}

.current-location-weather {
  position: fixed;
  top: 0;
  left: 0;
  background: #ffffff;
  margin: 20px;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  z-index: 10;
  font-size: 0.9em;
  max-width: 210px;
  max-height: 55vh;
}

.local-time-container {
  position: fixed;
  top: 30px;
  right: 5px;
  background: rgba(255, 255, 255, 0.8);
  line-height: 20px;
  margin: 20px;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  font-size: 1em;
  z-index: 10;
  text-align: center;
  padding-top: 12px;
}

.local-time-container:hover {
  background-color: #dcdcdc;
}

#local-time-label {
  position: fixed;
  top: 0;
  right: 10px;
  background: rgba(255, 255, 255, 0.8);
  padding-left: 4px;
  padding-right: 4px;
  border-radius: 4px;
}

#enable-location-btn {
  position: fixed;
  bottom: 0;
  left: 0;
  padding: 10px;
  margin: 20px;
  border-radius: 5px;
  background: #007bff;
  color: white;
  border: none;
  cursor: pointer;
  z-index: 10;
  display: block;
}

#enable-location-btn:hover {
  background: #0056b3;
}

#local-advice,
#current-location-weather,
.chatbot,
.weather-alert-sidebar {
  display: none;
}

@media (min-width: 1150px) {
  #local-time-label,
  #local-time-container,
  #local-advice,
  #current-location-weather,
  .chatbot,
  .weather-alert-sidebar {
    display: block;
  }
}

#local-time-label,
#local-time-container {
  display: block;
}

#home-btn {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  font-size: 1em;
  z-index: 10;
  border: none;
  cursor: pointer;
  position: fixed;
  top: 142px;
  right: 30px;
  color: black;
}

#home-btn:hover {
  background-color: #dcdcdc;
}

#home-label {
  position: fixed;
  top: 100px;
  right: 15px;
  text-align: center;
  background: rgba(255, 255, 255, 0.8);
  padding-left: 4px;
  padding-right: 4px;
  border-radius: 4px;
}

#wind-info-btn {
  margin-top: 20px;
  padding: 8px 15px;
  background-color: #ffffff;
  text-align: center;
  color: #000000;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s;
}

#wind-info-btn:hover {
  background-color: #efefef;
}

#wind-info {
  background-color: white;
  border: 1px solid #ddd;
  color: black;
  padding: 10px;
  border-radius: 5px;
  margin-top: 10px;
  text-align: center;
}

#feels-like-btn {
  margin-top: 20px;
  padding: 8px 15px;
  background-color: #ffffff;
  text-align: center;
  color: #000000;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s;
}

#feels-like-btn:hover {
  background-color: #efefef;
}

#feels-like-info {
  background-color: white;
  border: 1px solid #ddd;
  color: black;
  padding: 10px;
  border-radius: 5px;
  margin-top: 10px;
  text-align: center;
}

.popup {
  overflow: hidden;
  transition:
    height 1s ease,
    opacity 1s ease;
  height: 0;
  opacity: 0;
}
