/* ============================================================
   Pratik CRM — tur sayfası stilleri (tur/*.html)
   Motor: js/tour-engine.js  —  sınıf sözleşmesi:
   body.tour-active  → tam ekran scroll turu çalışıyor
   body.tour-static  → reduced-motion / statik sahne düşüşü
   ============================================================ */

/* ---------- Üst bar (sahne üzerinde yarı saydam) ---------- */

/* Tur sırasında CRM arayüzünün üstüne binmesin diye yalnızca
   sağ üstte tek bir dönüş bağlantısı durur. */
.tour-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  pointer-events: none;
}

.tour-topbar > * { pointer-events: auto; }

.tour-topbar .logo { color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, .45); }

.tour-topbar .logo img { border-radius: 9px; box-shadow: 0 2px 10px rgba(0, 0, 0, .3); }

.tour-topbar .logo .logo-mark { box-shadow: 0 2px 10px rgba(0, 0, 0, .3); }

.tour-topbar .back {
  margin-left: auto;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 8px 16px;
  transition: background-color .15s;
}

.tour-topbar .back:hover { background: rgba(255, 255, 255, .26); }

/* Statik/no-JS modda bar koyu zemin üstünde okunur kalsın */
body:not(.tour-active) .tour-topbar {
  position: sticky;
  background: var(--navy);
  justify-content: flex-end;
}

/* ---------- Track & sahne ---------- */

/* Varsayılan (JS yok): normal akış — ilk görsel hero gibi görünür */
.tour-track { position: relative; }

.tour-stage { position: relative; }

.tour-viewport { position: relative; }

.tour-viewport .shot { width: 100%; }

.tour-viewport .shot + .shot { display: none; }

.tour-cursor, .tour-ripple, .tour-dots, .tour-skip,
.tour-caption, .tour-loading, .tour-hint { display: none; }

/* Aktif tur modu: JS track yüksekliğini inline verir */
body.tour-active .tour-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: #1c0c0a; /* görsel yüklenene dek koyu zemin */
}

body.tour-active .tour-viewport {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
}

body.tour-active .tour-viewport .shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
}

body.tour-active .tour-viewport .shot:first-child { opacity: 1; }

/* ---------- İmleç & tıklama halkası ---------- */

body.tour-active .tour-cursor {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  z-index: 30;
  transform-origin: 4px 2px; /* ok ucu — tıklama küçülmesi uçtan olsun */
  will-change: transform;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .45));
}

body.tour-active .tour-ripple {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px rgba(36, 26, 24, .35), inset 0 0 0 1px rgba(36, 26, 24, .35);
  border-radius: 50%;
  opacity: 0;
  z-index: 25;
  will-change: transform, opacity;
}

/* ---------- Açıklama kartı ---------- */

body.tour-active .tour-caption {
  display: block;
  position: absolute;
  left: max(24px, 3vw);
  bottom: max(28px, 5vh);
  z-index: 40;
  max-width: min(400px, 78vw);
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(236, 222, 219, .9);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 16px 20px;
  opacity: 0;
  transform: translateY(20px);
  will-change: transform, opacity;
}

body.tour-active .tour-caption .step-no {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

body.tour-active .tour-caption h2 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
}

body.tour-active .tour-caption p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

/* ---------- İlerleme noktaları & atla ---------- */

body.tour-active .tour-dots {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: absolute;
  right: max(18px, 2.5vw);
  top: 50%;
  translate: 0 -50%;
  z-index: 40;
}

body.tour-active .tour-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .45);
  box-shadow: 0 0 0 1px rgba(36, 26, 24, .25);
  transition: transform .2s, background-color .2s;
}

body.tour-active .tour-dots i.on {
  background: #fff;
  transform: scale(1.45);
}

body.tour-active .tour-skip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  position: absolute;
  left: 50%;
  bottom: max(20px, 3.5vh);
  translate: -50% 0;
  z-index: 40;
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  background: rgba(58, 21, 18, .62);
  border: 1px solid rgba(255, 255, 255, .25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 7px 15px;
  transition: background-color .15s, opacity .3s;
}

body.tour-active .tour-skip:hover { background: rgba(58, 21, 18, .85); }

/* "Kaydırın" ipucu — tur başında görünür, scroll başlayınca kaybolur */
body.tour-active .tour-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  position: absolute;
  left: 50%;
  bottom: max(74px, 11vh);
  translate: -50% 0;
  z-index: 40;
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  background: rgba(58, 21, 18, .62);
  border: 1px solid rgba(255, 255, 255, .25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 7px 15px;
  pointer-events: none;
  animation: hint-bob 1.8s ease-in-out infinite;
  transition: opacity .4s;
}

body.tour-active .tour-hint.gone { opacity: 0; }

@keyframes hint-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(7px); }
}

/* ---------- Yükleme çubuğu ---------- */

body.tour-active .tour-loading {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 70;
  background: rgba(255, 255, 255, .15);
  opacity: 0;
  transition: opacity .3s;
}

body.tour-active .tour-loading.show { opacity: 1; }

body.tour-active .tour-loading i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--primary);
  transition: width .25s;
}

/* ---------- Statik düşüş (reduced-motion) ---------- */

body.tour-static .tour-track { height: auto !important; }

.tour-scenes { display: grid; gap: 28px; padding: 28px 0; }

.tour-scenes figure {
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: 24px;
}

.tour-scenes img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.tour-scenes figcaption {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 14px 6px 0;
}

.tour-scenes figcaption .step-no {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  translate: 0 4px;
}

.tour-scenes figcaption h2 { font-size: 17px; font-weight: 700; }

.tour-scenes figcaption p { font-size: 14.5px; color: var(--muted); margin-top: 2px; }

/* ---------- Tur sonrası içerik ---------- */

.tour-content { background: var(--bg); position: relative; z-index: 10; }

.tour-content .intro {
  max-width: 760px;
  margin-inline: auto;
  padding: 88px 24px 8px;
  text-align: center;
}

.tour-content .intro h1 { font-size: clamp(28px, 4vw, 42px); font-weight: 800; }

.tour-content .intro p { color: var(--muted); font-size: 17px; margin-top: 14px; }

/* ---------- Turlar arası gezinme şeridi ---------- */

.tour-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 20px 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.tour-nav-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  color: var(--ink);
  border-radius: 10px;
  padding: 8px 12px;
  transition: background-color .15s;
}

.tour-nav-link:hover { background: var(--primary-50); }

.tour-nav-link .dir { font-size: 12.5px; font-weight: 600; color: var(--primary); }

.tour-nav-link .ad { font-size: 15px; font-weight: 600; }

.tour-nav-link.next { text-align: right; }

.tour-nav-link.all {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

@media (max-width: 600px) {
  .tour-nav { grid-template-columns: 1fr; text-align: center; }
  .tour-nav-link.next { text-align: center; }
}

/* ---------- Mobil ---------- */

@media (max-width: 767px) {
  body.tour-active .tour-caption {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: none;
    padding: 12px 16px;
  }

  body.tour-active .tour-caption h2 { font-size: 15px; }

  body.tour-active .tour-caption p { font-size: 13px; }

  body.tour-active .tour-dots { display: none; }

  body.tour-active .tour-skip { bottom: auto; top: max(14px, 2vh); left: auto; right: 14px; translate: 0 0; }

  body.tour-active .tour-hint { bottom: 30vh; }

  .tour-topbar .back { font-size: 13px; padding: 7px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .tour-hint { animation: none; }
}
