:root {
/* Color Variables */
--primary-color: #6b8bbf; /* Adjusted for better visibility */
--secondary-color: #83a4c9; /* Adjusted for better visibility */
--text-color: #222; /* Slightly darker for improved readability */
--background-color: #ffffff; /* Main background */
--input-background: rgba(255, 255, 255, 0.9); /* Slightly less transparent for better visibility */
--shadow-color: rgba(0, 0, 0, 0.05); /* Lighter shadow for subtle effect */
--error-color: rgb(210, 100, 100); /* Slightly darker red for better contrast */
--card-background: rgba(240, 240, 240, 0.9); /* Light grayish-blue for card background */
--h1-temp: #86abb9; /* Remains the same, light and subtle */
--details-color: #4681b9; /* Remains the same, visible */
--details-alt-color: #6085a0; /* Remains the same, visible */

/* Gradient Variables */
--gradient-clear: linear-gradient(135deg, #7bbcff, #8ab6ff); /* Slightly adjusted for harmony */
--gradient-cloudy: linear-gradient(135deg, #7a8999, #a3b4c4); /* Lighter and harmonious */
--gradient-rainy: linear-gradient(135deg, #6a7d8e, #3c4a56); /* Lighter tones for contrast */
--gradient-snowy: linear-gradient(135deg, #e5f1fd, #d1e5ff); /* Soft and gentle */
--gradient-stormy: linear-gradient(135deg, #4a5568, #6b7586); /* Adjusted for less harsh contrast */
--gradient-start-thunderstorm: #3c4d6b; /* Slightly lighter for better blending */
--gradient-end-thunderstorm: #5c6b7d; /* Slightly lighter for better blending */

}

* {
  margin: 0;
  padding: 0;
  font-family: 'Courier New', sans-serif;
  box-sizing: border-box;
}

@keyframes gradientAnimation {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

body {
  color: var(--text-color);
  padding-bottom: 60px;
  position: relative;
  z-index: 1;
  background: var(--secondary-color);
  background-size: cover;
}

body.weather-clear {
  background: var(--gradient-clear);
  background-size: 400% 400%;
  animation: gradientAnimation 15s ease infinite;
}

body.weather-cloudy {
  background: var(--gradient-cloudy);
  background-size: 400% 400%;
  animation: gradientAnimation 15s ease infinite;
}

body.weather-rainy {
  background: var(--gradient-rainy);
  background-size: 400% 400%;
  animation: gradientAnimation 15s ease infinite;
}

body.weather-snowy {
  background: var(--gradient-snowy);
  background-size: 400% 400%;
  animation: gradientAnimation 15s ease infinite;
}

body.weather-stormy {
  background: var(--gradient-stormy);
  background-size: 400% 400%;
  animation: gradientAnimation 15s ease infinite;
}

#particleCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.cover {
  width: 100%;
  max-width: 1000px;
  height: 300px;
  padding: 1rem;
  background-image: url('images/cover.png');
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  border-radius: 0 0 15px 15px;
  margin: 0 auto;
  box-shadow: 0 2px 10px var(--shadow-color);
  z-index: 100001;
  transition: background-size 0.3s ease, filter 0.3s ease;
}

.cover:hover {
  background-size: 102% auto;
  filter: brightness(1.05);
}

.cover::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,0.1), rgba(255,255,255,0));
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.cover:hover::after {
  opacity: 1;
}

nav {
  background: var(--secondary-color);
  color: #ffffff;
  text-align: center;
  padding: 1rem;
  box-shadow: 0 2px 4px var(--shadow-color);
  font-family: 'Courier New', monospace;
}

nav ul {
  list-style-type: none;
  padding: 0;
  text-align: center;
}

nav li {
  display: inline-block;
  margin: 0 15px;
}

nav a {
  text-decoration: none;
  color: #ffffff;
  padding: 10px 20px;
  display: inline-block;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

nav a:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.card {
  position: relative;
  width: 90%;
  max-width: 500px;
  background: var(--card-background);
  color: var(--details-alt-color);
  margin: 2rem auto;
  border-radius: 10px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 4px 6px var(--shadow-color);
  text-shadow: 0 .5px .5px #b5c5db;
  z-index: 2;
  backdrop-filter: blur(10px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 12px var(--shadow-color);
}

.search {
  width: 100%;
  display: flex;
  position: relative;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

#suggestionsList {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-height: 200px;
  overflow-y: auto;
  background-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  border: 1px solid #ddd;
  border-top: none;
  z-index: 1000;
  border-radius: 0 0 10px 10px;
}

#suggestionsList li {
  padding: 12px 15px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#suggestionsList li:hover {
  background-color: #f0f0f0;
}

.search input {
  border: 1px solid rgba(0, 0, 0, 0.1);
  outline: 0;
  background: var(--input-background);
  color: var(--text-color);
  padding: 0.75rem 1rem;
  height: 50px;
  border-radius: 25px;
  flex: 1;
  margin-right: 12px;
  font-size: 16px;
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

.search input:focus {
  box-shadow: 0 0 0 2px var(--primary-color);
  background-color: rgba(255, 255, 255, 0.1);
}

.search button {
  border: 0;
  outline: 0;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.search button:hover {
  background-color: #3a8fcf;
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.search button img {
  width: 16px;
  filter: brightness(0) invert(1);
}

.weather-icon {
  width: 120px;
  margin-top: 1rem;
  transition: transform 0.3s ease;
}

.weather-icon:hover {
  transform: rotate(10deg);
}

.weather h1 {
  font-size: 4rem;
  font-weight: 700;
  margin: 1rem 0;
  color: var(--h1-temp);
}

.weather h2 {
  font-size: 2rem;
  font-weight: 500;
  margin-bottom: 1rem;
  color: var(--details-color);
  text-shadow: #4a5568;
}

.details {
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-wrap: wrap;
  margin: 2rem;
}

.recent-searches.show {
  display: block;
  /* or any other styles to make it visible */
}



.recent-searches.show {
  display: block !important;
}



.col {
  display: flex;
  align-items: center;
  text-align: left;
  margin: 1rem;
  min-width: 45%;
  transition: transform 0.2s ease;
}

.col:hover {
  transform: scale(1.05);
}

.col img {
  width: 40px;
  margin-right: 10px;
}

.humidity, .wind, .feels-like, .uv-index {
  font-size: 1.25rem;
  color: var(--details-color);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.weather {
  display: none;
}

.error {
  color: var(--error-color);
  text-align: left;
  margin-top: 1rem;
  display: none;
}

.mobile-recent-searches {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--card-background);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  padding: 20px;
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.3s ease-in-out;
}

.mobile-recent-searches.show {
  transform: translateY(0);
}

.mobile-recent-searches h3 {
  margin-bottom: 15px;
  font-size: 18px;
  color: var(--details-color);
}

#recentSearchesList {
  list-style-type: none;
  padding: 0;
  margin: 0 0 15px 0;
  max-height: 50vh;
  overflow-y: auto;
}

#recentSearchesList li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

#recentSearchesList li:last-child {
  border-bottom: none;
}

.city-name {
  flex-grow: 1;
  padding-right: 10px;
  cursor: pointer;
}

.delete-search {
  background: none;
  border: none;
  color: var(--error-color);
  font-size: 20px;
  padding: 5px 10px;
  cursor: pointer;
}

#clearRecentSearches {
  display: block;
  width: 100%;
  padding: 12px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 5px;
  margin-top: 15px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#clearRecentSearches:hover {
  background-color: #3a8fcf;
}

.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  color: #fff;
  padding: 1rem;
  font-size: 0.9rem;
  background: var(--secondary-color);
  text-align: center;
  z-index: 3;
  backdrop-filter: blur(5px);
}

@media (min-width: 768px) {
  .col {
    min-width: 22%;
  }
}

@media (max-width: 768px) {
  .card {
    padding: 1.5rem;
  }

  .weather h1 {
    font-size: 3rem;
  }

  .weather h2 {
    font-size: 1.5rem;
  }

  .details {
    flex-direction: column;
  }

  .col {
    margin-bottom: 1rem;
  }

  #suggestionsList {
    position: absolute;
    top: 100%;
    bottom: auto;
    left: 0;
    right: 0;
    max-height: 40vh;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 10px var(--shadow-color);
  }
}

@media (max-width: 480px) {
  .cover {
    height: 200px;
  }

  .card {
    padding: 1rem;
  }

  .weather h1 {
    font-size: 2.5rem;
  }

  .weather h2 {
    font-size: 1.25rem;
  }

  .col img {
    width: 30px;
  }

  .humidity, .wind, .feels-like, .uv-index {
    font-size: 1rem;
  }

  .footer {
    font-size: 0.8rem;
  }

  .mobile-recent-searches {
    padding: 15px;
  }

  #recentSearchesList li {
    padding: 10px 0;
    font-size: 14px;
  }

  #suggestionsList {
    max-height: 50vh;
    font-size: 14px;
  }
}

@media (max-width: 400px) {
  .search {
    flex-direction: column;
  }

  .search input {
    width: 100%;
    margin: 0 0 0.5rem 0;
  }

  .search button {
    border-radius: 25px;
  }

  .card {
    margin: 1rem auto;
  }
}