/* Uygulama kabuğu: sahne, cihaz çerçevesi, ekranlar, alt menü, panel, bildirim, ortak düğmeler. */

/* ---------- Sahne ve cihaz ---------- */

.stage {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(900px 600px at 50% -10%, #ffffff 0%, rgba(255, 255, 255, 0) 70%),
    linear-gradient(180deg, #eaf5ef 0%, #dcece3 100%);
}

.device {
  position: relative;
  width: 400px;
  max-width: 100%;
  height: min(868px, calc(100dvh - 40px));
  overflow: hidden;
  isolation: isolate;
  background: var(--white);
  border-radius: 46px;
  box-shadow:
    0 0 0 1px rgba(4, 56, 42, 0.08),
    0 0 0 9px #0c241b,
    0 0 0 10px #29463a,
    0 50px 90px -30px rgba(4, 56, 42, 0.55);
}

/* Telefonda çerçeve kalkar, uygulama ekranı doldurur. */
@media (max-width: 520px) {
  .stage {
    padding: 0;
    background: var(--white);
  }
  .device {
    width: 100%;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }
}

.app {
  position: absolute;
  inset: 0;
}

/* ---------- Ekranlar ve geçişler ---------- */

.screen {
  position: absolute;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  background: var(--white);
  opacity: 0;
  visibility: hidden;
  transform: scale(0.97);
  transition:
    opacity 0.34s var(--ease-out),
    transform 0.5s var(--ease-out),
    visibility 0s linear 0.5s;
}

.screen::-webkit-scrollbar {
  display: none;
}

.screen.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition:
    opacity 0.42s var(--ease-out) 0.06s,
    transform 0.6s var(--ease-out) 0.06s,
    visibility 0s;
}

.screen:focus {
  outline: none;
}

/* ---------- Açılış perdesi ---------- */

.veil {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--white);
  pointer-events: none;
  transition: opacity 0.9s var(--ease-cinema) 0.25s, visibility 0s linear 1.2s;
}

.veil__mark {
  width: 64px;
  height: 64px;
  transition: transform 1.1s var(--ease-cinema), opacity 0.7s ease 0.2s;
}

.veil__name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.42em;
  margin-right: -0.42em;
  color: var(--emerald);
  transition: letter-spacing 1.1s var(--ease-cinema), opacity 0.6s ease 0.1s;
}

.is-ready .veil {
  opacity: 0;
  visibility: hidden;
}

.is-ready .veil__mark {
  transform: scale(1.5) rotate(-18deg);
  opacity: 0;
}

.is-ready .veil__name {
  letter-spacing: 0.8em;
  opacity: 0;
}

/* Açılışta sırayla beliren parçalar (gecikme --d ile verilir). */
.intro,
.intro-group > * {
  opacity: 0;
  transform: translateY(var(--intro-y, 18px));
}

.is-ready .intro,
.is-ready .intro-group > * {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.9s var(--ease-out) var(--d, 0.6s),
    transform 1.1s var(--ease-out) var(--d, 0.6s);
}

/* Kaydırınca bir kez beliren bölümler. */
.reveal {
  opacity: 0;
  transform: translateY(26px);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.8s var(--ease-out), transform 1s var(--ease-out);
}

/* ---------- Ortak parçalar ---------- */

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--title-s);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.005em;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 12px;
  font-size: var(--text-s);
  font-weight: 600;
  border-radius: var(--radius-pill);
  transition: transform 0.25s var(--ease-spring), background-color 0.3s;
}

.chip .icon {
  width: 16px;
  height: 16px;
}

.chip:active {
  transform: scale(0.95);
}

.chip--glass {
  color: inherit;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.32);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
}

.chip--compact {
  min-height: 34px;
  padding: 0 6px 0 12px;
  gap: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  font-size: var(--text-m);
  font-weight: 700;
  border-radius: var(--radius-pill);
  transition: transform 0.25s var(--ease-spring), box-shadow 0.3s, background-color 0.3s;
}

.btn:active {
  transform: scale(0.96);
}

