/* =====================================================================
   Winzobet — ortak bildirim kartı (toast) · wz-toast 2026-11-03
   Sağ üstte çıkan TÜM kısa bildirimlerin tek görünümü (davranış: public/js/wz-toast.js):
     - gerçek zamanlı bildirimler  window.rtToast(mesaj, seviye, başlık, bağlantı, bildirimId)  (public/js/realtime.js)
     - sayfa içi geri bildirimler  window.toast(mesaj, tür)                                       (public/js/auth.js)
     - "yakında" balonu            window.bbSoon(mesaj)                                           (layouts/app.blade.php)
     - PWA / web push mesajları    (public/js/pwa.js içindeki toast)
   Eski görünüm (koyu mor kart, solda mor çizgi) kaldırıldı; tasarım dili = site tokenları (FB ölçümü):
   yüzey #24262b, çizgi #2e3137 / #3a3d44, metin #fff / #ababab, marka kırmızı #ff003a / #ff3361.

   Kancalar KORUNUR: #rt-toasts (kapsayıcı), .rt-toast (kart), .show (görünür) — public/css/notif.css bildirim paneli
   açıkken bunlarla toast'ları panelin soluna kaydırır / bekletir (html.wzn-open, .wzn-toast-side).
   Efektler yalnız transform / opacity (GPU): masaüstünde sağdan yaylanarak kayma, mobilde üstten düşme, bir kez ışık
   süzülmesi, ikon "pop" + renkli halka, altta kalan süre çizgisi (üstüne gelince / dokununca durur).
   prefers-reduced-motion: hareket yok, yalnız kısa solma.
   ===================================================================== */

#rt-toasts.wzt-host {
  --wzt-top: 72px; /* masaüstü üst bar 60px + 12px */
  --wzt-motion: 1; /* JS okur: 0 = hareketsiz (yer değiştirme animasyonu yapılmaz) */
  position: fixed;
  /* fix1: oyun katmanının (.wz-gov, z 100010 — wz-game-overlay.css) üstünde; oyun açıkken gelen yatırım onayı /
     "Oturum Kapatıldı" gibi bildirimler bulanık arka planın altında kaybolmasın. Sayfa yükleyicinin (2147483000) altında. */
  z-index: 100020;
  top: calc(var(--wzt-top) + env(safe-area-inset-top, 0px));
  right: calc(16px + env(safe-area-inset-right, 0px));
  left: auto;
  bottom: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
  width: min(360px, calc(100vw - 32px));
  max-width: none;
  margin: 0;
  padding: 0;
  pointer-events: none;
  font-family: inherit;
  text-align: left;
}

/* ---------------- kart ---------------- */
.wzt {
  --wzt-c: #ff3361;         /* tür rengi (ikon, halka, süre çizgisi) */
  --wzt-rgb: 255, 0, 58;    /* tür rengi rgb — yarı saydam zeminler */
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-sizing: border-box;
  width: 100%;
  min-height: 62px;
  margin: 0;
  padding: 13px 10px 15px 13px;
  overflow: hidden;
  border: 1px solid #2e3137;
  border-radius: 12px;
  background:
    radial-gradient(170px 110px at 30px 28px, rgba(var(--wzt-rgb), .14), rgba(var(--wzt-rgb), 0) 72%),
    #24262b;
  box-shadow: 0 18px 44px -14px rgba(0, 0, 0, .7), 0 2px 8px rgba(0, 0, 0, .28);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  pointer-events: auto;
  opacity: 0;
  transform: translate3d(calc(100% + 28px), 0, 0);
  transition: border-color .16s ease;
  touch-action: pan-y; /* dokunmatik ekranlı tablet / dizüstü: sağa kaydırma = kapat (JS), dikey kaydırma sayfaya */
  -webkit-tap-highlight-color: transparent;
  will-change: transform, opacity;
}
.wzt *,
.wzt *::before,
.wzt *::after { box-sizing: border-box; }

