:root {
  --bg-color: #1e3c72;
  --text-color: white;
}

body.dark {
  --bg-color: #121212;
  --text-color: #e0e0e0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: background 0.4s ease, color 0.4s ease;
  min-height: 100vh;
}

h1 {
  margin-top: 40px;
}

input[type="text"] {
  padding: 12px 16px;
  margin-top: 20px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  width: 250px;
  outline: none;
}

button {
  margin-top: 10px;
  padding: 12px 20px;
  font-size: 1rem;
  background-color: #4fc3f7;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

#loading {
  margin-top: 20px;
  font-style: italic;
  display: none;
}

#output, #forecastContainer {
  margin-top: 20px;
  text-align: center;
  padding: 20px;
  width: 90%;
  max-width: 400px;
  background-color: rgba(255,255,255,0.1);
  border-radius: 10px;
  color: #e3f2fd;
}

.autocomplete-list {
  list-style: none;
  padding: 0;
  margin: 5px 0 0;
  width: 250px;
  background: white;
  color: black;
  border-radius: 5px;
}

.autocomplete-list li {
  padding: 10px;
  cursor: pointer;
}
.autocomplete-list li:hover {
  background: #f0f0f0;
}

/* Forecast card layout */
.forecast-card {
  background: rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 10px;
  margin: 10px;
  display: inline-block;
  width: 100px;
}
.forecast-card img {
  width: 50px;
  height: 50px;
}

/* Toggle */
.toggle-switch {
  position: absolute;
  top: 20px;
  right: 20px;
}
.toggle-switch input {
  display: none;
}
.toggle-switch .slider {
  width: 50px;
  height: 25px;
  background-color: #ccc;
  border-radius: 50px;
  display: inline-block;
  position: relative;
  cursor: pointer;
}
.toggle-switch .slider::before {
  content: "";
  position: absolute;
  height: 21px;
  width: 21px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}
.toggle-switch input:checked + .slider {
  background-color: #2196F3;
}
.toggle-switch input:checked + .slider::before {
  transform: translateX(25px);
}
#weatherContainer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
  width: 100%;
  max-width: 900px;
}

#output, #forecastContainer {
  width: 100%;
  max-width: 400px;
  padding: 20px;
  border-radius: 10px;
  background-color: rgba(255,255,255,0.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

#forecastContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.forecast-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.5s ease-out forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Add to index.css */
.spinner {
  border: 4px solid rgba(255,255,255,0.2);
  border-top: 4px solid white;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  animation: spin 1s linear infinite;
  margin-top: 20px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
button:hover {
  background-color: #039be5;
  transform: scale(1.05);
  transition: all 0.2s ease-in-out;
}

.forecast-card:hover {
  transform: scale(1.05);
  background-color: rgba(255,255,255,0.15);
  transition: all 0.3s ease-in-out;
}

#suggestions li {
  transition: background-color 0.2s ease;
}

@media (max-width: 600px) {
  #weatherContainer {
    display: flex;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: center;
    width: 100vw;
    padding: 0 10px;
    box-sizing: border-box;
  }

  #output,
  #forecastContainer {
    width: 100% !important;
    max-width: 100% !important;
    margin: 10px 0;
  }

  .forecast-row {
    flex-direction: column;
    align-items: center;
  }

  .forecast-card {
    width: 80%;
    max-width: 300px;
    margin: 10px auto;
  }

  input[type="text"],
  .autocomplete-list {
    width: 90%;
  }
}
.action-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

#recent-searches-container {
  margin-top: 10px;
  text-align: center;
  color: var(--text-color);
}

#recent-searches-container h4 {
  font-size: 1rem;
  margin-bottom: 8px;
}

#recent-searches {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  list-style: none;
  padding: 0;
}

.recent-search-item {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: background 0.3s;
}

.recent-search-item:hover {
  background-color: rgba(255, 255, 255, 0.2);
}
.footer-signature {
  position: fixed;
  bottom: 10px;
  right: 15px;
  font-size: 14px;
  font-family: sans-serif;
  color: #888;
  opacity: 0.8;
  z-index: 999;
}


