/**
 * weather-app.css — Standalone weather app experience.
 *
 * Full-screen immersive layout inspired by Apple Weather / Google Weather.
 * Dynamic gradient background, large temperature, forecast strip, detail grid.
 * All classes prefixed `.wapp-` to avoid collisions.
 */

/* ═══════════════════════════════════════════════════════════════════
   Immersive mode — hide tabbar + FAB when weather is active
   ═══════════════════════════════════════════════════════════════════ */

body.wapp-immersive #tabbar,
body.wapp-immersive > .tabbar-fab {
  display: none !important;
}

/* ═══════════════════════════════════════════════════════════════════
   Container — Full-screen immersive
   ═══════════════════════════════════════════════════════════════════ */

.wapp {
  min-height: 100dvh;
  background: linear-gradient(170deg, var(--wapp-bg1), var(--wapp-bg2) 50%, var(--wapp-bg3));
  color: #fff;
  padding: 0 0 calc(env(safe-area-inset-bottom, 0px) + 24px);
  position: relative;
  overflow-x: hidden;
  font-family: system-ui, -apple-system, sans-serif;
}

/* Subtle animated overlay for depth */
.wapp::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 70%, rgba(0,0,0,0.15) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.wapp > * { position: relative; z-index: 1; }

/* ═══════════════════════════════════════════════════════════════════
   Back button — Floating top-left
   ═══════════════════════════════════════════════════════════════════ */

.wapp-back {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: 12px;
  z-index: 100;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, transform 0.1s;
}

.wapp-back:active {
  background: rgba(0,0,0,0.4);
  transform: scale(0.92);
}

/* ═══════════════════════════════════════════════════════════════════
   Hero — City, Temperature, Condition
   ═══════════════════════════════════════════════════════════════════ */

.wapp-hero {
  text-align: center;
  padding: calc(env(safe-area-inset-top, 0px) + 60px) 20px 32px;
}

.wapp-city {
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.wapp-temp {
  font-size: 6rem;
  font-weight: 200;
  line-height: 1;
  letter-spacing: -0.04em;
  margin: 4px 0 2px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.wapp-deg {
  font-size: 3rem;
  font-weight: 300;
  vertical-align: super;
  margin-left: -4px;
}

.wapp-cond {
  font-size: 1.15rem;
  font-weight: 500;
  opacity: 0.9;
  margin-bottom: 4px;
}

.wapp-hilo {
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0.7;
}

/* ═══════════════════════════════════════════════════════════════════
   Alert Banner
   ═══════════════════════════════════════════════════════════════════ */

.wapp-alert {
  margin: 0 16px 16px;
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════════════
   Section (glass card)
   ═══════════════════════════════════════════════════════════════════ */

.wapp-section {
  margin: 0 16px 16px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 16px;
  overflow: hidden;
}

.wapp-section-head {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.65;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* ═══════════════════════════════════════════════════════════════════
   5-Day Forecast Strip with Temperature Range Bars
   ═══════════════════════════════════════════════════════════════════ */

.wapp-forecast {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wapp-fday {
  display: grid;
  grid-template-columns: 48px 32px 44px 1fr;
  align-items: center;
  gap: 6px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.wapp-fday:last-child { border-bottom: none; }

.wapp-fday--today { opacity: 1; }

.wapp-fday-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.wapp-fday-icon {
  font-size: 1.2rem;
  text-align: center;
}

.wapp-fday-rain {
  font-size: 0.72rem;
  color: rgba(100, 180, 255, 0.9);
  font-weight: 500;
  min-height: 1em;
}

/* Temps row: lo — bar — hi */
.wapp-fday-temps {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.wapp-fday-hi {
  font-weight: 600;
  color: #fff;
  min-width: 28px;
  text-align: right;
}

.wapp-fday-lo {
  font-weight: 400;
  opacity: 0.55;
  min-width: 28px;
  text-align: right;
}

/* Temperature range bar (Apple Weather style) */
.wapp-fday-rangebar {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: rgba(255,255,255,0.12);
  position: relative;
  min-width: 60px;
}

.wapp-fday-rangefill {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #64b5f6, #ffb74d, #ef5350);
}

/* Current temp dot on today's bar */
.wapp-fday-dot {
  position: absolute;
  top: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(0,0,0,0.2);
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* ═══════════════════════════════════════════════════════════════════
   Hourly Forecast — Horizontal Scroll Strip
   ═══════════════════════════════════════════════════════════════════ */

.wapp-hourly {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 0 -16px;
  padding: 0 16px;
}

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

.wapp-hour {
  flex: 0 0 auto;
  width: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  scroll-snap-align: start;
}

.wapp-hour-time {
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.7;
}

.wapp-hour-icon {
  font-size: 1.3rem;
}

.wapp-hour-rain {
  font-size: 0.65rem;
  color: rgba(100, 180, 255, 0.9);
  font-weight: 500;
  min-height: 1em;
}

.wapp-hour-temp {
  font-size: 0.9rem;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════
   Detail Cards Grid
   ═══════════════════════════════════════════════════════════════════ */

.wapp-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px 16px;
}

.wapp-dcard {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  min-height: 110px;
}

.wapp-dcard-head {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.55;
  margin-bottom: 8px;
}

.wapp-dcard-icon {
  font-size: 0.8rem;
  margin-right: 2px;
}

.wapp-dcard-val {
  font-size: 1.7rem;
  font-weight: 300;
  line-height: 1.1;
  margin-bottom: auto;
}

.wapp-dcard-desc {
  font-size: 0.78rem;
  font-weight: 500;
  opacity: 0.6;
  margin-top: 8px;
}

/* ═══════════════════════════════════════════════════════════════════
   Wind Direction Arrow
   ═══════════════════════════════════════════════════════════════════ */

.wapp-wind-arrow {
  display: inline-block;
  font-size: 1.1rem;
  transform: rotate(var(--wind-deg, 0deg));
  opacity: 0.8;
  margin-left: 4px;
}

/* ═══════════════════════════════════════════════════════════════════
   Skeleton Loading
   ═══════════════════════════════════════════════════════════════════ */

.wapp-skel {
  display: inline-block;
  background: linear-gradient(90deg, rgba(255,255,255,0.08) 25%, rgba(255,255,255,0.18) 50%, rgba(255,255,255,0.08) 75%);
  background-size: 200% 100%;
  animation: wapp-shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
}

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

/* ═══════════════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════════════ */

@media (min-width: 500px) {
  .wapp-temp { font-size: 7rem; }
  .wapp-deg { font-size: 3.5rem; }
  .wapp-details { grid-template-columns: repeat(3, 1fr); }
  .wapp-fday { grid-template-columns: 64px 36px 50px 1fr; }
  .wapp-hour { width: 66px; }
}
