body {
    
    display: flex;
    flex-direction: column;
    align-items: center; /* horizontal centering */
    justify-content: flex-start; /* vertical alignment */
    min-height: 100vh; /* make body full height */
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #b9dcfc;
}

form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 300px;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.weather-card {
    border: 1px solid #ddd;
    padding: 10px;
    margin-top: 20px;
    width: 300px;
    border-radius: 5px;
    background-color: #fafafa;
    text-align: center;
}

#suggestions {
    border: 1px solid #ccc;
    max-height: 150px;
    overflow-y: auto;
    position: absolute;
    background: white;
    width: 300px; /* match form width */
    z-index: 1000;
}

#suggestions div:hover {
    background-color: #f0f0f0;
}


#suggestions {
    border: 1px solid #ccc;
    max-height: 150px;
    overflow-y: auto;
    position: absolute;
    background: white;
    width: 200px;
    z-index: 1000; /* ensures it stays on top */
}
#suggestions div {
    padding: 0px;
    cursor: pointer;
}
#suggestions:empty {
    display: none;
}
#suggestions div:hover {
    background-color: #f0f0f0;
}

#current {
    max-width: 60vw;
    margin: 20px auto; /* centers the card */
    background-color: #f0f4f8;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    padding: 15px;
    text-align: center;
}

#current img {
    width: 80px;
    height: 80px;
    margin-top: 10px;
}

#current h2 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}


.weather-card {
    border: 1px solid #ddd;
    padding: 10px;
    margin-top: 20px;
    width: 50px;
    border-radius: 5px;
    background-color: #fafafa;
}

.forecast-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.forecast-day {
    flex: 1 1 120px; /* Each card at least 120px wide, grow if space */
    background-color: #f0f4f8;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    padding: 10px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.forecast-day:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.forecast-day img {
    width: 50px;
    height: 50px;
}

.forecast-day h3 {
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.weather-wrapper {
    max-width: 100vw;        /* never wider than viewport */
    padding: 0 10px;         /* small horizontal buffer */
    box-sizing: border-box;  /* include padding in width */
}


/* Hourly Forecast */
.hourly-scroll {
  display: flex;
  overflow-x: auto;
  gap: 5px;
  padding: 5px 0;
}

.hourly-scroll::-webkit-scrollbar {
  height: 6px;
}

.hourly-scroll::-webkit-scrollbar-thumb {
  background: #aaa;
  border-radius: 4px;
}

.hour-card {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 6px;
  text-align: center;
  min-width: 50px;
}
.hour-card img {
  width: 32px;
  height: 32px;
}
.hour-card p {
  margin: 4px 0;
  font-size: 0.85rem;
}
