/* ------------------------------
   Global styles
---------------------------------*/
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #3b82f6 0, #0f172a 40%, #020617 100%);
  color: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app {
  padding: 1.5rem;
  width: 100%;
  max-width: 480px;
}

/* ------------------------------
   Weather card
---------------------------------*/
.weather-card {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 1.25rem;
  padding: 1.75rem 1.5rem 1.75rem;
  box-shadow:
    0 20px 40px rgba(15, 23, 42, 0.8),
    0 0 0 1px rgba(148, 163, 184, 0.15);
  backdrop-filter: blur(14px);
}

.app-title {
  margin: 0 0 1.25rem;
  font-size: 1.6rem;
  text-align: center;
  letter-spacing: 0.03em;
}

/* ------------------------------
   Search form
---------------------------------*/
.search-form {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.city-input {
  flex: 1;
  padding: 0.65rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.85);
  color: #e5e7eb;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.city-input::placeholder {
  color: #6b7280;
}

.city-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.4);
  background: rgba(15, 23, 42, 0.95);
}

.search-btn {
  padding: 0.65rem 1rem;
  border-radius: 0.75rem;
  border: none;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.15s ease;
}

.search-btn:hover {
  filter: brightness(1.08);
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.45);
}

.search-btn:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 4px 8px rgba(15, 23, 42, 0.8);
}

.search-btn:disabled {
  opacity: 0.65;
  cursor: default;
  box-shadow: none;
}

/* ------------------------------
   Status message (loading / error)
---------------------------------*/
.status-message {
  min-height: 1.2em; /* reserve space to avoid layout shift */
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}

.status-message--error {
  color: #f97373;
}

.status-message--loading {
  color: #93c5fd;
}

/* ------------------------------
   Weather result
---------------------------------*/
.weather-result {
  border-radius: 1rem;
  padding: 1rem 0.5rem 0.25rem;
}

.city-name {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  text-align: center;
}

.weather-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.temp-wrapper {
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
}

.temperature {
  font-size: 2.6rem;
  font-weight: 600;
}

.temp-unit {
  font-size: 1rem;
  color: #9ca3af;
}

.condition {
  margin: 0;
  font-size: 1rem;
  text-transform: capitalize;
  color: #d1d5db;
}

.weather-extra {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
}

.extra-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.extra-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
}

.extra-value {
  font-size: 0.95rem;
}

/* ------------------------------
   Utilities & accessibility
---------------------------------*/
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 480px) {
  .weather-card {
    padding: 1.25rem 1rem 1.5rem;
  }

  .app-title {
    font-size: 1.4rem;
  }

  .temperature {
    font-size: 2.2rem;
  }
}