.btn--primary {
  color: var(--white);
  background: linear-gradient(180deg, var(--emerald-bright) 0%, var(--emerald) 55%, var(--emerald-deep) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 3px 0 #044a31,
    0 14px 22px -10px rgba(5, 92, 60, 0.7);
}

.btn--primary:active {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 1px 0 #044a31,
    0 6px 12px -8px rgba(5, 92, 60, 0.7);
  transform: translateY(2px) scale(0.98);
}

.btn--ghost {
  color: var(--emerald);
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.btn--soft {
  color: var(--emerald-deep);
  background: var(--soft);
}

.btn--wide {
  width: 100%;
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 4px;
  font-size: var(--text-s);
  font-weight: 700;
  color: var(--emerald);
}

.link-btn .icon {
  width: 16px;
  height: 16px;
}

.link-btn--light {
  color: var(--gold-pale);
}

.choice {
  min-height: 40px;
  padding: 0 15px;
  font-size: var(--text-s);
  font-weight: 600;
  white-space: nowrap;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  transition: transform 0.25s var(--ease-spring), background-color 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.choice:active {
  transform: scale(0.94);
}

.choice[aria-checked='true'] {
  color: var(--white);
  background: var(--emerald);
  border-color: var(--emerald);
  box-shadow: 0 10px 18px -10px rgba(5, 92, 60, 0.8);
}

.choice--light {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.24);
}

.choice--light[aria-checked='true'] {
  color: var(--emerald-night);
  background: var(--gold-pale);
  border-color: var(--gold-pale);
  box-shadow: 0 10px 20px -10px rgba(241, 223, 166, 0.7);
}

.segmented {
  display: inline-flex;
  padding: 3px;
  background: var(--mist);
  border-radius: var(--radius-pill);
}

.segmented__item {
  min-width: 46px;
  min-height: 38px;
  padding: 0 10px;
  font-size: var(--text-s);
  font-weight: 700;
  color: var(--ink-soft);
  border-radius: var(--radius-pill);
  transition: background-color 0.3s, color 0.3s, box-shadow 0.3s;
}

.segmented__item[aria-checked='true'] {
  color: var(--emerald-deep);
  background: var(--white);
  box-shadow: 0 2px 8px -2px rgba(5, 92, 60, 0.35);
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 8px;
  font-size: var(--text-s);
  font-weight: 600;
  color: var(--ink-soft);
  border-radius: var(--radius-s);
  transition: color 0.3s, transform 0.25s var(--ease-spring);
}

.tool-btn:active {
  transform: scale(0.94);
}

.tool-btn .icon {
  width: 18px;
  height: 18px;
}

.meter {
  height: 6px;
  overflow: hidden;
  background: var(--soft);
  border-radius: var(--radius-pill);
}

.meter__fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--emerald-bright), var(--emerald));
  border-radius: inherit;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.8s var(--ease-out);
}

.switch {
  position: relative;
  flex: none;
  width: 58px;
  height: 34px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-pill);
  transition: background-color 0.4s, border-color 0.4s, box-shadow 0.4s;
}

.switch__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  background: var(--white);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(2, 35, 26, 0.45);
  transition: transform 0.45s var(--ease-spring);
}

.switch[aria-checked='true'] {
  background: linear-gradient(180deg, var(--gold-pale), var(--gold));
  border-color: var(--gold-pale);
  box-shadow: 0 0 22px rgba(241, 223, 166, 0.55);
}

.switch[aria-checked='true'] .switch__thumb {
  transform: translateX(24px);
}

/* ---------- Alt navigasyon (3D nesneli premium menü) ---------- */

.tabbar {
  --intro-y: 130%;
  --d: 1.5s;
  --ease-tab: cubic-bezier(0.34, 1.32, 0.5, 1);
  position: absolute;
  z-index: 20;
  left: 10px;
  right: 10px;
  bottom: max(10px, env(safe-area-inset-bottom));
  height: 76px;
  /* Bulanıklık filtresi telefonda her karede pahalıdır; neredeyse opak cam
     görünümü aynı etkiyi takılmadan verir. */
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(243, 250, 246, 0.96) 100%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 26px;
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 -2px 6px rgba(8, 122, 80, 0.06),
    0 0 0 1px rgba(8, 122, 80, 0.08),
    0 24px 40px -18px rgba(4, 56, 42, 0.5),
    0 6px 14px -8px rgba(4, 56, 42, 0.25);
}