.wzt.show {
  opacity: 1;
  transform: none;
  animation: wzt-in-x .62s cubic-bezier(.2, .9, .3, 1) backwards;
}
.wzt.is-leaving {
  pointer-events: none;
  animation: wzt-out-x .26s cubic-bezier(.4, 0, 1, 1) forwards;
}
/* parmakla sürüklenirken / fırlatılırken satır içi transform geçerli olsun (giriş animasyonu kesilir) */
#rt-toasts .wzt.is-dragging,
#rt-toasts .wzt.is-flying {
  animation: none;
  opacity: 1;
}
#rt-toasts .wzt.is-flying { pointer-events: none; }
/* fix1: giriş bir kez oynar. Kart girdikten sonra (ya da parmakla tutulunca) JS .is-in koyar; böylece az kaydırılıp
   bırakılınca .is-dragging kalktığında .show animasyonu (sağdan kayma / üstten düşme) baştan başlamaz. */
#rt-toasts .wzt.show.is-in { animation: none; }

.wzt:hover { border-color: #3a3d44; }
.wzt.actionable { cursor: pointer; }

/* türler — info = marka kırmızı; hata ayrıca kırmızımsı çerçeve alır */
.wzt--info    { --wzt-c: #ff3361; --wzt-rgb: 255, 0, 58; }
.wzt--success { --wzt-c: #16c784; --wzt-rgb: 22, 199, 132; }
.wzt--warning { --wzt-c: #ffb020; --wzt-rgb: 255, 176, 32; }
.wzt--error   { --wzt-c: #ff4d5e; --wzt-rgb: 255, 59, 80; border-color: rgba(255, 77, 94, .38); }
.wzt--error:hover { border-color: rgba(255, 77, 94, .55); }

/* bir kez ışık süzülmesi */
.wzt::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 0;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, .085) 48%, rgba(255, 255, 255, .02) 56%, rgba(255, 255, 255, 0) 66%);
  transform: translate3d(-110%, 0, 0);
  pointer-events: none;
}
.wzt.show::before { animation: wzt-shine 1s .32s cubic-bezier(.3, .6, .4, 1) both; }

/* ikon karosu */
.wzt-ic {
  position: relative;
  z-index: 1;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: 0;
  border-radius: 10px;
  background: rgba(var(--wzt-rgb), .14);
  border: 1px solid rgba(var(--wzt-rgb), .32);
  color: var(--wzt-c);
}
.wzt-ic svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.wzt-ic::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 2px solid var(--wzt-c);
  opacity: 0;
  pointer-events: none;
}
.wzt.show .wzt-ic { animation: wzt-pop .52s .1s cubic-bezier(.2, 1.5, .4, 1) backwards; }
.wzt.show .wzt-ic::after { animation: wzt-ring 1.05s .3s cubic-bezier(.2, .7, .3, 1) both; }

/* metin */
.wzt-body {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-width: 0;
  padding-top: 1px;
  overflow-wrap: anywhere;
}
.wzt-title {
  margin: 0 0 2px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}
.wzt-msg {
  margin: 0;
  color: #ababab;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}
.wzt:not(.has-title) .wzt-body { padding-top: 7px; }
.wzt:not(.has-title) .wzt-msg { color: #f1f2f4; font-size: 13.5px; line-height: 20px; }

/* eylem etiketi (bağlantılı bildirim) */
.wzt-act {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  padding: 0;
  border-radius: 6px;
  color: #ff3361;
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  text-decoration: none;
}
.wzt-act svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .18s ease;
}
.wzt.actionable:hover .wzt-act svg,
.wzt-act:focus-visible svg { transform: translate3d(3px, 0, 0); }
.wzt-act:focus-visible { outline: 2px solid #ff3361; outline-offset: 3px; }

/* kapat */
.wzt-x {
  position: relative;
  z-index: 1;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: -3px 0 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #ababab;
  font: inherit;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.wzt-x svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}
.wzt-x:hover { background: #2e3137; color: #fff; }
.wzt-x:focus-visible { outline: 2px solid #fff; outline-offset: 1px; color: #fff; }

/* kalan süre çizgisi */
.wzt-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  height: 3px;
  background: rgba(255, 255, 255, .05);
  pointer-events: none;
}
.wzt-bar i {
  display: block;
  height: 100%;
  background: var(--wzt-c);
  opacity: .9;
  transform-origin: 0 50%;
}
.wzt.show .wzt-bar i,
.wzt.is-leaving .wzt-bar i { animation: wzt-bar var(--wzt-life, 6000ms) linear forwards; }
.wzt.is-paused .wzt-bar i,
.wzt.is-leaving .wzt-bar i { animation-play-state: paused; }

/* aynı bildirim tekrar gelince: kısa dürtme (yeni kart yığılmaz) — ikon karosunun pop animasyonu bozulmasın diye svg'de */
.wzt.is-nudge .wzt-ic svg { animation: wzt-nudge .42s cubic-bezier(.2, 1.5, .4, 1); }

/* ---------------- mobil: tam genişlik, üstten düşer, kaydırarak kapanır ---------------- */
@media (max-width: 767px) {
  #rt-toasts.wzt-host {
    top: calc(10px + env(safe-area-inset-top, 0px));
    left: calc(12px + env(safe-area-inset-left, 0px));
    right: calc(12px + env(safe-area-inset-right, 0px));
    width: auto;
    gap: 8px;
  }
  .wzt {
    padding: 12px 8px 14px 12px;
    transform: translate3d(0, -120%, 0);
    touch-action: none; /* yukarı / sağa kaydırma = kapat (JS) */
    -webkit-user-select: none;
    user-select: none;
  }
  .wzt.show { animation-name: wzt-in-y; animation-duration: .6s; }
  .wzt.is-leaving { animation-name: wzt-out-y; }
  .wzt-x { flex-basis: 32px; width: 32px; height: 32px; margin-top: -4px; }
}

/* ---------------- animasyonlar ---------------- */
@keyframes wzt-in-x {
  0%   { opacity: 0; transform: translate3d(calc(100% + 28px), 0, 0) scale(.96); }
  58%  { opacity: 1; transform: translate3d(-9px, 0, 0) scale(1.005); }
  80%  { transform: translate3d(3px, 0, 0) scale(1); }
  100% { opacity: 1; transform: none; }
}
@keyframes wzt-in-y {
  0%   { opacity: 0; transform: translate3d(0, -120%, 0) scale(.97); }
  58%  { opacity: 1; transform: translate3d(0, 7px, 0) scale(1); }
  80%  { transform: translate3d(0, -2px, 0); }
  100% { opacity: 1; transform: none; }
}
@keyframes wzt-out-x {
  0%   { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translate3d(36px, 0, 0) scale(.96); }
}
@keyframes wzt-out-y {
  0%   { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translate3d(0, -28px, 0) scale(.97); }
}
@keyframes wzt-shine {
  0%   { transform: translate3d(-110%, 0, 0); }
  100% { transform: translate3d(110%, 0, 0); }
}
@keyframes wzt-pop {
  0%   { opacity: 0; transform: scale(.35) rotate(-12deg); }
  60%  { opacity: 1; transform: scale(1.12) rotate(3deg); }
  100% { opacity: 1; transform: none; }
}
@keyframes wzt-nudge {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.28) rotate(-6deg); }
  100% { transform: none; }
}
@keyframes wzt-ring {
  0%   { opacity: .65; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.6); }
}
@keyframes wzt-bar {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}
@keyframes wzt-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes wzt-fade-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ---------------- hareket azaltma: kayma / ışık / pop / halka yok, yalnız kısa solma ---------------- */
@media (prefers-reduced-motion: reduce) {
  #rt-toasts.wzt-host { --wzt-motion: 0; }
  .wzt,
  .wzt.show { transform: none; }
  .wzt.show { animation: wzt-fade-in .18s linear backwards; }
  .wzt.is-leaving { animation: wzt-fade-out .18s linear forwards; }
  .wzt.show::before,
  .wzt.show .wzt-ic,
  .wzt.show .wzt-ic::after,
  .wzt.is-nudge .wzt-ic svg { animation: none; }
  .wzt::before { display: none; }
  .wzt-act svg { transition: none; }
  .wzt.actionable:hover .wzt-act svg,
  .wzt-act:focus-visible svg { transform: none; }
}
