* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  transition: background 0.6s ease; /* Smooth background change */
  background: linear-gradient(135deg, #4facfe, #00f2fe); /* Default */
}

.app {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(15px);
  padding: 2rem;
  border-radius: 1.5rem;
  text-align: center;
  width: 360px;
  color: #fff;
  box-shadow: 0px 8px 20px rgba(0,0,0,0.3);
}

h1 {
  margin-bottom: 1rem;
  font-size: 1.8rem;
}

.search-box {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.search-box input {
  flex: 1;
  padding: 0.7rem 1rem;
  border-radius: 2rem;
  border: none;
  outline: none;
  font-size: 1rem;
}

.search-box button {
  padding: 0.7rem 1.2rem;
  border: none;
  border-radius: 2rem;
  background: #ff7eb3;
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

.search-box button:hover {
  background: #ff5277;
}

/* Weather card */
.weather-card {
  margin-top: 1rem;
  background: rgba(255, 255, 255, 0.2);
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: inset 0px 2px 6px rgba(0,0,0,0.2);
}

.weather-card img {
  width: 100px;
  margin: 1rem 0;
}

#temp {
  font-size: 2.5rem;
  font-weight: bold;
}

.details {
  margin-top: 1rem;
  display: flex;
  justify-content: space-around;
}

/* Loader spinner */
.loader {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #fff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  margin: 1rem auto;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

/* Error message */
.error {
  margin-top: 1rem;
  color: #ffdddd;
  background: rgba(255, 0, 0, 0.3);
  padding: 0.5rem;
  border-radius: 0.5rem;
}

/* Hidden class */
.hidden {
  display: none;
}

/* Responsive */
@media (max-width: 420px) {
  .app {
    width: 95%;
  }
  .search-box {
    flex-direction: column;
  }
  .search-box input, .search-box button {
    width: 100%;
  }
}
