/* =====================================================================
   /demo — Canlı QR Menü Demo Sayfası
   Desktop: Phone + Tablet mockup yan yana, sağda QR kart
   Tablet:  Phone mockup + QR kart (tablet mockup gizli)
   Mobile:  Tam ekran iframe (mockup ve QR gizli)
   ===================================================================== */

/* ---------------- LAYOUT ---------------- */

.demo-stage {
  background: var(--surface-1);
  padding-block: clamp(2.5rem, 6vh, 5rem) clamp(4rem, 8vh, 6rem);
  position: relative;
}

/* Hafif gradient arkaplan — premium hissi */
.demo-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 30% 20%, rgba(230, 22, 115, 0.045), transparent 70%),
    radial-gradient(ellipse 50% 35% at 80% 70%, rgba(120, 40, 200, 0.03), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.demo-stage > .container { position: relative; z-index: 1; }

/* ---------------- HEAD (eyebrow + h1 + sub) ---------------- */

.demo-stage__head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto clamp(2.5rem, 5vw, 4rem);
}

.demo-stage__eyebrow {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-magenta);
  background: rgba(230, 22, 115, 0.08);
  padding: 0.5rem 0.9rem;
  border-radius: var(--r-pill);
  margin-bottom: var(--sp-4);
}

.demo-stage__title {
  font-family: var(--ff-display);
  font-size: clamp(2rem, 4vw + 0.5rem, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--ink-d-100);
  margin: 0 0 var(--sp-5);
}
.demo-stage__title .accent {
  background: linear-gradient(120deg, var(--brand-magenta), #b03cff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.demo-stage__sub {
  font-size: clamp(1rem, 0.4vw + 0.9rem, 1.15rem);
  line-height: 1.6;
  color: var(--ink-d-70);
}

/* Cross-link chip — /demo ↔ /panel-demo arası geçiş davetiyesi */
.demo-stage__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: var(--sp-4);
  padding: 0.95rem 2rem;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-pill);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink-d-80);
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform var(--dur-base) var(--ease-premium);
}
.demo-stage__chip svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--brand-magenta); }
.demo-stage__chip svg:last-child { color: currentColor; transition: transform var(--dur-base) var(--ease-premium); }
.demo-stage__chip:hover {
  background: var(--brand-magenta);
  border-color: transparent;
  color: #fff;
  transform: translateY(-2px);
}
.demo-stage__chip:hover svg { color: #fff !important; }
.demo-stage__chip:hover svg:last-child { transform: translateX(3px); }

/* ---------------- ANA GRID ---------------- */

.demo-stage__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.5rem, 4vw, 4rem);
  align-items: start;
}
@media (min-width: 1024px) {
  .demo-stage__grid {
    grid-template-columns: 1fr minmax(320px, 380px);
    gap: clamp(3rem, 5vw, 5rem);
  }
}

/* ---------------- MOCKUP'LAR + TAB SWITCHER ---------------- */

.demo-mocks {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

/* Gizli radio input — yalnızca state taşıyıcı */
.demo-tabs__radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
/* Klavye fokusu görünür kalsın (a11y) */
.demo-tabs__radio:focus-visible + .demo-tabs__nav .demo-tabs__tab[for="demo-device-phone"],
.demo-tabs__radio:focus-visible ~ .demo-tabs__nav .demo-tabs__tab {
  outline: 2px solid var(--brand-magenta);
  outline-offset: 3px;
  border-radius: var(--r-pill);
}

/* Tab nav (segmented control) */
.demo-tabs__nav {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-pill);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.demo-tabs__tab {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink-d-60);
  cursor: pointer;
  border-radius: var(--r-pill);
  transition: color var(--dur-fast) var(--ease-out);
  user-select: none;
}
.demo-tabs__tab svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.demo-tabs__tab:hover { color: var(--ink-d-90); }

/* Sliding indicator (aktif tab arkaplanı) */
.demo-tabs__indicator {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 5px;
  width: calc(50% - 5px);
  background: var(--ink-d-100);
  border-radius: var(--r-pill);
  z-index: 1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform var(--dur-base) var(--ease-premium);
}

