/* Animated Background */
body {
  background: linear-gradient(270deg, #4facfe, #00f2fe, #43e97b, #38f9d7);
  background-size: 800% 800%;
  animation: gradientShift 20s ease infinite;
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  height: 100vh;
  padding-top: 40px;
  color: #fff;
  overflow-x: hidden;
}

/* Gradient animation */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Glassmorphism Card */
.container {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
  padding: 24px;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  width: 320px;
  text-align: center;
  animation: fadeIn 1s ease-in-out;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.container:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

.title {
  margin-bottom: 16px;
  font-size: 28px;
  letter-spacing: 1px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Inputs and Buttons */
.controls input {
  width: calc(100% - 20px);
  padding: 10px;
  margin-bottom: 12px;
  border-radius: 10px;
  border: none;
  outline: none;
  font-size: 14px;
  background: rgba(255,255,255,0.2);
  color: #fff;
  transition: box-shadow 0.3s ease;
}
.controls input:focus {
  box-shadow: 0 0 10px rgba(255,255,255,0.5);
}

.controls button {
  margin: 4px;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: rgba(255,255,255,0.15);
  color: #fff;
  transition: background 0.3s, transform 0.2s;
}
.controls button:hover {
  background: rgba(255,255,255,0.3);
  transform: scale(1.05);
}
.controls button:active {
  transform: scale(0.95);
}

/* Weather card */
.card {
  margin-top: 16px;
  padding: 16px;
  border-radius: 14px;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  transition: transform 0.4s ease, opacity 0.4s ease, box-shadow 0.4s ease;
  border: 1px solid rgba(255,255,255,0.2);
}
.card.show {
  animation: popIn 0.5s ease forwards;
}
@keyframes popIn {
  from {transform: scale(0.9); opacity: 0;}
  to {transform: scale(1); opacity: 1;}
}

.icon-container {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}
.icon-container img {
  width: 80px;
  animation: float 3s infinite ease-in-out;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.temp {
  font-size: 38px;
  font-weight: bold;
  margin-bottom: 4px;
}
.desc {
  font-size: 18px;
  text-transform: capitalize;
}
.wind {
  margin-top: 8px;
  font-size: 14px;
}

/* Error message */
.error {
  margin-top: 12px;
  color: #ffdddd;
  font-size: 14px;
  animation: shake 0.3s ease;
}
@keyframes shake {
  0%,100% {transform: translateX(0);}
  25% {transform: translateX(-4px);}
  75% {transform: translateX(4px);}
}

/* Animations */
.hidden {
  opacity: 0;
  transform: translateY(10px);
}
.fade-in {
  animation: fadeIn 1s ease forwards;
}
@keyframes fadeIn {
  from {opacity: 0;}
  to {opacity: 1;}
}
@keyframes float {
  0%, 100% {transform: translateY(0);}
  50% {transform: translateY(-6px);}
}

/* Responsive Design */
@media (max-width: 400px) {
  .container {
    width: 90%;
    padding: 20px;
  }
  .title {
    font-size: 24px;
  }
}


.clouds {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://png.pngtree.com/png-clipart/20230401/original/pngtree-white-cloud-png-image_9021605.png') repeat-x;
    background-size: contain;
    animation: moveClouds 60s linear infinite;
    opacity: 0.5;
}

@keyframes moveClouds {
    0% { background-position: 0 0; }
    100% { background-position: -10000px 0; }
}

