/* =====================================================================
   /panel-demo — Yönetim Paneli PWA Showcase
   iPad/Phone home screen → tap → app launch zoom → splash → panel
   Sahne kontrolü: data-stage="home|launching|splash|panel" (JS set eder)
   ===================================================================== */

.pdemo-stage {
  background: var(--surface-1);
  padding-block: clamp(2.5rem, 6vh, 5rem) clamp(4rem, 8vh, 6rem);
  position: relative;
  overflow: hidden;
}
.pdemo-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;
}
.pdemo-stage > .container { position: relative; z-index: 1; }

/* ---------------- HEAD ---------------- */
.pdemo-stage__head {
  text-align: center;
  max-width: 760px;
  margin: 0 auto clamp(2.5rem, 5vw, 4rem);
}
.pdemo-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);
}
.pdemo-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);
}
.pdemo-stage__title .accent {
  background: linear-gradient(120deg, var(--brand-magenta), #b03cff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pdemo-stage__sub {
  font-size: clamp(1rem, 0.4vw + 0.9rem, 1.15rem);
  line-height: 1.6;
  color: var(--ink-d-70);
}

/* ---------------- TAB SWITCHER (segmented) ---------------- */
.pdemo-mocks {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.5rem, 3vw, 2.5rem);
}
.pdemo-tabs__radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.pdemo-tabs__radio:focus-visible ~ .pdemo-tabs__nav .pdemo-tabs__tab {
  outline: 2px solid var(--brand-magenta);
  outline-offset: 3px;
  border-radius: var(--r-pill);
}

.pdemo-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);
}
.pdemo-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;
  color: var(--ink-d-60);
  cursor: pointer;
  border-radius: var(--r-pill);
  transition: color var(--dur-fast) var(--ease-out);
  user-select: none;
}
.pdemo-tabs__tab svg { width: 16px; height: 16px; flex-shrink: 0; }
.pdemo-tabs__tab:hover { color: var(--ink-d-90); }

.pdemo-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);
}
#pdemo-device-tablet:checked ~ .pdemo-tabs__nav .pdemo-tabs__tab[for="pdemo-device-tablet"],
#pdemo-device-phone:checked  ~ .pdemo-tabs__nav .pdemo-tabs__tab[for="pdemo-device-phone"] {
  color: #fff;
}
#pdemo-device-phone:checked ~ .pdemo-tabs__nav .pdemo-tabs__indicator {
  transform: translateX(100%);
}

.pdemo-tabs__panels {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
}
.pdemo-tab-panel { display: none; width: 100%; justify-content: center; }
#pdemo-device-tablet:checked ~ .pdemo-tabs__panels .pdemo-tab-panel--tablet { display: flex; animation: pdemoFade .4s var(--ease-out); }
#pdemo-device-phone:checked  ~ .pdemo-tabs__panels .pdemo-tab-panel--phone  { display: flex; animation: pdemoFade .4s var(--ease-out); }
@keyframes pdemoFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------------- DEVICE BEZEL (iPad / iPhone) ---------------- */
.pdemo-mockup {
  display: flex;
  justify-content: center;
  width: 100%;
}

.pdemo-device {
  position: relative;
  background: linear-gradient(165deg, #1a1a1f, #0a0a0e);
  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);
}

/* iPad Pro 12.9" yatay — 4:3 oran */
.pdemo-device--tablet {
  width: min(1100px, 92vw);
  aspect-ratio: 4 / 3;
  border-radius: 32px;
  padding: 18px;
}
.pdemo-device--tablet .pdemo-screen {
  border-radius: 18px;
}
.pdemo-device__camera {
  position: absolute;
  top: 50%;
  left: 9px;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: #2a2a30;
  border-radius: 50%;
  z-index: 4;
}

/* iPhone — dikey, /demo'daki ile aynı oran */
.pdemo-device--phone {
  width: 410px;
  height: 850px;
  border-radius: 44px;
  padding: 14px;
}
@media (max-width: 480px) {
  .pdemo-device--phone { width: min(360px, 92vw); height: auto; aspect-ratio: 410 / 850; }
}
.pdemo-device--phone .pdemo-screen { border-radius: 30px; }
.pdemo-device__notch {
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  width: 110px; height: 26px;
  background: #000;
  border-radius: 0 0 18px 18px;
  z-index: 4;
}
.pdemo-device__speaker {
  position: absolute;
  top: 22px; left: 50%;
  transform: translateX(-50%);
  width: 56px; height: 5px;
  background: #1d1d22;
  border-radius: 3px;
  z-index: 5;
}