/* Aktif tab — radio :checked ile state */
#demo-device-phone:checked ~ .demo-tabs__nav .demo-tabs__tab[for="demo-device-phone"],
#demo-device-tablet:checked ~ .demo-tabs__nav .demo-tabs__tab[for="demo-device-tablet"] {
  color: #fff;
}
#demo-device-tablet:checked ~ .demo-tabs__nav .demo-tabs__indicator {
  transform: translateX(100%);
}

/* Panel switching */
.demo-tabs__panels {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
}
.demo-tab-panel {
  display: none;
  width: 100%;
  display: flex;
  justify-content: center;
}
/* Default: phone visible, tablet hidden */
.demo-tab-panel--tablet { display: none; }

#demo-device-phone:checked ~ .demo-tabs__panels .demo-tab-panel--phone { display: flex; animation: tabFadeIn 0.4s var(--ease-out); }
#demo-device-phone:checked ~ .demo-tabs__panels .demo-tab-panel--tablet { display: none; }
#demo-device-tablet:checked ~ .demo-tabs__panels .demo-tab-panel--phone { display: none; }
#demo-device-tablet:checked ~ .demo-tabs__panels .demo-tab-panel--tablet { display: flex; animation: tabFadeIn 0.4s var(--ease-out); }

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .demo-tab-panel { animation: none !important; }
  .demo-tabs__indicator { transition: none; }
}

/* PHONE mockup — her boyutta görünür (mobile hariç) */
.demo-mock--phone {
  position: relative;
}

.demo-mock__device {
  position: relative;
  background: linear-gradient(165deg, #1a1a1f, #0a0a0e);
  border-radius: 44px;
  padding: 14px;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.35),
    0 8px 24px rgba(0, 0, 0, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.demo-mock__device--phone {
  width: 410px;
  height: 850px;
}
@media (max-width: 480px) {
  /* Tablet/dar viewport sığması için küçült */
  .demo-mock__device--phone { width: min(360px, 92vw); height: auto; aspect-ratio: 410 / 850; }
}

.demo-mock__device--tablet {
  width: 580px;
  max-width: 92vw;
  aspect-ratio: 3 / 4;       /* iPad portrait oranı */
  border-radius: 36px;
  padding: 18px;
}

/* Phone notch */
.demo-mock__notch {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 26px;
  background: #000;
  border-radius: 0 0 18px 18px;
  z-index: 2;
  opacity: .1;
}

.demo-mock__speaker {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 5px;
  background: #1d1d22;
  border-radius: 3px;
  z-index: 3;
}

/* Tablet camera — portrait için üst orta */
.demo-mock__camera {
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  background: #2a2a30;
  border-radius: 50%;
  box-shadow: inset 0 0 2px rgba(255, 255, 255, 0.1);
  z-index: 3;
}

/* Screen — iframe wrapper */
.demo-mock__screen {
  position: relative;
  width: 100%;
  height: 100%;
  background: #fff;
  border-radius: 30px;
  overflow: hidden;
}
.demo-mock__device--tablet .demo-mock__screen {
  border-radius: 22px;
}

.demo-mock__screen iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  opacity: 0;
  transition: opacity 0.6s var(--ease-out);
}
.demo-mock__device.is-loaded iframe {
  opacity: 1;
}

.demo-mock__loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-sm);
  color: var(--ink-d-50);
  background: var(--surface-2);
  z-index: 1;
  transition: opacity 0.4s var(--ease-out);
}
.demo-mock__device.is-loaded .demo-mock__loader {
  opacity: 0;
  pointer-events: none;
}

.demo-mock__caption {
  text-align: center;
  margin-top: var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--ink-d-60);
  font-style: italic;
}

/* ---------------- ANNOTATION PINLERİ (sadece desktop) ---------------- */

.demo-mock__pins {
  display: none;
  position: absolute;
  inset: 0;
  pointer-events: none;
}
@media (min-width: 1280px) {
  .demo-mock--phone .demo-mock__pins { display: block; }
}

.demo-pin {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  white-space: nowrap;
}

/* Sol taraftan çıkan oklar */
.demo-pin--top { top: 14%;  right: calc(100% + 12px); flex-direction: row-reverse; }
.demo-pin--mid { top: 45%;  right: calc(100% + 12px); flex-direction: row-reverse; }
.demo-pin--bot { top: 74%;  right: calc(100% + 12px); flex-direction: row-reverse; }

