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

:root {
  --card-bg: rgba(255, 255, 255, 0.18);
  --card-border: rgba(255, 255, 255, 0.35);
  --text-primary: #fff;
  --text-muted: rgba(255, 255, 255, 0.75);
  --accent: #ffdc6a;
  --shadow: 0 8px 32px rgba(0,0,0,0.35);
  --radius: 20px;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Nunito', sans-serif;
  background: #2a1a0e;
}

/* ===== PAGE TRANSITIONS ===== */
.page {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 5vh;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.page.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(60px);
}

/* ===== TODAY PAGE ===== */
.bg-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.bg-dog {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
}

.bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.05) 0%,
    rgba(0,0,0,0.08) 40%,
    rgba(0,0,0,0.72) 75%,
    rgba(0,0,0,0.88) 100%
  );
}

/* ===== WEATHER CARD ===== */
.weather-card {
  position: relative;
  z-index: 2;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  width: min(420px, 92vw);
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
  text-align: center;
  color: var(--text-primary);
}

.location {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.temp-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  line-height: 1;
  margin-bottom: 0.4rem;
}

.weather-emoji {
  font-size: 2.8rem;
}

.temp {
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.condition {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.feels-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.feels-label { font-weight: 400; }
.feels-temp { font-weight: 700; color: var(--text-primary); }

.detail-row {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ===== FORECAST BUTTON ===== */
.forecast-btn {
  position: relative;
  z-index: 2;
  background: var(--accent);
  color: #1a0d00;
  border: none;
  border-radius: 50px;
  padding: 0.75rem 2rem;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transition: transform 0.15s, box-shadow 0.15s;
  letter-spacing: 0.02em;
}

.forecast-btn:hover { transform: scale(1.04); box-shadow: 0 6px 20px rgba(0,0,0,0.4); }
.forecast-btn:active { transform: scale(0.97); }

/* ===== FORECAST PAGE ===== */
.forecast-page {
  background: #1a1005;
  justify-content: flex-start;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 3rem;
}

.forecast-header {
  width: 100%;
  padding: 1.5rem 1.5rem 1rem;
  position: sticky;
  top: 0;
  background: #1a1005;
  z-index: 5;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.forecast-header h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0.35rem 0 0.15rem;
}

.f-location {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.back-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 50px;
  color: var(--text-primary);
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.4rem 1rem;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 0.5rem;
}

.back-btn:hover { background: rgba(255,255,255,0.1); }

/* ===== FORECAST GRID ===== */
.forecast-grid {
  width: 100%;
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.loading-msg {
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
  font-size: 1rem;
}

.forecast-row {
  display: grid;
  grid-template-columns: 2.5rem 1fr 2rem 5rem;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.forecast-row.today-row {
  background: rgba(255, 220, 106, 0.15);
  border: 1px solid rgba(255, 220, 106, 0.3);
}

.f-emoji { font-size: 1.4rem; text-align: center; }

.f-date-wrap { display: flex; flex-direction: column; }
.f-day { font-weight: 800; font-size: 0.88rem; }
.f-date { font-size: 0.72rem; color: var(--text-muted); }

.f-icon { font-size: 1.1rem; text-align: center; }

.f-temps {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.f-high { font-weight: 800; font-size: 0.95rem; }
.f-low { font-size: 0.78rem; color: var(--text-muted); }

@media (max-width: 380px) {
  .temp { font-size: 3.2rem; }
  .weather-emoji { font-size: 2.2rem; }
  .weather-card { padding: 1.25rem 1.5rem; }
}
