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

/* Main Body Styling */
body {
  font-family: 'Inter', sans-serif;
  /* Light blue gradient background */
  background: linear-gradient(to bottom right, #a5f3fc, #93c5fd);
  color: #273444; /* Dark gray for text */
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 1rem;
}

/* Main App Container */
.container {
  width: 100%;
  max-width: 600px;
  /* Frosted glass effect */
  background-color: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px); /* For Safari */
  
  padding: 2rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15);
  text-align: center;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

/* Input & Button Container */
.input-container {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0px;
}

input[type="text"] {
  flex-grow: 1;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 1rem;
  background-color: rgba(255, 255, 255, 0.7);
  color: #374151;
  outline: none;
  transition: box-shadow 0.2s;
}

input[type="text"]::placeholder {
  color: #6b7280;
}

input[type="text"]:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.4);
}

button {
  padding: 0.75rem 1.25rem;
  background-color: #2563eb;
  border: none;
  border-radius: 0.5rem;
  color: #FFF;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.1s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

button:hover {
  background-color: #1d4ed8;
}

button:active {
    transform: scale(0.98);
}


#city-name {
  font-size: 2.25rem; /* Was 3rem */
  font-weight: 700;
  margin-bottom: 0.5rem;
}

#temperature {
  font-size: 3rem; /* Was 1.5rem */
  font-weight: bold;
  margin: 0.5rem 0;
}

#feel {
  font-size: 1rem; /* Was 1.2rem */
  color: #4b5563;
  margin-bottom: 1rem;
}

#description {
  font-size: 1.25rem; /* Was 1.5rem */
  font-weight: 500;
  text-transform: capitalize;
}


#weather-info {
  margin-top: 1.5rem;
  overflow: hidden;
  max-height: 500px; /* A value larger than the content will ever be */
  transition: opacity 0.4s ease, transform 0.4s ease, max-height 0.4s ease;
}

.hidden {
  opacity: 0;
  pointer-events: none; 
}

.hide {
  display: none;
}

#weather-info.hidden {
  opacity: 0;
  max-height: 0;
  transform: translateY(20px);
}


#error-message {
  color: #dc2626;
  font-weight: 500;
  margin-top: 1.5rem;
}


#loader {
  width: 20px;
  height: 20px;
  border: 4px solid #f3f3f3; /* Light grey */
  border-top: 4px solid #2563eb; /* Blue */
  border-radius: 50%;
  margin: 20px auto; /* Center it */
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* --- Media Query for Mobile Responsiveness --- */
/* These styles will apply ONLY on screens 640px wide or smaller */

@media (max-width: 640px) {

  /* Make the main card a little more compact */
  .container {
    padding: 1.5rem;
    margin: 1rem; /* Prevents the card from touching the screen edges */
  }

  h1 {
    font-size: 1.75rem; /* Slightly smaller main title */
  }

  /* Stack the input field and button on top of each other */
  .input-container {
    flex-direction: column;
  }

  /* Adjust the typography to better fit the small screen */
  #city-name {
    font-size: 1.8rem;
  }

  #temperature {
    font-size: 2.2rem;
  }

  #description {
    font-size: 1.1rem;
  }

  #feel {
    font-size: 0.9rem;
  }
}