.demo-pin__line {
  display: block;
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ink-d-40));
  position: relative;
}
.demo-pin--top .demo-pin__line,
.demo-pin--mid .demo-pin__line,
.demo-pin--bot .demo-pin__line {
  background: linear-gradient(90deg, var(--ink-d-40), transparent);
}
.demo-pin__line::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: var(--brand-magenta);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(230, 22, 115, 0.15);
}

.demo-pin__label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-d-70);
  background: var(--surface-1);
  padding: 0.4rem 0.7rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-soft);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

/* TABLET mockup — tab ile kontrol edilir, hep flex */
.demo-mock--tablet { display: block; }

/* ---------------- SAĞ KOLON: QR CARD ---------------- */

.demo-side {
  position: sticky;
  top: calc(var(--nav-h, 72px) + 1rem);
}

.demo-qr-card {
  background: var(--surface-1);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: clamp(1.5rem, 2.5vw, 2.25rem);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.06),
    0 2px 8px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
}

/* Premium gradient border efekti */
.demo-qr-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--r-lg);
  padding: 1px;
  background: linear-gradient(135deg, rgba(230, 22, 115, 0.3), transparent 40%, transparent 60%, rgba(120, 40, 200, 0.2));
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.demo-qr-card__eyebrow {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-magenta);
  margin-bottom: var(--sp-3);
}

.demo-qr-card__title {
  font-family: var(--ff-display);
  font-size: clamp(1.25rem, 1.5vw + 0.6rem, 1.625rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink-d-100);
  margin: 0 0 var(--sp-3);
}
.demo-qr-card__title .accent {
  background: linear-gradient(120deg, var(--brand-magenta), #b03cff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.demo-qr-card__intro {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink-d-70);
  margin-bottom: var(--sp-5);
}

/* QR görsel */
.demo-qr-card__qr {
  position: relative;
  width: 240px;
  height: 240px;
  margin: 0 auto var(--sp-4);
  padding: var(--sp-3);
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.demo-qr-card__qr img {
  width: 100%;
  height: auto;
  display: block;
}

/* Pulsating ring — "tara beni" çağrısı */
.demo-qr-card__qr-pulse {
  position: absolute;
  inset: -8px;
  border: 2px solid var(--brand-magenta);
  border-radius: 22px;
  opacity: 0;
  animation: qrPulse 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes qrPulse {
  0%   { opacity: 0.5; transform: scale(0.96); }
  70%  { opacity: 0;   transform: scale(1.08); }
  100% { opacity: 0;   transform: scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  .demo-qr-card__qr-pulse { animation: none; }
}

.demo-qr-card__url {
  text-align: center;
  margin-bottom: var(--sp-4);
}
.demo-qr-card__url-label {
  display: block;
  font-size: var(--fs-xs);
  color: var(--ink-d-50);
  margin-bottom: 0.25rem;
}
.demo-qr-card__url code {
  font-family: var(--ff-mono, monospace);
  font-size: 0.95rem;
  color: var(--ink-d-90);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.demo-qr-card__divider {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: var(--sp-4) 0;
  color: var(--ink-d-40);
  font-size: 0.82rem;
}
.demo-qr-card__divider::before,
.demo-qr-card__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}

.demo-qr-card__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.95rem 1.25rem;
  background: var(--ink-d-100);
  color: #fff;
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  transition:
    background var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-premium),
    box-shadow var(--dur-base) var(--ease-out);
}
.demo-qr-card__btn:hover {
  background: var(--brand-magenta);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(230, 22, 115, 0.28);
}

.demo-side__note {
  display: flex;
  gap: var(--sp-3);
  margin-top: var(--sp-5);
  padding: var(--sp-4);
  background: var(--surface-2);
  border-radius: var(--r-md);
  border-left: 3px solid var(--brand-magenta);
}
.demo-side__note svg {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: var(--brand-magenta);
  margin-top: 2px;
}
.demo-side__note p {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--ink-d-70);
  margin: 0;
}

/* ---------------- DEMO ALTI: Followup CTA + İlgili sayfalar ---------------- */

.demo-followup {
  margin-top: clamp(4rem, 7vw, 6rem);
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.5rem, 4vw, 3.5rem);
  padding-top: clamp(2.5rem, 4vw, 3.5rem);
  border-top: 1px solid var(--line-soft);
}
@media (min-width: 900px) {
  .demo-followup { grid-template-columns: 1.3fr 1fr; }
}

