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

body {
  font-family: 'Segoe UI', sans-serif;
  background: linear-gradient(160deg, #0d1b2a, #1b4332);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.app {
  width: 100%;
  max-width: 400px;
}

/* Search */
.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.search-bar input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 10px;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 0.95rem;
  outline: none;
  transition: background 0.2s;
}

.search-bar input::placeholder { color: rgba(255,255,255,0.4); }
.search-bar input:focus { background: rgba(255,255,255,0.18); }

.search-bar button {
  padding: 12px 20px;
  background: #2d6a4f;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}

.search-bar button:hover { background: #40916c; }

/* Error */
.error {
  background: rgba(239,68,68,0.2);
  border: 1px solid #ef4444;
  color: #fca5a5;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  margin-bottom: 12px;
}

.error.hidden { display: none; }

/* Weather Card */
.weather-card {
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 28px 24px;
  color: #fff;
  animation: fadeUp 0.3s ease;
}

.weather-card.hidden { display: none; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.location { margin-bottom: 20px; }

.location h2 {
  font-size: 1.6rem;
  font-weight: 700;
}

.location span {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.5);
}

.main-weather {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.weather-icon { font-size: 4rem; line-height: 1; }

.temp-block { display: flex; align-items: flex-start; gap: 8px; }

#temperature {
  font-size: 3.2rem;
  font-weight: 300;
  line-height: 1;
}

.unit-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  margin-top: 6px;
}

.unit-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.unit-btn.active { color: #fff; background: rgba(255,255,255,0.15); }
.unit-btn:hover:not(.active) { color: rgba(255,255,255,0.7); }

#description {
  text-transform: capitalize;
  color: rgba(255,255,255,0.6);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.detail-item {
  background: rgba(0,0,0,0.2);
  border-radius: 10px;
  padding: 12px 14px;
}

.detail-label {
  display: block;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.detail-value {
  font-size: 1.05rem;
  font-weight: 600;
}

/* API Notice */
.api-notice {
  margin-top: 16px;
  background: rgba(245,158,11,0.15);
  border: 1px solid rgba(245,158,11,0.4);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.83rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.5;
}

.api-notice a { color: #fbbf24; text-decoration: none; }
.api-notice a:hover { text-decoration: underline; }
.api-notice code {
  background: rgba(0,0,0,0.3);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.8rem;
}
