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

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
  transition: all 0.6s ease;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="40" r="1.5" fill="rgba(255,255,255,0.1)"/><circle cx="60" cy="80" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="30" cy="60" r="2.5" fill="rgba(255,255,255,0.05)"/><circle cx="90" cy="20" r="1" fill="rgba(255,255,255,0.1)"/></svg>') repeat;
  pointer-events: none;
  z-index: 1;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

h1 {
  text-align: center;
  color: white;
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 2rem;
  text-shadow: 0 4px 20px rgba(0,0,0,0.3);
  letter-spacing: -0.02em;
}

form {
  display: flex;
  gap: 12px;
  margin: 40px 0;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.1);
  padding: 24px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

input {
  flex: 1;
  padding: 16px 20px;
  border: none;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  outline: none;
}

input:focus {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 8px 40px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}

input::placeholder {
  color: #666;
  font-weight: 400;
}

button {
  padding: 16px 32px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  white-space: nowrap;
}

button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

button:active {
  transform: translateY(-1px);
}

#weather {
  margin: 40px 0;
  padding: 32px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transform: translateY(0);
  transition: all 0.4s ease;
}

#weather:hover {
  transform: translateY(-5px);
  box-shadow: 0 30px 80px rgba(0,0,0,0.15);
}

#weather h2 {
  font-size: 2rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#weather p {
  font-size: 1.1rem;
  color: #4a5568;
  margin: 12px 0;
  font-weight: 500;
}

#weather strong {
  color: #2d3748;
  font-weight: 600;
}

#weather img {
  max-width: 220px;
  height: auto;
  border-radius: 16px;
  margin-top: 20px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  transition: transform 0.3s ease;
}

#weather img:hover {
  transform: scale(1.05);
}

#toggle-unit {
  display: block;
  margin: 30px auto;
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
  padding: 14px 28px;
  border-radius: 16px;
  font-weight: 600;
}

#toggle-unit:hover {
  background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
}

.error {
  color: #e53e3e;
  text-align: center;
  padding: 20px;
  background: rgba(254, 226, 226, 0.9);
  border-radius: 12px;
  font-weight: 500;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

#gif-container {
  margin-top: 20px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Responsive design */
@media (max-width: 768px) {
  h1 {
    font-size: 2.5rem;
  }

  form {
    flex-direction: column;
    gap: 16px;
  }

  button {
    width: 100%;
  }

  #weather {
    padding: 24px 20px;
  }
}

/* Loading animation */
.loading {
  color: #667eea;
  font-weight: 500;
}

.loading::after {
  content: '';
  animation: dots 1.5s infinite;
}

@keyframes dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

/* Subtle floating animation for the weather card */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

#weather:not(:empty) {
  animation: float 6s ease-in-out infinite;
}