/* Camın üst kenarında yumuşak parıltı */
.tabbar__sheen {
  position: absolute;
  inset: 0 0 auto;
  height: 50%;
  border-radius: 26px 26px 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0));
  pointer-events: none;
}

/* Tek 3D tuval: menünün tamamını ve ortadaki yükselen nesneyi kaplar. */
.tabbar__canvas {
  position: absolute;
  z-index: 2;
  left: 0;
  top: -36px;
  width: 100%;
  height: calc(100% + 36px);
  pointer-events: none;
}

.tabbar__defs { position: absolute; width: 0; height: 0; }

.tab {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--x, 0);
  width: var(--w, 20%);
  padding: 0;
  color: var(--emerald-deep);
  background: none;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Mihrap biçimli niş: sabit yerinde durur */
.tab__arch {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 4px;
  width: 80%;
  height: 49px;
  transform: translateX(-50%);
  filter: drop-shadow(0 2px 3px rgba(4, 56, 42, 0.1));
  transition: transform 0.18s ease, filter 0.35s ease;
}
.tab__archsvg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tab__archsvg .tab__archline {
  fill: none;
  stroke: rgba(226, 184, 74, 0.7);
  stroke-width: 0.8;
  stroke-dasharray: 3 2;
  vector-effect: non-scaling-stroke;
}
/* Kemerin tepesinde küçük altın sekiz köşeli yıldız */
.tab__star {
  position: absolute;
  left: 50%;
  top: 0;
  width: 7px;
  height: 7px;
  transform: translate(-50%, -55%);
  background: linear-gradient(135deg, #fff1b8, #e2a92a);
  clip-path: polygon(50% 0, 62% 28%, 100% 20%, 72% 50%, 100% 80%, 62% 72%, 50% 100%, 38% 72%, 0 80%, 28% 50%, 0 20%, 38% 28%);
  filter: drop-shadow(0 0 2px rgba(255, 200, 60, 0.8));
}
.tab.is-center .tab__star { width: 11px; height: 11px; }
.tab__archsvg .tab__archbody {
  fill: url(#zkArchIdle);
  stroke: #e2b84a;
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
  transition: stroke 0.35s, stroke-width 0.35s;
}
/* Nesnenin altındaki yumuşak temas gölgesi */
.tab__floor {
  position: absolute;
  left: 24%;
  right: 24%;
  bottom: 7%;
  height: 7%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(4, 56, 42, 0.22), rgba(4, 56, 42, 0));
}
.tab__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding-top: 18%;
  color: var(--emerald);
}
.tab__fallback .icon { width: 24px; height: 24px; }
.has-3d .tab__fallback { display: none; }

/* Etiket */
.tab__label {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 55px;
  transform: translateX(-50%);
  padding: 2px 7px;
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  color: var(--emerald-deep);
  background: #fff;
  border: 1px solid #e8c25e;
  border-radius: 999px;
  box-shadow: 0 1px 3px rgba(0, 110, 64, 0.18);
  transition: background-color 0.35s, color 0.35s, border-color 0.35s, box-shadow 0.35s;
}