/* ---------------- SCREEN — tüm sahneler bunun içinde, z-index ile dizili ---------------- */
.pdemo-screen {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
}

/* ---------- 1. WALLPAPER ---------- */
.pdemo-wallpaper {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse 70% 50% at 30% 20%, rgba(230, 22, 115, 0.25), transparent 60%),
    radial-gradient(ellipse 80% 60% at 80% 80%, rgba(120, 40, 200, 0.3), transparent 60%),
    linear-gradient(135deg, #1a1233, #0a0a18 70%);
  transition: opacity .35s var(--ease-out);
}

/* ---------- 2. STATUS BAR ---------- */
.pdemo-statusbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 1.5rem;
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.78rem;
  font-weight: 600;
  font-feature-settings: "tnum";
  letter-spacing: -0.01em;
  pointer-events: none;
}
.pdemo-device--phone .pdemo-statusbar {
  padding: 0.55rem 1.8rem 0.4rem;
  font-size: 0.85rem;
}
.pdemo-statusbar__time { white-space: nowrap; }
.pdemo-statusbar__icons {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
}
.pdemo-statusbar__icons svg { height: 11px; width: auto; }

/* ---------- 3. HOME (app grid + dock) ---------- */
.pdemo-home {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 4rem 2.5rem 1.5rem;
  transition:
    opacity .4s var(--ease-out),
    transform .4s var(--ease-out);
}
.pdemo-device--phone .pdemo-home {
  padding: 3.5rem 1.4rem 1rem;
}

.pdemo-home__grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.4rem 1.6rem;
  align-content: start;
}
.pdemo-device--phone .pdemo-home__grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem 1rem;
}

/* App icon — base */
.pdemo-app {
  position: relative;
  aspect-ratio: 1;
  border-radius: 22%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  transition: transform .25s var(--ease-premium);
}
.pdemo-app__symbol {
  width: 55%;
  height: 55%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pdemo-app__symbol svg { width: 100%; height: 100%; }

/* QrMenum app — özel, prominent */
.pdemo-app--qrmenum {
  background: #fff;
  position: relative;
  cursor: pointer;
  z-index: 4;
  animation: pdemoAppPulse 2.4s ease-out infinite;
  box-shadow:
    0 6px 22px rgba(230, 22, 115, 0.4),
    0 2px 6px rgba(0, 0, 0, 0.2);
}
.pdemo-app__icon {
  width: 80%;
  height: 80%;
  object-fit: contain;
}
.pdemo-app__badge {
  position: absolute;
  top: -6px; right: -6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: #ff3b30;
  color: #fff;
  border-radius: 11px;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 6px rgba(255, 59, 48, 0.4);
}
@keyframes pdemoAppPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.03); }
}

/* Dock */
.pdemo-dock {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 0.6rem 0.8rem;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  width: fit-content;
  margin: 1.2rem auto 0;
}
.pdemo-app--dock { width: 56px; height: 56px; }
.pdemo-device--phone .pdemo-app--dock { width: 48px; height: 48px; }

/* Hint tooltip */
.pdemo-hint {
  position: absolute;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: var(--r-pill);
  backdrop-filter: blur(10px);
  pointer-events: none;
  opacity: 0;
  animation: pdemoHintFade 4s ease-in-out infinite;
}
.pdemo-hint svg { width: 14px; height: 14px; }
/* Tablet: hint sağ üst köşede, QrMenum app'in altında */
.pdemo-device--tablet .pdemo-hint {
  top: 18%;
  right: 8%;
}
.pdemo-device--phone .pdemo-hint {
  top: 22%;
  right: 4%;
  font-size: 0.7rem;
  padding: 0.35rem 0.7rem;
}
@keyframes pdemoHintFade {
  0%, 100% { opacity: 0; }
  20%, 70% { opacity: 1; }
}

/* ---------- 4. CURSOR (animasyonlu parmak) ---------- */
.pdemo-cursor {
  position: absolute;
  z-index: 6;
  width: 32px;
  height: 32px;
  pointer-events: none;
  opacity: 0;
  /* Başlangıç: ekran dışı sağ-alt */
  transform: translate(0, 0);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
  /* JS animasyonu yerine pure CSS keyframe */
  animation: pdemoCursorMove 6s ease-out infinite;
}
.pdemo-cursor svg { width: 100%; height: 100%; }

/* Tablet — cursor sağ alttan QrMenum ikonuna doğru süzülür.
   QrMenum ikonu grid'in 9. sırasında (5x2 grid'te). Pozisyon yaklaşık: %35 left, %25 top.
   Cursor başlangıç: %85 left, %75 top (sağ alt). Hedef: %38 left, %28 top. */
