:root {
  --bg: #edf4ff;
  --card: rgba(255, 255, 255, 0.92);
  --text: #192131;
  --muted: #5f6c85;
  --accent: #4facfe;
  --accent-strong: #0f77f5;
  --border: rgba(79, 172, 254, 0.25);
  --input-bg: rgba(255, 255, 255, 0.88);
  --shadow: 0 28px 80px rgba(15, 85, 163, 0.12);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(79, 172, 254, 0.3), transparent 18%),
    radial-gradient(
      circle at 80% 12%,
      rgba(0, 242, 254, 0.16),
      transparent 22%
    ),
    linear-gradient(180deg, #eef7ff 0%, #cfe5ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition:
    background 0.4s ease,
    color 0.4s ease;
}

body.dark {
  background: linear-gradient(180deg, #071623 0%, #101e33 100%);
  color: #e2e8f0;
}

.app {
  width: min(560px, 100%);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 30px;
  box-shadow: var(--shadow);
  padding: 30px;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

body.dark .card {
  background: rgba(12, 23, 38, 0.92);
  border-color: rgba(96, 165, 250, 0.18);
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.title-block {
  display: grid;
  gap: 6px;
}

h1 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: -0.04em;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.theme-toggle {
  border: 1px solid var(--border);
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 11px 18px;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  background: rgba(79, 172, 254, 0.12);
}

.form-row {
  display: flex;
  gap: 14px;
  margin-bottom: 26px;
}

input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px 18px;
  font-size: 1rem;
  background: var(--input-bg);
  color: black;
  outline: none;
  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}

input::placeholder {
  color: var(--muted);
}

.primary {
  border: none;
  border-radius: 18px;
  padding: 16px 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 18px 30px rgba(79, 172, 254, 0.26);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 36px rgba(79, 172, 254, 0.3);
}

.weather-card {
  display: grid;
  gap: 20px;
  padding: 24px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.65);
}

body.dark .weather-card {
  background: rgba(10, 19, 34, 0.82);
  border-color: rgba(255, 255, 255, 0.08);
}

.weather-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.weather-summary h2 {
  margin: 0;
  font-size: 2.2rem;
}

.details {
  margin: 6px 0 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.weather-summary img {
  width: 82px;
  height: 82px;
}

.temp-large {
  margin: 0;
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.weather-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 14px;
}

.info-block {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 18px;
  padding: 16px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.7);
}

body.dark .info-block {
  background: rgba(12, 23, 38, 0.78);
  border-color: rgba(255, 255, 255, 0.08);
}

.info-block span {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.info-block small {
  color: var(--muted);
  font-size: 0.85rem;
}

.error {
  color: #dc2626;
  font-weight: 700;
  text-align: center;
  margin: 0;
}

@media (max-width: 540px) {
  .form-row {
    flex-direction: column;
  }

  .weather-summary {
    flex-direction: column;
    align-items: flex-start;
  }

  .weather-summary img {
    margin-top: 8px;
  }

  .weather-info {
    grid-template-columns: 1fr;
  }
}
.input-group {
  position: relative;
  flex: 1;
}

#suggestions {
  position: absolute;

  top: calc(100% + 8px);

  left: 0;

  width: 100%;

  background: white;

  border-radius: 18px;

  border: 1px solid var(--border);

  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);

  overflow: hidden;

  max-height: 280px;

  overflow-y: auto;

  z-index: 999;

  display: none;
}

body.dark #suggestions {
  background: rgba(12, 23, 38, 0.95);

  border-color: rgba(255, 255, 255, 0.08);
}

.suggestion-item {
  padding: 14px 18px;

  cursor: pointer;

  transition: 0.25s;

  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

body.dark .suggestion-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.suggestion-item:hover {
  background: #4facfe;

  color: white;
}

.suggestion-item strong {
  display: block;

  font-size: 16px;

  margin-bottom: 4px;
}

.suggestion-item small {
  color: #666;
}

body.dark .suggestion-item small {
  color: #bfc7d4;
}

.suggestion-item:hover small {
  color: white;
}

.forecast-container {
  margin-top: 25px;

  display: grid;

  grid-template-columns: repeat(3, 1fr);

  gap: 15px;
}

.forecast-card {
  background: white;

  border-radius: 15px;

  padding: 15px;

  text-align: center;

  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.forecast-card img {
  width: 60px;

  height: 60px;
}

body.dark .forecast-card {
  background: #1b2b42;
}

.last-updated {
  text-align: center;
  margin-top: 20px;
  color: gray;
  font-size: 14px;
}

.footer {
  text-align: center;
  margin-top: 25px;
  color: gray;
}

.footer p {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.footer small {
  display: block;
  margin-top: 5px;
  font-size: 13px;
}

.suggestion-item.active {
  background: #4facfe;
  color: white;
}

.weather-card {
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
