* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: #1a2233;
  background: linear-gradient(160deg, #8ec5fc, #6dd16d);
  transition: background 0.8s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.app {
  display: flex;
  width: min(1000px, 100%);
  min-height: 560px;
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

/* Map */
.map-panel { position: relative; width: 46%; min-height: 100%; }
#map { position: absolute; inset: 0; height: 100%; width: 100%; }
.map-title {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 500; background: rgba(255, 255, 255, 0.9);
  padding: 6px 14px; border-radius: 20px; font-size: 0.85rem; font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); white-space: nowrap;
}

/* Weather panel */
.weather-panel { flex: 1; padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.weather-panel.loading { opacity: 0.55; pointer-events: none; }

.search-wrap { position: relative; }
.search-row { display: flex; gap: 8px; }
#city-input {
  flex: 1; padding: 11px 16px; border-radius: 14px; border: none; font-size: 1rem;
  background: rgba(255, 255, 255, 0.75); outline: none;
}
#locate-btn, #search-btn {
  border: none; border-radius: 14px; cursor: pointer; font-size: 1rem; padding: 0 14px;
  background: rgba(255, 255, 255, 0.75); transition: background 0.2s;
}
#search-btn { background: #2980b9; color: #fff; font-weight: 600; }
#search-btn:hover { background: #1f6391; }
#locate-btn:hover { background: rgba(255, 255, 255, 0.95); }

.suggestions {
  list-style: none; margin: 6px 0 0; padding: 6px; position: absolute; z-index: 600;
  left: 0; right: 0; background: rgba(255, 255, 255, 0.98); border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2); max-height: 240px; overflow-y: auto;
}
.suggestions li { padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 0.92rem; }
.suggestions li:hover { background: #eaf3fb; }

.units { display: flex; gap: 6px; align-self: flex-start; }
.units button {
  border: none; padding: 6px 14px; border-radius: 20px; cursor: pointer; font-weight: 600;
  background: rgba(255, 255, 255, 0.4);
}
.units button.active { background: #2980b9; color: #fff; }

.current { text-align: center; background: rgba(255, 255, 255, 0.28); border-radius: 20px; padding: 22px; }
.current h1 { margin: 0 0 6px; font-size: 1.7rem; }
.wicon { font-size: 3.4rem; line-height: 1; }
.temp { font-size: 3rem; font-weight: 700; margin: 6px 0; }
.desc { text-transform: capitalize; font-size: 1.05rem; }
.feels { opacity: 0.8; font-size: 0.9rem; margin-top: 4px; }

.chips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.chip {
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(255, 255, 255, 0.28); border-radius: 14px; padding: 10px 14px;
}
.chip .k { opacity: 0.75; font-size: 0.85rem; }
.chip .v { font-weight: 700; }
.badge { padding: 3px 10px; border-radius: 12px; color: #fff; font-weight: 700; font-size: 0.8rem; }

.forecast h3 { margin: 6px 0; font-size: 0.95rem; opacity: 0.85; }
.daily, .hourly { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.fcard, .hcard {
  flex: 0 0 auto; min-width: 74px; text-align: center; padding: 10px 8px;
  background: rgba(255, 255, 255, 0.28); border-radius: 14px; font-size: 0.82rem;
}
.fcard img, .hcard img { width: 42px; height: 42px; }
.fcard .fday { display: block; font-weight: 700; margin-bottom: 2px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #d64545; color: #fff; padding: 12px 20px; border-radius: 14px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3); opacity: 0; pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 820px) {
  .app { flex-direction: column; min-height: auto; }
  .map-panel { width: 100%; height: 260px; }
  #map { position: absolute; }
  .chips { grid-template-columns: 1fr; }
}
