/* === Base Styles === */
body {
  font-family: Arial, sans-serif;
  background: linear-gradient(120deg, #83a4d4, #b6fbff 80%);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  margin: 0;
  padding: 1.5rem 1rem;
  transition: background 0.3s, color 0.3s;
}

.container {
  background-color: #fff;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  text-align: center;
  width: 100%;
  max-width: 700px;
  animation: popIn 0.7s cubic-bezier(.68, -0.55, .27, 1.55);
  transition: background 0.3s, color 0.3s;
}

@keyframes popIn {
  0% { transform: scale(0.9) translateY(40px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* === Search Bar === */
.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 1rem 0;
}

input {
  flex: 1;
  padding: 10px;
  font-size: 16px;
  border: 2px solid #83a4d4;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.3s, color 0.3s;
  min-width: 180px;
}

input:focus {
  border-color: #4a90e2;
  box-shadow: 0 0 6px #4a90e2aa;
}

input::placeholder {
  color: #666;
  opacity: 0.8;
}

/* === Buttons === */
button {
  padding: 10px 18px;
  font-size: 16px;
  cursor: pointer;
  background: linear-gradient(90deg, #4a90e2, #00c6fb);
  color: #fff;
  border: none;
  border-radius: 6px;
  transition: background 0.3s, transform 0.1s, box-shadow 0.2s;
}

button:hover {
  background: linear-gradient(90deg, #00c6fb, #4a90e2);
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

button:active {
  transform: scale(0.97);
}

/* === Weather Result === */
#weatherResult {
  margin-top: 24px;
  font-size: 17px;
  min-height: 60px;
  line-height: 1.6;
}

/* === Map === */
#map {
  height: 400px;
  border-radius: 10px;
  margin-top: 10px;
  width: 100%;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* === Spinner === */
.spinner {
  border: 4px solid #e3e3e3;
  border-top: 4px solid #298dff;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  animation: spin 1s linear infinite;
  margin: 18px auto;
  display: none; /* Hidden by default */
}
@keyframes spin {
  0% { transform: rotate(0deg);}
  100% { transform: rotate(360deg);}
}

/* === Hidden Utility === */
.hidden {
  display: none;
}

/* === Dark Mode === */
body.dark-mode {
  background: linear-gradient(120deg, #0f2027, #203a43, #2c5364);
  color: #f1f1f1;
}

body.dark-mode .container {
  background: #1e1e1e;
  color: #f1f1f1;
}

body.dark-mode input {
  background: #222;
  color: #f1f1f1;
  border: 1px solid #555;
}

body.dark-mode input::placeholder {
  color: #aaa;
}

body.dark-mode button {
  background: linear-gradient(90deg, #333, #555);
  color: #f1f1f1;
  border: 1px solid #666;
}

body.dark-mode button:hover {
  background: linear-gradient(90deg, #555, #333);
}

/* tiny utility for screen-reader-only labels */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