.demo-followup__title {
  font-family: var(--ff-display);
  font-size: clamp(1.5rem, 2vw + 0.6rem, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 var(--sp-3);
  color: var(--ink-d-100);
}
.demo-followup__title .accent {
  background: linear-gradient(120deg, var(--brand-magenta), #b03cff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.demo-followup__sub {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink-d-70);
  margin-bottom: var(--sp-5);
  max-width: 50ch;
}
.demo-followup__cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

.demo-followup__related {
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: clamp(1.25rem, 2vw, 1.75rem);
}
.demo-followup__related-label {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-d-50);
  margin-bottom: var(--sp-3);
}
.demo-followup__related ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.demo-followup__related a {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0.85rem 0.85rem 0.85rem 0.65rem;
  margin: 0 -0.5rem;
  border-radius: var(--r-sm);
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease-out);
}
.demo-followup__related a:hover {
  background: var(--surface-1);
}
.demo-followup__related a:hover .demo-related-icon {
  background: var(--brand-magenta);
  color: #fff;
  border-color: transparent;
  transform: scale(1.05);
}

/* İkon kutusu — sol */
.demo-related-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--surface-1);
  border: 1px solid var(--line-soft);
  color: var(--brand-magenta);
  transition:
    background var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    transform var(--dur-base) var(--ease-premium);
}
.demo-related-icon svg {
  width: 20px;
  height: 20px;
}

/* Metin bloku — sağ */
.demo-related-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.demo-related-body strong {
  font-size: 0.95rem;
  color: var(--ink-d-100);
  font-weight: 600;
}
.demo-related-body > span {
  font-size: 0.82rem;
  color: var(--ink-d-60);
}

/* ---------------- MOBILE FULLSCREEN MODE ----------------
   Mobilde demo, kendi URL'sinde çalışıyormuş hissi vermesi için
   site nav/footer'ı görsel olarak kapatan tam ekran iframe.
   `position: fixed; inset: 0` ile viewport'un tamamını kaplar;
   body scroll'u iframe'in kendi scroll'una devredilir.
   ----------------------------------------------------------- */

.demo-fullscreen { display: none; }

/* Mobilde demo, kendi URL'sinde çalışıyormuş hissi vermesi için site
   nav/footer'ı görsel olarak kapatır; alta tek satırlık ince bilgi şeridi
   bırakılır. :has() 2026 itibarıyla tüm modern tarayıcılarda destekli. */
@media (max-width: 767px) {
  .demo-stage { display: none; }

  .demo-fullscreen {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #fff;
  }
  .demo-fullscreen__iframe {
    width: 100vw;
    /* Şerit yüksekliği kadar boşluk bırak (env safe-area da hesaba katılır) */
    height: calc(100dvh - 44px - env(safe-area-inset-bottom, 0px));
    border: 0;
    display: block;
    background: #fff;
  }

  /* Body scroll kilidi + alttaki iç sayfaları gizle */
  body:has(.demo-fullscreen) {
    overflow: hidden;
    height: 100dvh;
  }
  body:has(.demo-fullscreen) .nav,
  body:has(.demo-fullscreen) footer,
  body:has(.demo-fullscreen) .reading-progress {
    visibility: hidden;
  }

  /* ---------- İnce tek satır bilgi şeridi (sabit alt) ---------- */
  .demo-fullscreen__strip {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    height: 44px;
    padding: 0 0.85rem calc(env(safe-area-inset-bottom, 0px));
    background: var(--ink-d-100);
    color: #fff;
    text-decoration: none;
    font-size: 0.78rem;
    line-height: 1.2;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.15);
    overflow: hidden;
  }
  .demo-fullscreen__strip-dot {
    flex-shrink: 0;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2bd576;
    box-shadow: 0 0 0 3px rgba(43, 213, 118, 0.25);
    animation: liveDot 2s ease-in-out infinite;
  }
  .demo-fullscreen__strip-text {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: rgba(255, 255, 255, 0.85);
  }
  .demo-fullscreen__strip-text strong {
    color: #fff;
    font-weight: 600;
  }
  .demo-fullscreen__strip-cta {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.75rem;
    background: var(--brand-magenta);
    border-radius: var(--r-pill);
    font-size: 0.78rem;
    font-weight: 600;
    color: #fff;
  }
  @keyframes liveDot {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
  }
}
