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

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --card: #21253a;
  --accent: #4f8ef7;
  --accent2: #7c6af7;
  --text: #e8eaf0;
  --muted: #7a7f99;
  --border: #2e3352;
  --success: #4fd1a0;
  --warn: #f7c04f;
}

body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 10px 24px 16px 48px;
}
@media (max-width: 480px) {
  body {
    padding: 10px 24px;
  }
}
/* header */
header {
  text-align: center;
  margin-bottom: 32px;
}

header h1 {
  font-size: 29px;
  font-weight: 700;
  color: white !important;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  letter-spacing: -0.5px;
  padding: 5px;
  border-radius: 8px;
}

header p {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}
/* search  bar */
.search-bar {
  display: flex;
  gap: 8px;
  max-width: 560px;
  margin: 0 auto 20px;
}
/* input */
.search-bar input {
  flex: 1;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 12px 18px;
  color: var(--text);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.search-bar input:focus {
  border-color: var(--accent);
}
.search-bar input::placeholder {
  color: var(--muted);
}
/* button */
.btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition:
    opacity 0.2s,
    transform 0.1s;
  white-space: nowrap;
}

.btn:hover {
  opacity: 0.88;
}
.btn:active {
  transform: scale(0.97);
}
/* locations btn  */
.btn-loc {
  background: var(--surface);
  border: 2px solid var(--border);
  color: #f44b4b;
  padding: 12px 14px;
  font-size: 16px;
}

.btn-loc:hover {
  border-color: var(--accent);
}
/* cities */
.quick-cities {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 560px;
  margin: 0 auto 32px;
}

.chip {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
}
/* card */
.card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  position: relative;
  animation: fadeUp 0.35s ease both;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  background: radial-gradient(
    circle,
    rgba(79, 142, 247, 0.12),
    transparent 70%
  );
  pointer-events: none;
}

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

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.city-name {
  font-size: 18px;
  font-weight: 700;
}

.country {
  font-size: 14px;
  color: var(--muted);
  margin-top: 2px;
}
/*close btn  */
.remove-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 6px;
  transition:
    color 0.2s,
    background 0.2s;
}

.remove-btn:hover {
  color: #f76f6f;
  background: rgba(247, 111, 111, 0.1);
}
/* wheather */
.main-weather {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.weather-icon {
  font-size: 55px;
  line-height: 1;
}

/* temp */
.temp {
  font-size: 50px;
  font-weight: 800;
  letter-spacing: -1px;
}
/* feel */
.feels {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
/* desc */
.desc {
  font-size: 14px;
  color: var(--muted);
  text-transform: capitalize;
  margin-bottom: 16px;
}
/* meta */
.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.meta-item {
  background: var(--surface);
  border-radius: 12px;
  padding: 10px 14px;
}

.meta-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.meta-value {
  font-size: 13px;
  font-weight: 600;
  margin-top: 3px;
}
/* forecast */
.forecast-title {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.forecast-row {
  display: flex;
  gap: 8px;
}

.fc-day {
  flex: 1;
  background: var(--surface);
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
}

.fc-day-name {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.fc-icon {
  font-size: 20px;
}

.fc-temp {
  font-size: 14px;
  font-weight: 600;
  margin-top: 4px;
}

.fc-min {
  font-size: 12px;
  color: var(--muted);
}

/* Skeleton */
.skeleton-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  animation: fadeUp 0.35s ease both;
}

.skel {
  background: linear-gradient(
    90deg,
    var(--surface) 25%,
    var(--border) 50%,
    var(--surface) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.empty-state {
  grid-column: 1/-1;
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.empty-state .icon {
  font-size: 60px;
  margin-bottom: 12px;
  color: var(--accent);
}
.empty-state p {
  font-size: 18px;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #f44242;
  color: #fff;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  transition: transform 0.3s ease;
  z-index: 999;
  max-width: 90vw;
  text-align: center;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.updated {
  font-size: 10px;
  color: var(--muted);
  margin-top: 12px;
  text-align: right;
}
footer {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  text-align: center;
  margin: 48px 0;
  padding: 15px 0;
  color: var(--muted);
  border-radius: 8px;
  font-size: 15px;
  color: var(--text);
}

footer i {
  color: #f44242;
}
footer span {
  font-weight: 700;
}
@media (max-width: 480px) {
  .search-bar {
    flex-wrap: wrap;
  }
  .search-bar input {
    min-width: 0;
  }
}
