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

body {
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  transition: background 1s ease;
  background: linear-gradient(160deg, #1a1a2e, #16213e, #0f3460);
}

.app {
  width: 100%;
  min-height: 100vh;
  padding: 24px 32px;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Top Bar ── */
.top-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.app-logo {
  height: 36px;
  width: auto;
  flex-shrink: 0;
  object-fit: contain;
}

.search-bar {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 14px;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,0.2);
  gap: 8px;
  width: 340px;
}

.search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: white;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  min-width: 0;
}

.search-bar input::placeholder { color: rgba(255,255,255,0.5); }

.search-bar button {
  background: rgba(255,255,255,0.25);
  border: none;
  color: white;
  padding: 6px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  transition: background 0.2s;
  flex-shrink: 0;
}

.search-bar button:hover { background: rgba(255,255,255,0.38); }

/* ── Top Nav Links ── */
.top-nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.top-nav-link {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2px;
  padding: 7px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: color 0.2s, background 0.2s, border-color 0.2s, opacity 0.2s;
  white-space: nowrap;
}

.top-nav-link:hover {
  color: rgba(255,255,255,1);
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.18);
}

.top-nav-link:active {
  background: rgba(255,255,255,0.15);
  opacity: 0.85;
}


.main-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  width: 100%;
  align-items: start;
}

/* ── Left Column ── */
.left-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* ── Right Column ── */
.right-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* ── Weather Hero ── */
.weather-card {
  text-align: center;
  padding: 36px 20px 28px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.15);
  animation: fadeInDown 0.6s ease;
}

.location {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.condition {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 15px;
  opacity: 0.8;
  margin-top: 6px;
}

.temp-main {
  font-size: 90px;
  font-weight: 200;
  letter-spacing: -4px;
  line-height: 1;
  margin: 8px 0;
}

.temp-range {
  font-size: 14px;
  opacity: 0.7;
}

/* ── Glass Cards ── */
.glass-card {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 16px 18px;
  border: 1px solid rgba(255,255,255,0.15);
  animation: fadeInUp 0.6s ease;
}

.card-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  opacity: 0.55;
  margin-bottom: 14px;
}

/* ── Hourly Scroll ── */
.hourly-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}

.hourly-scroll::-webkit-scrollbar { display: none; }

.hourly-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 48px;
}

.hourly-item .hour {
  font-size: 11px;
  opacity: 0.65;
  white-space: nowrap;
}

.hourly-item .h-temp {
  font-size: 13px;
  font-weight: 600;
}

/* ── Weekly Forecast ── */
.weekly-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 15px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.weekly-row:last-child { border-bottom: none; }

.weekly-row .day {
  width: 48px;
  font-weight: 500;
  flex-shrink: 0;
}

.weekly-row .w-icon {
  flex-shrink: 0;
}

.weekly-row .w-temps {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.weekly-row .w-low { opacity: 0.45; }
.weekly-row .w-high { font-weight: 600; }

/* ── Details Grid ── */
.details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.detail-card {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 18px 16px;
  border: 1px solid rgba(255,255,255,0.15);
  animation: fadeInUp 0.7s ease;
}

.detail-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  opacity: 0.55;
  margin-bottom: 10px;
}

.detail-value {
  font-size: 24px;
  font-weight: 500;
}

/* ── Animations ── */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

/* ── Dynamic Backgrounds ── */
body.sunny   { background: linear-gradient(160deg, #f7971e, #ffd200, #f7971e); }
body.cloudy  { background: linear-gradient(160deg, #4b6cb7, #182848); }
body.rainy   { background: linear-gradient(160deg, #141e30, #243b55); }
body.snowy   { background: linear-gradient(160deg, #83a4d4, #b6fbff); }
body.thunder { background: linear-gradient(160deg, #0f0c29, #302b63, #24243e); }
body.foggy   { background: linear-gradient(160deg, #606c88, #3f4c6b); }
body.night   { background: linear-gradient(160deg, #0f0c29, #302b63, #24243e); }
body.clear   { background: linear-gradient(160deg, #2980b9, #6dd5fa, #ffffff22); }

/* ── Responsive ── */
@media (max-width: 860px) {
  .main-layout { grid-template-columns: 1fr; }
  .app { padding: 16px; }
  .top-bar { flex-direction: column; align-items: stretch; }
  .search-bar { width: 100%; }
  .temp-main { font-size: 80px; }
  .top-nav-links { margin-left: 0; justify-content: center; }
}