/* Ana Sayfa: her zaman ortada, büyük ve yükseltilmiş niş */
.tab.is-center .tab__arch {
  top: -34px;
  width: 86%;
  height: 84px;
  filter: drop-shadow(0 6px 8px rgba(4, 56, 42, 0.18));
}
.tab.is-center .tab__archsvg .tab__archbody { stroke: #e2b84a; stroke-width: 2; }
.tab.is-center .tab__label { top: 52px; padding: 3px 10px; font-size: 0.68rem; font-weight: 800; }

/* Seçili sekme: yeri değişmez, nişin içi zümrüt ışıkla dolar */
.tab.is-selected .tab__archsvg .tab__archline { stroke: rgba(255, 236, 170, 0.9); }
.tab.is-selected .tab__archsvg .tab__archbody {
  fill: url(#zkArchActive);
  stroke: #ffc93c;
  stroke-width: 2.6;
}
.tab.is-selected .tab__arch {
  filter: drop-shadow(0 0 10px rgba(255, 196, 50, 0.75)) drop-shadow(0 6px 10px rgba(0, 110, 64, 0.35));
}
.tab.is-selected .tab__floor {
  background: radial-gradient(closest-side, rgba(2, 40, 28, 0.45), rgba(2, 40, 28, 0));
}
.tab.is-selected .tab__fallback { color: #fff; }
.tab.is-selected .tab__label {
  color: #ffe9a8;
  background: linear-gradient(180deg, #19c27e 0%, #00995a 55%, #006e41 100%);
  border-color: #ffc93c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 3px 8px -3px rgba(4, 56, 42, 0.55);
}

.tab:active .tab__arch { transform: translateX(-50%) scale(0.96); }
.tab:focus-visible { outline: none; }
.tab:focus-visible .tab__label { outline: 2px solid var(--gold); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .tab__arch, .tab__label { transition: none; }
}

/* ---------- Alttan açılan panel ---------- */

.sheet {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
}

.sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 35, 26, 0.5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.38s ease;
}

.sheet__panel {
  position: relative;
  width: 100%;
  max-height: 86%;
  overflow-y: auto;
  padding: 10px 20px max(22px, env(safe-area-inset-bottom));
  background: var(--white);
  border-radius: 30px 30px 0 0;
  box-shadow: 0 -20px 50px -20px rgba(2, 35, 26, 0.5);
  transform: translateY(104%);
  transition: transform 0.5s var(--ease-out);
}

.sheet.is-open .sheet__backdrop {
  opacity: 1;
}

.sheet.is-open .sheet__panel {
  transform: none;
}

.sheet__grip {
  width: 44px;
  height: 5px;
  margin: 0 auto 14px;
  background: var(--line);
  border-radius: var(--radius-pill);
}

.sheet__title {
  margin-bottom: 14px;
  font-family: var(--font-display);
  font-size: var(--title-s);
  font-weight: 600;
}

.city-sheet__locate {
  width: 100%;
  margin-bottom: 12px;
}

.city-sheet__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.city {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 14px;
  font-weight: 600;
  text-align: left;
  background: var(--pearl);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}

.city .icon {
  width: 18px;
  height: 18px;
  opacity: 0;
}

.city[aria-checked='true'] {
  color: var(--white);
  background: var(--emerald);
  border-color: var(--emerald);
}

.city[aria-checked='true'] .icon {
  opacity: 1;
}

.city-sheet__note {
  margin-top: 14px;
  font-size: var(--text-s);
  color: var(--ink-soft);
}

.alarm-ring {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-bottom: 6px;
  text-align: center;
}

.alarm-ring__time {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 600;
  line-height: 1;
  color: var(--emerald);
}

.alarm-ring__text {
  margin-bottom: 16px;
  color: var(--ink-soft);
}

/* ---------- Bildirim ---------- */

.toast-host {
  position: absolute;
  z-index: 45;
  left: 0;
  right: 0;
  bottom: calc(max(14px, env(safe-area-inset-bottom)) + 84px);
  display: flex;
  justify-content: center;
  padding: 0 20px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 100%;
  padding: 12px 16px;
  font-size: var(--text-s);
  font-weight: 600;
  color: var(--white);
  background: rgba(4, 56, 42, 0.94);
  border: 1px solid rgba(241, 223, 166, 0.25);
  border-radius: 18px;
  box-shadow: 0 18px 34px -16px rgba(2, 35, 26, 0.8);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(14px) scale(0.96);
  transition: opacity 0.3s ease, transform 0.45s var(--ease-spring);
}

.toast.is-in {
  opacity: 1;
  transform: none;
}

.toast__action {
  flex: none;
  min-height: 32px;
  padding: 0 4px;
  font-weight: 800;
  color: var(--gold-pale);
}
