/* ===== Apple Weather — визуальный стиль ===== */
:root {
  --radius-card: 18px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
          "Helvetica Neue", "Segoe UI", Roboto, system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  background: #000;
  color: #fff;
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  display: flex;
  justify-content: center;
  /* фон-градиент, как размытая ночь в приложении */
  background:
    radial-gradient(120% 80% at 50% -10%, #2b3a67 0%, #10142a 45%, #05060d 100%);
  min-height: 100vh;
  padding: 0;
}

.app {
  width: 100%;
  max-width: 460px;
  padding: 0 16px calc(env(safe-area-inset-bottom) + 16px);
  min-height: 100vh;
}

/* ===== Навигация ===== */
.nav { padding: 60px 4px 8px; }

.nav__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__title {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.35px;
}

.nav__menu {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: none; border: none; cursor: pointer;
  color: #fff; opacity: .9;
}
.nav__menu svg { fill: currentColor; }

/* ===== Поиск ===== */
.search {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 9px 12px;
  background: rgba(120, 120, 128, 0.32);
  border-radius: 11px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.search__icon { fill: rgba(235,235,245,0.6); flex: none; }
.search__input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: #fff;
  font-size: 17px;
  font-family: var(--font);
  min-width: 0;
  -webkit-appearance: none;
}
.search__input::-webkit-search-cancel-button { display: none; }
.search__input::placeholder { color: rgba(235,235,245,0.6); }

/* ===== Список карточек ===== */
.list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-card);
  padding: 16px 18px;
  min-height: 116px;
  color: #fff;
  box-shadow: 0 8px 22px rgba(0,0,0,0.28);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  isolation: isolate;
  cursor: pointer;
  animation: rise .5s cubic-bezier(.2,.7,.3,1) both;
}

/* лёгкое затемнение снизу для читаемости, как в Apple */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.18) 100%);
  z-index: -1;
}

