/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  line-height: 1.6;
  color-scheme: light dark;
}

body {
  font-family: "Inter", "Segoe UI", Tahoma, sans-serif;
  background: linear-gradient(to bottom right, #e0eafc, #cfdef3);
  color: #222;
  padding: 2rem;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-direction: column;
}

/* Container */
.container {
  max-width: 1000px;
  width: 90%;
  padding: 2rem 3rem;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(14px);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.4);
  margin: auto;
}

/* Header */
h1 {
  font-size: 3rem;
  margin-bottom: 2rem;
  text-align: center;
  color: #1a1a1a;
}

/* Controls */
.controls {
  display: flex;
  justify-content: center;
  align-items: stretch; /* Ensures equal height */
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

/* My Location button — unified height */
.location-btn {
  font-size: 1rem;
  padding: 0.6rem 1.5rem;
  line-height: 1.5;
  background-color: #f4f7fa;
  border: 1.5px solid #ccc;
  border-radius: 8px;
  color: #444;
  cursor: pointer;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  white-space: nowrap;
  height: 100%; /* ensure it matches other controls */
}

.location-btn:hover,
.location-btn:focus {
  background-color: #e1e6ed;
  border-color: #999;
  outline: none;
}

.location-btn:hover,
.location-btn:focus {
  background-color: #e1e6ed;
  border-color: #999;
  outline: none;
}

#city-select {
  padding: 0.6rem 1rem;
  font-size: 1rem;
  border-radius: 8px;
  border: 1.5px solid #ccc;
  background: #f4f7fa;
  cursor: pointer;
  min-width: 180px;
  outline: none;
}

#city-select:focus {
  border-color: #007bff;
}

.search-bar {
  display: flex;
  gap: 0.75rem;
  flex-grow: 1;
  max-width: 480px;
}

#city-input {
  flex-grow: 1;
  padding: 0.6rem 1rem;
  font-size: 1rem;
  border-radius: 8px 0 0 8px;
  border: 1.5px solid #ccc;
  box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.05);
  transition: border-color 0.3s ease;
  color: #333;
}

#city-input:focus {
  outline: none;
  border-color: #007bff;
}

#search-btn {
  padding: 0.6rem 1.5rem;
  font-size: 1rem;
  border-radius: 0 8px 8px 0;
  border: none;
  background-color: #007bff;
  color: white;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#search-btn:hover,
#search-btn:focus {
  background-color: #0056b3;
  outline: none;
}

/* City Card */
.city {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.07);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.city:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

/* City Title */
.city h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
  color: #222;
}

/* Date and Time */
.date,
.time {
  font-size: 1.5rem;
  color: #555;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

/* Error message */
#error-message {
  color: #d93025;
  font-size: 1.1rem;
  text-align: center;
  margin-top: 1rem;
  font-weight: 600;
}

.hidden {
  display: none;
}

/* Footer */
footer {
  margin-top: 3rem;
  font-size: 1rem;
  text-align: center;
  color: #555;
  width: 100%;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
  padding: 1rem 0;
}

footer a {
  color: #007bff;
  text-decoration: none;
  font-weight: 500;
}

footer a:hover,
footer a:focus {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 700px) {
  .container {
    width: 95%;
    padding: 1.5rem 2rem;
  }

  h1 {
    font-size: 2.25rem;
  }

  .city h2 {
    font-size: 1.75rem;
  }

  #city-input,
  #search-btn {
    font-size: 1rem;
    padding: 0.75rem 1rem;
  }
}

#back-to-home {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-weight: 500;
  text-decoration: none;
  color: #007bff;
}
#back-to-home:hover {
  text-decoration: underline;
}
