/* MR modal slide-in animation — ITER 285 BS-paralel drift cert
   ─────────────────────────────────────────────────────────────────
   Source canonical: bs-reference/css/custom.css line 524 + 538
     @keyframes popupSlideIn { from{opacity:0; scale:.95; translate:0 20px} to{opacity:1; scale:1; translate:0 0} }
     animation: popupSlideIn .3s ease-out
     backdrop: blur(12px) saturate(120%); background: rgba(0,0,0,.6)

   Phase D / ITER 285 (2026-05-07) — drift cert pass on MR Bootstrap modal layer to match
   BS .popup-holder-bc / .popup-inner-bc keyframe behavior.

   ITER 285 drift items resolved (D1–D7):
     D1: duration 280ms → 300ms
     D2: easing cubic-bezier(0.4,0,0.2,1) → ease-out
     D3: initial translate 24px → 20px
     D4: initial scale 0.96 → 0.95
     D5: auth modal bounce overshoot REMOVED (BS linear, no 60% overshoot frame)
     D6: backdrop opacity 0.55 → rgba(0,0,0,.6) bg-alpha
     D7: mobile @media full bottom-sheet REMOVED (BS popupSlideIn is universal 20px slide)

   Tokens (BS-paralel):
     --bs-modal-duration: 300ms
     --bs-modal-ease: ease-out
     --bs-modal-backdrop-blur: 12px
     --bs-modal-backdrop-saturate: 120%
     --bs-modal-backdrop-alpha: rgba(0,0,0,.6)

   Reduced-motion respected (rule a11y).
   Scroll-lock body class preserved (iOS Safari fix).
*/

:root {
  --bs-modal-duration: 300ms;
  --bs-modal-ease: ease-out;
  --bs-modal-backdrop-blur: 12px;
  --bs-modal-backdrop-saturate: 120%;
}

/* Frosted glass backdrop — BS .popup-holder-bc parity
   BS uses background:rgba(0,0,0,.6) directly (not opacity property on Bootstrap default #000)
   We override Bootstrap default .modal-backdrop background to match BS alpha.
*/
.modal-backdrop.fade {
  background-color: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity var(--bs-modal-duration) var(--bs-modal-ease);
  -webkit-backdrop-filter: blur(var(--bs-modal-backdrop-blur)) saturate(var(--bs-modal-backdrop-saturate));
  backdrop-filter: blur(var(--bs-modal-backdrop-blur)) saturate(var(--bs-modal-backdrop-saturate));
}
.modal-backdrop.fade.show,
.modal-backdrop.show {
  opacity: 1; /* BS bg already at 60% alpha; opacity:1 reveals full backdrop */
}

/* Dialog slide-up + scale — BS popupSlideIn parity
   from { opacity:0; scale:.95; translate:0 20px }
   to   { opacity:1; scale:1; translate:0 0 }
   .3s ease-out
*/
.modal.fade .modal-dialog {
  transform: translate3d(0, 20px, 0) scale(0.95);
  opacity: 0;
  transition:
    transform var(--bs-modal-duration) var(--bs-modal-ease),
    opacity var(--bs-modal-duration) var(--bs-modal-ease);
  will-change: transform, opacity;
}
.modal.fade.show .modal-dialog {
  transform: translate3d(0, 0, 0) scale(1);
  opacity: 1;
}

/* Auth modals (login + register) — BS popupSlideIn linear (NO bounce overshoot)
   ITER 285 D5: removed `0% → 60% overshoot 1.005 → 100%` frame, BS-paralel uses straight from→to
*/
.modal#login2.fade.show .modal-dialog,
.modal#registerModal.fade.show .modal-dialog {
  animation: bsPopupSlideIn var(--bs-modal-duration) var(--bs-modal-ease);
}

