/* ================================================
   Weather Dashboard
   ================================================ */

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

:root {
  --glass: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.15);
  --text: #f1f5f9;
  --text-dim: rgba(241, 245, 249, 0.65);
  --accent: #60a5fa;
  --accent-2: #a78bfa;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
  background-attachment: fixed;
}

.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

/* ---- header ---- */
.app-header {
  text-align: center;
  margin-bottom: 28px;
}

.app-header h1 {
  font-size: 2rem;
  font-weight: 700;
}

.hint {
  color: var(--text-dim);
  font-size: 0.92rem;
  margin-top: 4px;
}

/* ---- search bar ---- */
.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.search-bar input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.search-bar input::placeholder {
  color: rgba(241, 245, 249, 0.4);
}

.search-bar input:focus {
  border-color: var(--accent);
}

.search-bar button {
  padding: 12px 18px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: transform 0.15s ease, background 0.15s ease;
}

#search-btn {
  background: var(--accent);
  color: #0f172a;
}

#search-btn:hover {
  transform: translateY(-1px);
}

#unit-toggle {
  background: var(--glass);
  color: var(--text);
  border: 1px solid var(--glass-border);
  min-width: 48px;
}

#unit-toggle:hover {
  background: rgba(255,255,255,0.14);
}

/* ---- recent searches ---- */
.recent-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  font-size: 0.82rem;
}

.recent-label {
  color: var(--text-dim);
}

.recent-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.recent-chip {
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text);
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.recent-chip:hover {
  background: rgba(255,255,255,0.16);
}

/* ---- skeleton loader ---- */
.skeleton {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.skel {
  border-radius: 16px;
  background: linear-gradient(90deg,
    rgba(255,255,255,0.05) 0%,
    rgba(255,255,255,0.12) 50%,
    rgba(255,255,255,0.05) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
}

.skel-main {
  height: 200px;
}

.skel-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.skel-day {
  height: 110px;
}

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

/* ---- not found ---- */
.not-found {
  text-align: center;
  padding: 48px 20px;
  border-radius: 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nf-emoji {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 8px;
}

.not-found p {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.not-found small {
  color: var(--text-dim);
}

/* ---- main weather card (glassmorphism) ---- */
.current-card {
  border-radius: 20px;
  padding: 28px;
  margin-bottom: 22px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.current-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.city-name {
  font-size: 1.4rem;
  font-weight: 700;
}

.city-sub {
  color: var(--text-dim);
  font-size: 0.82rem;
}

.temp-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.temp-icon {
  font-size: 3.2rem;
  line-height: 1;
}

.temp-value {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
}

.temp-unit {
  font-size: 1.4rem;
  vertical-align: top;
  color: var(--text-dim);
}

.condition {
  color: var(--accent);
  font-weight: 600;
  margin-top: 4px;
  font-size: 0.9rem;
}

/* ---- detail grid (humidity, wind, feels like) ---- */
.details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.detail-item {
  text-align: center;
  padding: 14px 8px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
}

.detail-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

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

/* ---- 5-day forecast ---- */
.forecast-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-dim);
}

.forecast-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.forecast-card {
  text-align: center;
  padding: 16px 8px;
  border-radius: 14px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.2s ease;
}

.forecast-card:hover {
  transform: translateY(-4px);
}

.forecast-day {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-weight: 600;
}

.forecast-icon {
  font-size: 1.8rem;
  margin-bottom: 6px;
}

.forecast-temp {
  font-size: 0.95rem;
  font-weight: 700;
}

.forecast-low {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* ---- footer ---- */
.site-footer {
  text-align: center;
  padding: 24px 20px;
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* ---- responsive ---- */
@media (max-width: 600px) {
  .app-header h1 {
    font-size: 1.6rem;
  }

  .details {
    grid-template-columns: 1fr;
  }

  .forecast-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .temp-value {
    font-size: 2.4rem;
  }

  .skel-row {
    grid-template-columns: repeat(2, 1fr);
  }
}