.pdemo-device--tablet .pdemo-cursor {
  top: 28%;
  left: 38%;
  animation-name: pdemoCursorTablet;
}
@keyframes pdemoCursorTablet {
  0%   { opacity: 0; transform: translate(280px, 220px); }
  10%  { opacity: 1; }
  40%  { opacity: 1; transform: translate(0, 0); }
  /* tap feedback at 45% */
  45%  { transform: translate(0, 0) scale(0.92); }
  50%  { transform: translate(0, 0) scale(1); opacity: 1; }
  55%  { opacity: 0; }
  100% { opacity: 0; transform: translate(280px, 220px); }
}

/* Phone — cursor benzer ama küçük */
.pdemo-device--phone .pdemo-cursor {
  top: 30%;
  left: 60%;
  animation-name: pdemoCursorPhone;
}
@keyframes pdemoCursorPhone {
  0%   { opacity: 0; transform: translate(150px, 150px); }
  10%  { opacity: 1; }
  40%  { opacity: 1; transform: translate(0, 0); }
  45%  { transform: translate(0, 0) scale(0.92); }
  50%  { transform: translate(0, 0) scale(1); opacity: 1; }
  55%  { opacity: 0; }
  100% { opacity: 0; transform: translate(150px, 150px); }
}

/* ---------- 5. SPLASH (app launching → loading) ---------- */
.pdemo-splash {
  position: absolute;
  inset: 0;
  z-index: 7;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s var(--ease-out);
}
.pdemo-splash__icon {
  width: 96px;
  height: 96px;
  /* Launch zoom başlangıç: küçük → büyük */
  transform: scale(0.3);
  opacity: 0;
}
.pdemo-splash__bar {
  width: 140px;
  height: 3px;
  background: rgba(230, 22, 115, 0.15);
  border-radius: 2px;
  overflow: hidden;
}
.pdemo-splash__bar span {
  display: block;
  width: 30%;
  height: 100%;
  background: var(--brand-magenta);
  border-radius: 2px;
  animation: pdemoBarSlide 1.2s ease-in-out infinite;
}
@keyframes pdemoBarSlide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(450%); }
}

/* ---------- 6. READY OVERLAY (panel iframe yerine) ---------- */
.pdemo-ready {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  text-align: center;
  background: linear-gradient(135deg, #fff, #fafafa);
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s var(--ease-out);
}
.pdemo-ready__icon {
  width: 72px;
  height: 72px;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 4px 12px rgba(230, 22, 115, 0.25));
}
.pdemo-ready__title {
  font-family: var(--ff-display);
  font-size: clamp(1.4rem, 2vw + 0.5rem, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink-d-100);
  margin: 0;
}
.pdemo-ready__sub {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink-d-70);
  margin: 0 0 0.75rem;
  max-width: 38ch;
}
.pdemo-ready__sub strong { color: var(--ink-d-100); font-weight: 600; }

.pdemo-device--phone .pdemo-ready__icon { width: 56px; height: 56px; }
.pdemo-device--phone .pdemo-ready__title { font-size: 1.2rem; }
.pdemo-device--phone .pdemo-ready__sub { font-size: 0.85rem; }

/* ---------- 7. DEMO badge + Replay ---------- */
.pdemo-badge {
  position: absolute;
  top: 1rem; left: 1rem;
  z-index: 9;
  padding: 0.25rem 0.6rem;
  background: rgba(230, 22, 115, 0.95);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  border-radius: var(--r-pill);
  box-shadow: 0 2px 8px rgba(230, 22, 115, 0.4);
  opacity: 0;
  transition: opacity .4s var(--ease-out);
  pointer-events: none;
}
.pdemo-replay {
  position: absolute;
  bottom: 1rem; right: 1rem;
  z-index: 9;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  border: 0;
  border-radius: var(--r-pill);
  cursor: pointer;
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity .4s var(--ease-out),
    background var(--dur-fast) var(--ease-out),
    transform var(--dur-base) var(--ease-premium);
}
.pdemo-replay svg { width: 14px; height: 14px; }
.pdemo-replay:hover {
  background: var(--brand-magenta);
  transform: translateY(-2px);
}

/* =====================================================================
   STAGE STATES — JS data-stage attribute ile kontrol
   ===================================================================== */

/* HOME — başlangıç (default) */
.pdemo-mockup[data-stage="home"] .pdemo-home {
  opacity: 1;
  transform: scale(1);
}

