#Google font and base styles

{
  box-sizing: border-box;
}

:root {
  --bg-1: #eaf4ff;
  --bg-2: #f7fbff;
  --card: rgba(255, 255, 255, 0.42);
  --card-border: rgba(255, 255, 255, 0.55);
  --text: #17324d;
  --muted: #5f7489;
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --shadow: 0 20px 50px rgba(24, 59, 112, 0.12);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.16), transparent 30%),
    radial-gradient(circle at top right, rgba(147, 197, 253, 0.22), transparent 25%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2));
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

.page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.55), transparent 24%),
    radial-gradient(circle at 80% 10%, rgba(255, 255, 255, 0.35), transparent 18%);
  opacity: 0.9;
}

.topbar,
.dashboard {
  position: relative;
  z-index: 1;
}

.topbar {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 24px;
  display: grid;
  gap: 20px;
  align-items: end;
}

.brand h1,
.section-heading h2 {
  margin: 0;
  line-height: 1.1;
}

.eyebrow,
.section-label {
  margin: 0 0 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--primary-dark);
}

.subtitle,
.date-time,
.weather-description,
.feels-like,
.stat-label {
  color: var(--muted);
}

.search-bar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
}

.search-bar input {
  width: 100%;
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 18px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  outline: none;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-bar input:focus {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 22px 40px rgba(59, 130, 246, 0.15);
}

.primary-button,
.secondary-button {
  border: none;
  border-radius: 18px;
  padding: 0 18px;
  min-height: 54px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 16px 26px rgba(37, 99, 235, 0.28);
}

.secondary-button {
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  border: 1px solid rgba(37, 99, 235, 0.12);
}

.primary-button:hover,
.secondary-button:hover,
.search-bar input:hover {
  transform: translateY(-2px);
}

.dashboard {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 48px;
  display: grid;
  gap: 24px;
}

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

.weather-card {
  padding: 28px;
}

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

.city-name {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.date-time {
  margin: 8px 0 0;
}

.weather-icon {
  width: 96px;
  height: 96px;
  object-fit: contain;
  filter: drop-shadow(0 12px 20px rgba(59, 130, 246, 0.18));
}

.weather-main {
  margin-top: 18px;
}

.temperature-row {
  display: flex;
  align-items: start;
  gap: 8px;
}

.temperature {
  font-size: clamp(3.2rem, 7vw, 5.2rem);
  font-weight: 700;
  line-height: 1;
}

.temperature-unit {
  font-size: 1.5rem;
  font-weight: 500;
  margin-top: 12px;
}

.weather-description {
  margin: 10px 0 4px;
  font-size: 1.1rem;
  font-weight: 500;
  text-transform: capitalize;
}

.feels-like {
  margin: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.stat-item {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 20px;
  padding: 16px;
  transition: transform 0.2s ease, background 0.2s ease;
}

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

.stat-label,
.stat-value {
  display: block;
}

.stat-label {
  font-size: 0.85rem;
}

.stat-value {
  margin-top: 6px;
  font-size: 1rem;
  font-weight: 600;
}

.forecast-section {
  padding-bottom: 18px;
}

.section-heading {
  margin-bottom: 14px;
}

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

.forecast-card {
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 22px;
  padding: 18px 14px;
  text-align: center;
  box-shadow: 0 16px 28px rgba(38, 78, 136, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.forecast-day {
  margin: 0 0 8px;
  font-weight: 600;
}

.forecast-icon {
  width: 72px;
  height: 72px;
}

.forecast-temp {
  margin: 8px 0 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.loading-state {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 12px;
  background: rgba(235, 244, 255, 0.58);
  backdrop-filter: blur(6px);
  z-index: 20;
}

.spinner {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 5px solid rgba(37, 99, 235, 0.15);
  border-top-color: var(--primary);
  animation: spin 0.85s linear infinite;
}

.error-message {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 28px;
  padding: 14px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.85);
  color: #b42318;
  border: 1px solid rgba(180, 35, 24, 0.14);
}

.hidden {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.fade-in {
  animation: fadeIn 0.7s ease both;
}


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

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

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 980px) {
  .stats-grid,
  .forecast-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar {
    padding-top: 28px;
  }

  .search-bar {
    grid-template-columns: 1fr;
  }

  .card-head {
    flex-direction: column;
  }

  .weather-icon {
    align-self: flex-end;
  }

  .stats-grid,
  .forecast-grid {
    grid-template-columns: 1fr;
  }
}