.card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.card__place { min-width: 0; }
.card__name {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1.1;
}
.card__sub {
  font-size: 13px;
  font-weight: 500;
  opacity: 0.92;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card__time {
  font-size: 15px;
  font-weight: 500;
  opacity: 0.92;
  font-variant-numeric: tabular-nums;
}

.card__temp {
  font-size: 52px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -1px;
}

.card__bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}
.card__cond {
  font-size: 15px;
  font-weight: 500;
  opacity: 0.95;
}
.card__hilo {
  font-size: 15px;
  font-weight: 500;
  opacity: 0.95;
  font-variant-numeric: tabular-nums;
}
.card__icon {
  position: absolute;
  right: 18px;
  bottom: 42px;
  width: 36px;
  height: 36px;
  opacity: 0.92;
}
/* ===== Погодные градиенты (как в Apple Weather) ===== */
.bg-clear-day   { background: linear-gradient(160deg, #4a90d9 0%, #2f6bb0 55%, #1f4e88 100%); }
.bg-clear-night { background: linear-gradient(160deg, #1c2b53 0%, #16203f 55%, #0d1428 100%); }
.bg-cloudy      { background: linear-gradient(160deg, #5b6b82 0%, #465468 55%, #33404f 100%); }
.bg-partly      { background: linear-gradient(160deg, #4b83c4 0%, #3e6a9c 55%, #34597f 100%); }
.bg-rain        { background: linear-gradient(160deg, #4a5d78 0%, #38495f 55%, #263243 100%); }
.bg-storm       { background: linear-gradient(160deg, #3a3f52 0%, #2b2f3f 55%, #1c1f2b 100%); }
.bg-snow        { background: linear-gradient(160deg, #7d93ac 0%, #64789a 55%, #4d6081 100%); }
.bg-fog         { background: linear-gradient(160deg, #6a7180 0%, #565d6c 55%, #434955 100%); }
.bg-hot         { background: linear-gradient(160deg, #e08a3c 0%, #cf6a2c 55%, #a94f22 100%); }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.empty {
  text-align: center;
  opacity: 0.55;
  font-size: 15px;
  padding: 40px 0;
}

.footer {
  text-align: center;
  margin-top: 22px;
  font-size: 12px;
  color: rgba(235,235,245,0.4);
}

/* =========================================================
   ДЕТАЛЬНЫЙ ЭКРАН ГОРОДА + ПОГОДНЫЕ ЭФФЕКТЫ
   ========================================================= */
.detail-body {
  background: linear-gradient(180deg, #2b3746 0%, #3d4b5d 55%, #51627a 100%);
  transition: background 0.6s ease;
}

.fx-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.detail {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 0 16px calc(env(safe-area-inset-bottom) + 20px);
  color: #fff;
}

/* ---- Статус-бар с часами ---- */
.statusbar {
  display: flex;
  justify-content: center;
  padding: 14px 0 2px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.4px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

/* ---- Hero ---- */
.hero {
  position: relative;
  text-align: center;
  padding: 20px 0 6px;
}
.hero__back {
  position: absolute;
  left: -4px; top: 16px;
  color: #fff; opacity: 0.9;
  display: grid; place-items: center;
  width: 30px; height: 30px;
  text-decoration: none;
}
.hero__city {
  font-size: 34px;
  font-weight: 400;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.hero__temp {
  font-size: 92px;
  font-weight: 200;
  line-height: 1.02;
  letter-spacing: -2px;
  margin-left: 12px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.hero__cond {
  font-size: 20px;
  font-weight: 400;
  opacity: 0.95;
  margin-top: 2px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
.hero__hilo {
  font-size: 17px;
  font-weight: 500;
  opacity: 0.95;
  margin-top: 1px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

/* ---- Панель-рамка (стеклянная карточка) ---- */
.panel {
  position: relative;
  overflow: hidden;
  margin-top: 14px;
  background: rgba(120,132,150,0.28);
  border: 0.5px solid rgba(255,255,255,0.16);
  border-radius: 16px;
  padding: 12px 14px;
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
}
/* Слой воды/снега — за содержимым, поверх матового фона панели */
.panel-fx {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}
.panel > *:not(.panel-fx) { position: relative; z-index: 1; }
.panel__note {
  font-size: 16px;
  line-height: 1.32;
  opacity: 0.96;
  padding: 4px 2px 11px;
}
.panel__divider {
  height: 0.5px;
  background: rgba(255,255,255,0.18);
  margin: 0 -4px 2px;
}
.panel__head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  letter-spacing: 0.5px;
  opacity: 0.7;
  padding: 2px 2px 9px;
  border-bottom: 0.5px solid rgba(255,255,255,0.14);
}
.panel__head svg { opacity: 0.85; }

/* ---- Почасовой прогноз ---- */
.hourly {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding: 10px 0 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.hourly::-webkit-scrollbar { display: none; }
.hcol {
  flex: 0 0 auto;
  width: 54px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.hcol__t { font-size: 15px; opacity: 0.95; }
.hcol--now .hcol__t { font-weight: 700; }
.hcol--sun .hcol__t { color: #ffd479; }
.hcol--sun .hcol__temp { font-size: 13px; opacity: 0.9; }
.hcol__pop {
  font-size: 12px;
  color: #6cc5ff;
  height: 14px;
  font-weight: 600;
}
.hcol__ic { width: 30px; height: 30px; }
.hcol__temp { font-size: 17px; font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---- Дневной прогноз ---- */
.daily { padding: 2px 0 0; }
.drow {
  display: grid;
  grid-template-columns: 92px 28px 30px 1fr 30px;
  align-items: center;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 0.5px solid rgba(255,255,255,0.12);
  font-size: 18px;
}
.drow:last-child { border-bottom: none; }
.drow__day { font-weight: 400; }
.drow__ic { width: 26px; height: 26px; }
.drow__lo { text-align: right; opacity: 0.55; font-variant-numeric: tabular-nums; }
.drow__hi { text-align: right; font-variant-numeric: tabular-nums; }
.drow__bar {
  position: relative;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.2);
}
.drow__bar span {
  position: absolute;
  top: 0; height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, #7ec8ff, #ffd479);
  min-width: 8px;
}

.wico { width: 100%; height: 100%; display: block; }

/* ---- Плавное появление секций ---- */
.detail > section { animation: fadeUp 0.5s ease both; }
.detail > section:nth-of-type(2) { animation-delay: 0.06s; }
.detail > section:nth-of-type(3) { animation-delay: 0.12s; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

.detail-footer {
  text-align: center;
  margin-top: 18px;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}
