/* Bunn 101291.6 — Telegram/PWA shell finalization */

/* 1) Ana Merkez 101291.5 geometrisi korunur. */
body.personal-center-mode #view{padding-top:0!important;}

/* 2) Telegram normal sayfaları: Telegram'ın Kapat/… kontrolleri layout'un üstüne biner.
      Arka plan yukarı uzar; yalnız gerçek içerik görünmez bir güvenli alanın altından başlar. */
html.telegram-mobile.telegram-hosted body.premium-shell-active:not(.personal-center-mode):not(.bunn-video-mode) #view{
  padding-top:calc(max(var(--tg-safe-top,0px),var(--tg-content-safe-top,0px),var(--tg-controls-top,0px)) + 58px)!important;
}
html.telegram-mobile.telegram-hosted body.premium-shell-active:not(.personal-center-mode):not(.bunn-video-mode) .bunn-world-chrome{
  top:calc(max(var(--tg-safe-top,0px),var(--tg-content-safe-top,0px),var(--tg-controls-top,0px)) + 8px)!important;
}

/* 3) Immersive / Bunn Videoları: tam genişlik beyaz Bunn header yok.
      Geri + Bunn Home ekranı tüketmeyen floating cam kontrol olur. */
body.bunn-video-mode .bunn-world-chrome{
  position:fixed!important;
  z-index:80!important;
  top:calc(max(env(safe-area-inset-top,0px),var(--tg-safe-top,0px),var(--tg-content-safe-top,0px)) + 8px)!important;
  left:0!important;right:0!important;
  width:min(760px,100%)!important;
  height:44px!important;min-height:0!important;
  margin:0 auto!important;padding:0 12px!important;
  display:flex!important;align-items:center!important;justify-content:space-between!important;
  background:transparent!important;border:0!important;box-shadow:none!important;
  backdrop-filter:none!important;-webkit-backdrop-filter:none!important;
  pointer-events:none!important;
}
body.bunn-video-mode .bunn-world-title{display:none!important;}
body.bunn-video-mode .bunn-world-back,
body.bunn-video-mode .bunn-world-home{
  pointer-events:auto!important;
  width:42px!important;height:42px!important;min-width:42px!important;min-height:42px!important;
  padding:0!important;border-radius:50%!important;
  border:1px solid rgba(255,255,255,.20)!important;
  background:rgba(12,8,18,.48)!important;color:#fff!important;
  box-shadow:0 8px 24px rgba(0,0,0,.22)!important;
  backdrop-filter:blur(12px) saturate(1.18)!important;
  -webkit-backdrop-filter:blur(12px) saturate(1.18)!important;
}
body.bunn-video-mode .bunn-world-home span{color:#fff!important;}
body.bunn-video-mode #view,
body.bunn-video-mode .bunn-shorts-feed,
body.bunn-video-mode .bunn-short-card{
  padding-top:0!important;margin-top:0!important;
  height:var(--bunn-viewport-height,100dvh)!important;
  min-height:var(--bunn-viewport-height,100dvh)!important;
  max-height:var(--bunn-viewport-height,100dvh)!important;
}
body.bunn-video-mode .bunn-short-title{display:none!important;}
body.bunn-video-mode .bunn-short-chrome{
  top:calc(max(env(safe-area-inset-top,0px),var(--tg-safe-top,0px),var(--tg-content-safe-top,0px)) + 8px)!important;
  height:44px!important;
}
body.bunn-video-mode .bunn-short-tools{top:0!important;right:14px!important;}

/* Telegram immersive: kendi üst kontrollerinin hemen altına Bunn floating araçları. */
html.telegram-mobile.telegram-hosted body.bunn-video-mode .bunn-world-chrome{
  top:calc(max(var(--tg-safe-top,0px),var(--tg-content-safe-top,0px),var(--tg-controls-top,0px)) + 58px)!important;
}
html.telegram-mobile.telegram-hosted body.bunn-video-mode .bunn-short-chrome{
  top:calc(max(var(--tg-safe-top,0px),var(--tg-content-safe-top,0px),var(--tg-controls-top,0px)) + 58px)!important;
}

/* 4) Alt aksiyonlar viewport içinde kalır. */
body.bunn-video-mode .bunn-short-actions{
  bottom:max(126px,calc(env(safe-area-inset-bottom,0px) + 108px))!important;
}
body.bunn-video-mode .bunn-short-copy{
  bottom:max(14px,env(safe-area-inset-bottom,0px))!important;
}

/* 5) Eski header rezervleri premium shell'de tekrar devreye giremez. */
html.telegram-fullscreen body.premium-shell-active.personal-center-mode #app,
html.telegram-fullscreen body.premium-shell-active.bunn-video-mode #app{padding-bottom:0!important;}
html.telegram-fullscreen body.premium-shell-active.personal-center-mode .app-nav,
html.telegram-fullscreen body.premium-shell-active.bunn-video-mode .app-nav{display:none!important;}

@media(prefers-reduced-motion:reduce){
  body.bunn-video-mode .bunn-world-back,body.bunn-video-mode .bunn-world-home{transition:none!important;}
}
