/* Weather — your destinations */
:root {
  --bg: #f5f7fb;
  --bg-card: #ffffff;
  --bg-card-night: #1e2a47;
  --fg: #1a1f2e;
  --fg-muted: #64748b;
  --fg-night: #e8eef9;
  --fg-muted-night: #9aa7c2;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --danger: #ef4444;
  --border: #e2e8f0;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  line-height: 1.5;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.app-header {
  text-align: center;
  margin-bottom: 2rem;
}

.app-header h1 {
  font-size: 2.25rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

.logo {
  display: inline-block;
  transform: translateY(-2px);
}

.tagline {
  color: var(--fg-muted);
  margin: 0.25rem 0 0;
}

/* Search */
.add-destination {
  max-width: 560px;
  margin: 0 auto 2.5rem;
  position: relative;
}

.search-form input {
  width: 100%;
  padding: 0.85rem 1.1rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius);
  outline: none;
  box-shadow: var(--shadow);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.search-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 10;
}

.search-results:empty {
  display: none;
}

.search-list {
  list-style: none;
  margin: 0;
  padding: 0.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 340px;
  overflow-y: auto;
}

.search-list li + li {
  margin-top: 2px;
}

.search-list form {
  margin: 0;
}

.search-hit {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  background: transparent;
  border: none;
  padding: 0.7rem 0.85rem;
  font: inherit;
  text-align: left;
  border-radius: 8px;
  cursor: pointer;
  color: var(--fg);
}

.search-hit:hover,
.search-hit:focus-visible {
  background: #eef2ff;
  outline: none;
}

.hit-name {
  font-weight: 600;
}

.hit-meta {
  color: var(--fg-muted);
  font-size: 0.875rem;
}

.search-empty {
  background: var(--bg-card);
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--fg-muted);
  margin: 0;
}

/* Destination grid */
.destinations {
  min-height: 120px;
}

.loading {
  text-align: center;
  color: var(--fg-muted);
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin: 0;
}

.empty-state h2 {
  margin: 0.5rem 0 0.25rem;
  font-size: 1.25rem;
}

.empty-state p {
  color: var(--fg-muted);
  margin: 0;
}

.destination-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

/* Card */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.05), 0 12px 28px rgba(15, 23, 42, 0.08);
}

.card-day {
  background: linear-gradient(145deg, #ffffff 0%, #eef4ff 100%);
}

.card-night {
  background: linear-gradient(145deg, #243154 0%, #141c35 100%);
  color: var(--fg-night);
}

.card-night .card-region,
.card-night .now-feels,
.card-night dt {
  color: var(--fg-muted-night);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.card-head h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card-region {
  margin: 0.15rem 0 0;
  font-size: 0.875rem;
  color: var(--fg-muted);
}

.btn-remove {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(100, 116, 139, 0.12);
  color: inherit;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms ease, color 120ms ease;
}

.btn-remove:hover {
  background: var(--danger);
  color: white;
}

/* Now block */
.card-now {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 0.85rem;
}

.now-icon {
  font-size: 2.75rem;
  line-height: 1;
}

.now-temp {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.now-meta {
  display: flex;
  flex-direction: column;
}

.now-label {
  font-weight: 600;
}

.now-feels {
  color: var(--fg-muted);
  font-size: 0.875rem;
}

/* Stats */
.card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem 0.75rem;
  margin: 0;
}

.card-stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card-stats dt {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-muted);
  margin: 0;
  font-weight: 600;
}

.card-stats dd {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
}

.uv-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.uv-low { background: #d1fae5; color: #065f46; }
.uv-moderate { background: #fef3c7; color: #92400e; }
.uv-high { background: #fed7aa; color: #9a3412; }
.uv-very-high { background: #fecaca; color: #991b1b; }
.uv-extreme { background: #e9d5ff; color: #6b21a8; }

.card-night .uv-chip {
  filter: brightness(0.9);
}

/* Forecast */
.forecast-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.3rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.day-chip {
  text-align: center;
  padding: 0.4rem 0.15rem;
  border-radius: 8px;
}

.day-name {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
  font-weight: 600;
}

.card-night .day-name {
  color: var(--fg-muted-night);
}

.day-icon {
  font-size: 1.3rem;
  line-height: 1;
  margin: 2px 0;
}

.day-temps {
  font-size: 0.78rem;
  display: flex;
  justify-content: center;
  gap: 4px;
}

.day-max {
  font-weight: 700;
}

.day-min {
  color: var(--fg-muted);
}

.card-night .day-min {
  color: var(--fg-muted-night);
}

.error {
  color: var(--danger);
  margin: 0;
  font-size: 0.9rem;
}

@media (max-width: 480px) {
  .app-header h1 { font-size: 1.75rem; }
  .destination-grid { grid-template-columns: 1fr; }
  .card-stats { grid-template-columns: repeat(2, 1fr); }
}