@keyframes bsPopupSlideIn {
  from {
    opacity: 0;
    transform: translate3d(0, 20px, 0) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

/* Closing — symmetric */
.modal.fade.is-closing .modal-dialog {
  transform: translate3d(0, 20px, 0) scale(0.95);
  opacity: 0;
}

/* ITER 285 D7: mobile @media full bottom-sheet override REMOVED
   BS popupSlideIn is universal 20px slide on all viewports.
   If MR-operator wants bottom-sheet feel as a deliberate divergence, register in AI_USER_OVERRIDES.md.
*/

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .modal-backdrop.fade,
  .modal.fade .modal-dialog {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
  .modal.fade.show .modal-dialog,
  .modal#login2.fade.show .modal-dialog,
  .modal#registerModal.fade.show .modal-dialog {
    transform: none !important;
    opacity: 1;
  }
}

/* Scroll-locked body class — iOS Safari + Instagram WebView için güçlendirilmiş
   ITER 616.2 (2026-05-21): position:fixed + overscroll-behavior + touch-action
   Astro client transition'lar arası state korunsun diye !important */
body.scroll-locked,
html:has(body.scroll-locked) {
  overflow: hidden !important;
  touch-action: none !important;
  overscroll-behavior: none !important;
  -webkit-overflow-scrolling: auto !important;
}
body.scroll-locked {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
}
/* Drawer overlay touch-action geri ver (drawer içi scroll çalışsın) */
body.scroll-locked .overlay-sliding-wrapper-bc,
body.scroll-locked .overlay-sliding-w-c-content-slider-bc,
body.scroll-locked .personal-details-card,
body.scroll-locked .profile-section-body {
  touch-action: pan-y !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: contain !important;
}

/* ITER 616.5 (2026-05-21): Drawer overlay tam viewport.
   Kısa içerik (Kişisel Detaylar gibi) durumunda drawer container alt boş kalıp
   arka plan görünüyordu + touch event drawer dışına iletiliyordu. */
body.scroll-locked .overlay-sliding-w-c-content-slider-bc {
  /* 2026-05-24 SCROLL FIX: eski min-height:100vh/100dvh slider'ı viewport boyuna (594)
     zorluyordu → drawer görünür alanından (545=100dvh-header) UZUN içerikte (info/deposit)
     iç scroll KIRILIYORDU (alt kısım kırpılıp erişilemiyordu = "scroll kilitli"). Slider
     display:flex/column olduğundan min-height:auto da height:100%'i eziyordu. min-height:0:
     slider height:100% = drawer alanı (545) çözülür → KISA içerikte background ile dolu
     (gap yok → ITER 616.5 amacı + ITER 616.6 backdrop ile korunur), UZUN içerikte
     overflow-y:auto SCROLL. Canlı doğrulandı: 545 clientH / 594 scrollH / scrollable. */
  min-height: 0 !important;
  background-color: #0a0a0a !important;
}

/* ITER 616.6 (2026-05-21): Full-viewport backdrop layer SADECE PROFILE DRAWER.
   ITER 616.7 (revize): selector `body.scroll-locked` → `body.profile-drawer-open`.
   `.scroll-locked` MENU drawer + login modal + diğer modal'larda da set ediliyor,
   bu yüzden selector çok genelidi → MENU drawer üst yarısı siyah oluyordu.
   `.profile-drawer-open` SADECE ITER 616 syncer tarafından ?profile=open
   query'sinde ekleniyor → profile drawer'a özel. */
body.profile-drawer-open::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background-color: #0a0a0a;
  z-index: 968; /* drawer container z-index 971'in hemen altı */
  pointer-events: auto; /* touch event'leri yut, arka plana iletme */
  touch-action: none;
}

/* ITER 616.9 (2026-05-21): Drawer açıkken MR mobileHeader GÖRÜNÜR kalsın.
   Önceki CSS rule (profile-drawer-root.css line 2072) drawer açıkken header'ı
   display:none ile gizliyordu (BS-paralel kural #158). Kullanıcı talimati:
   "üstte header olacak". Specificity yüksek selector (html.mobile-root body...)
   ile override + z-index 9999 + display:flex restore.
   Aynı zamanda backdrop'u header'ın ALTINDAN başlat → header görünür alanda. */
html.mobile-root body.mobile-site.profile-drawer-open header.mobileHeader,
html.mobile-root body.mobile-site.profile-drawer-open .layout-header-holder-bc,
body.profile-drawer-open .mobileHeader,
body.profile-drawer-open .layout-header-holder-bc {
  display: flex !important;
  visibility: visible !important;
  z-index: 9999 !important;
}
/* Backdrop header'ın altından başlasın (top: 117px = status-bar 68 + header 49) */
body.profile-drawer-open::before {
  top: 117px !important;
  height: calc(100vh - 117px) !important;
  height: calc(100dvh - 117px) !important;
}

/* ITER 628 (2026-05-21): ITER 627 GPU rules REVERT.
   transform:translateZ(0) + contain:layout paint AGRESIF GPU memory pressure
   yaratiyordu -> 30 saniye scroll sonrasi kasma (ITER 504 yorumunda da bu
   sebeple kaldirilmisti).

   Siyah flash icin SADECE background-color + bg-image fallback yeterli.
   GPU layer rules yok. Bunu slot-tile-bs-zero.css'te ITER 627.1 zaten halletti.
   Burada ekstra rule YOK (slot-tile-bs-zero source-of-truth). */