/* LAUNCHING — icon zoom, home fade */
.pdemo-mockup[data-stage="launching"] .pdemo-home {
  opacity: 0;
  transform: scale(1.4);
  pointer-events: none;
}
.pdemo-mockup[data-stage="launching"] .pdemo-app--qrmenum {
  animation: pdemoIconLaunch .5s var(--ease-premium) forwards;
  z-index: 10;
}
.pdemo-mockup[data-stage="launching"] .pdemo-cursor,
.pdemo-mockup[data-stage="launching"] .pdemo-hint {
  opacity: 0 !important;
}
@keyframes pdemoIconLaunch {
  0%   { transform: scale(1); }
  100% { transform: scale(8); opacity: 0; }
}

/* SPLASH — beyaz ekran + logo + spinner */
.pdemo-mockup[data-stage="splash"] .pdemo-home,
.pdemo-mockup[data-stage="splash"] .pdemo-wallpaper {
  opacity: 0;
}
.pdemo-mockup[data-stage="splash"] .pdemo-statusbar {
  color: rgba(0, 0, 0, 0.85);
}
.pdemo-mockup[data-stage="splash"] .pdemo-statusbar__icons { color: #000; }
.pdemo-mockup[data-stage="splash"] .pdemo-splash {
  opacity: 1;
}
.pdemo-mockup[data-stage="splash"] .pdemo-splash__icon {
  animation: pdemoLogoIn .5s var(--ease-premium) forwards;
}
@keyframes pdemoLogoIn {
  0%   { transform: scale(0.3); opacity: 0; }
  60%  { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* READY — splash fade out, ready overlay fade in (panel açma CTA) */
.pdemo-mockup[data-stage="ready"] .pdemo-home,
.pdemo-mockup[data-stage="ready"] .pdemo-wallpaper,
.pdemo-mockup[data-stage="ready"] .pdemo-statusbar {
  opacity: 0;
  pointer-events: none;
}
.pdemo-mockup[data-stage="ready"] .pdemo-splash {
  opacity: 0;
}
.pdemo-mockup[data-stage="ready"] .pdemo-ready {
  opacity: 1;
  pointer-events: auto;
}

/* prefers-reduced-motion: animasyonları sustur, ready'e atla */
@media (prefers-reduced-motion: reduce) {
  .pdemo-app--qrmenum,
  .pdemo-cursor,
  .pdemo-hint,
  .pdemo-splash__bar span { animation: none !important; }
  .pdemo-mockup .pdemo-home,
  .pdemo-mockup .pdemo-wallpaper,
  .pdemo-mockup .pdemo-statusbar { opacity: 0 !important; }
  .pdemo-mockup .pdemo-ready { opacity: 1 !important; pointer-events: auto !important; }
}

/* =====================================================================
   3 PWA Değer Kartı (mockup altı)
   ===================================================================== */
.pdemo-features {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-4);
  margin-top: clamp(3rem, 5vw, 4rem);
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
}
@media (min-width: 720px) {
  .pdemo-features { grid-template-columns: repeat(3, 1fr); }
}
.pdemo-feature {
  padding: clamp(1.25rem, 2vw, 1.75rem);
  background: var(--surface-1);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  transition:
    transform var(--dur-base) var(--ease-premium),
    box-shadow var(--dur-base) var(--ease-out);
}
.pdemo-feature:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
}
.pdemo-feature__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(230, 22, 115, 0.08);
  color: var(--brand-magenta);
  margin-bottom: var(--sp-3);
}
.pdemo-feature__icon svg { width: 22px; height: 22px; }
.pdemo-feature h3 {
  font-family: var(--ff-display);
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 var(--sp-2);
  color: var(--ink-d-100);
}
.pdemo-feature p {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink-d-70);
  margin: 0;
}

/* =====================================================================
   MOBILE — pdemo-stage görünür kalır, tablet sekmesi ve panel gizlenir.
   Default: telefon mockup'ı + ready CTA (modal'ı tetikler).
   ===================================================================== */
@media (max-width: 767px) {
  /* Tab switcher gizle — sadece telefon var */
  .pdemo-tabs__nav { display: none; }
  /* Tablet panel'i tamamen kaldır */
  .pdemo-tab-panel--tablet { display: none !important; }
  /* Phone panel'i radio state'inden bağımsız her zaman göster */
  .pdemo-tab-panel--phone { display: flex !important; }

  .pdemo-stage { padding-top: clamp(1.5rem, 4vh, 3rem); }
  .pdemo-stage__head { margin-bottom: var(--sp-5); }
}
