/* EMDATE V73 — Hero countdown + Canlı Destek yerleşim düzeltmesi
   2026-08-24
   Amaç:
   1) Ana sayfadaki kongre geri sayımının aksiyon butonlarına taşmasını engellemek.
   2) Canlı destek FAB/panel/nudge katmanını viewport ve mobil hızlı işlem çubuğuna göre güvenli yerleştirmek. */

/* ============================================================
   1. ANA SAYFA — KONGRE KARTI / GERİ SAYIM
   ============================================================ */
.home-congress-card{
  display:flex;
  flex-direction:column;
  min-width:0;
}
.home-congress-card > *{min-width:0}

/* Genel .countdown dekorasyonu bu özel kartta kullanılmamalı.
   Önceki ::before inset:-18px/-22px ile aksiyon butonlarının arkasına taşıyordu. */
.home-congress-card .home-countdown::before{
  content:none!important;
  display:none!important;
}
.home-congress-card .home-countdown{
  position:relative!important;
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  width:100%!important;
  max-width:100%!important;
  gap:10px!important;
  margin:18px 0 0!important;
  padding:18px 0 0!important;
  border-top:1px solid var(--border)!important;
  background:transparent!important;
  transform:none!important;
  overflow:visible!important;
  isolation:isolate;
}
.home-congress-card .home-countdown .ci{
  min-width:0!important;
  width:100%!important;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  justify-content:flex-start;
  text-align:center;
}
.home-congress-card .home-countdown .cn{
  display:grid!important;
  place-items:center;
  width:100%!important;
  min-width:0!important;
  min-height:62px;
  padding:9px 4px!important;
  border-radius:15px!important;
  font-size:clamp(1.55rem,2.45vw,2.2rem)!important;
  line-height:1!important;
  white-space:nowrap!important;
  background:linear-gradient(180deg,rgba(255,255,255,.095),rgba(255,255,255,.035))!important;
  border:1px solid rgba(232,238,248,.14)!important;
  box-shadow:0 12px 28px rgba(0,0,0,.16)!important;
}
.home-congress-card .home-countdown .cl{
  display:block!important;
  width:100%;
  margin-top:7px!important;
  font-size:clamp(.52rem,.62vw,.60rem)!important;
  line-height:1.2!important;
  letter-spacing:.7px!important;
  white-space:nowrap!important;
}
.home-congress-actions{flex:0 0 auto;position:relative;z-index:2}
.home-congress-actions + .home-countdown{z-index:1}

html[data-theme="light"] .home-congress-card .home-countdown .cn,
html[data-theme="clinical"] .home-congress-card .home-countdown .cn{
  background:linear-gradient(180deg,rgba(255,255,255,.94),rgba(236,242,249,.78))!important;
  border-color:rgba(20,32,51,.12)!important;
  box-shadow:0 10px 24px rgba(20,32,51,.08)!important;
}

@media(max-width:1180px){
  .home-congress-card .home-countdown{gap:9px!important}
  .home-congress-card .home-countdown .cn{min-height:58px;font-size:clamp(1.45rem,3.3vw,2rem)!important}
}
@media(max-width:760px){
  .home-congress-card .home-countdown{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:7px!important;
    margin-top:16px!important;
    padding-top:16px!important;
  }
  .home-congress-card .home-countdown .cn{min-height:54px;padding:8px 3px!important;font-size:clamp(1.25rem,6vw,1.8rem)!important}
  .home-congress-card .home-countdown .cl{font-size:.50rem!important;letter-spacing:.45px!important}
}
@media(max-width:480px){
  .home-congress-card .home-countdown{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:10px!important;
  }
  .home-congress-card .home-countdown .cn{min-height:56px;font-size:1.65rem!important}
  .home-congress-card .home-countdown .cl{font-size:.54rem!important}
}

/* ============================================================
   2. CANLI DESTEK — VIEWPORT / KATMAN / MOBİL GÜVENLİ ALAN
   ============================================================ */
.em-ai-v51{
  right:max(18px,env(safe-area-inset-right))!important;
  bottom:max(18px,env(safe-area-inset-bottom))!important;
  z-index:1190!important; /* nav üstü; mobil menü/duyuru/modal altı */
  max-width:calc(100vw - 24px)!important;
  isolation:isolate;
}
.em-ai-v51 .em-ai-fab{
  max-width:min(212px,calc(100vw - 36px))!important;
}
.em-ai-v51 .em-ai-panel{
  right:0!important;
  bottom:74px!important;
  width:min(420px,calc(100vw - 36px))!important;
  max-width:calc(100vw - 36px)!important;
  height:min(680px,calc(100dvh - 118px))!important;
  max-height:calc(100dvh - 118px)!important;
  min-height:0!important;
  margin:0!important;
  overflow:hidden!important;
  transform-origin:right bottom;
}
.em-ai-v51 .em-ai-view,
.em-ai-v51 .em-ai-view.active{
  min-height:0!important;
  max-height:100%;
}
.em-ai-v51 .em-ai-messages{
  min-height:0!important;
  overflow-y:auto!important;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}
.em-ai-v51 .em-ai-contact-form{
  min-height:0!important;
  overflow-y:auto!important;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}
.em-ai-v51 .em-ai-nudge{
  right:0!important;
  bottom:74px!important;
  width:min(316px,calc(100vw - 36px))!important;
  max-width:calc(100vw - 36px)!important;
}

/* Ana sayfada <=980px iken sabit hızlı işlem çubuğu bulunuyor.
   Canlı destek bunun ÜSTÜNDE konumlanır; çakışmaz. */
@media(max-width:980px){
  body.em-home-page .em-ai-v51{
    right:14px!important;
    bottom:calc(92px + env(safe-area-inset-bottom))!important;
  }
  body.em-home-page .em-ai-v51 .em-ai-panel{
    bottom:68px!important;
    width:min(420px,calc(100vw - 28px))!important;
    max-width:calc(100vw - 28px)!important;
    height:min(650px,calc(100dvh - 186px))!important;
    max-height:calc(100dvh - 186px)!important;
  }
  body.em-home-page .em-ai-v51 .em-ai-nudge{
    bottom:68px!important;
    width:min(316px,calc(100vw - 28px))!important;
  }
}

@media(max-width:760px){
  .em-ai-v51{
    right:12px!important;
    bottom:calc(14px + env(safe-area-inset-bottom))!important;
  }
  .em-ai-v51 .em-ai-fab{
    min-width:58px!important;
    width:58px!important;
    height:58px!important;
    padding:7px!important;
  }
  .em-ai-v51 .em-ai-panel{
    right:0!important;
    bottom:68px!important;
    width:calc(100vw - 24px)!important;
    max-width:calc(100vw - 24px)!important;
    height:min(650px,calc(100dvh - 108px))!important;
    max-height:calc(100dvh - 108px)!important;
    border-radius:21px!important;
  }
  .em-ai-v51 .em-ai-nudge{
    bottom:68px!important;
    width:min(310px,calc(100vw - 24px))!important;
  }
  body.em-home-page .em-ai-v51{
    bottom:calc(90px + env(safe-area-inset-bottom))!important;
  }
  body.em-home-page .em-ai-v51 .em-ai-panel{
    bottom:68px!important;
    height:min(620px,calc(100dvh - 176px))!important;
    max-height:calc(100dvh - 176px)!important;
  }
}

@media(max-width:430px){
  body.em-home-page .em-ai-v51{bottom:calc(88px + env(safe-area-inset-bottom))!important}
  .em-ai-v51 .em-ai-panel{border-radius:18px!important}
  body.em-home-page .em-ai-v51 .em-ai-panel{
    height:min(590px,calc(100dvh - 172px))!important;
    max-height:calc(100dvh - 172px)!important;
  }
  .em-ai-v51 .em-ai-head{min-height:72px!important;padding-top:11px!important;padding-bottom:11px!important}
  .em-ai-v51 .em-ai-messages{padding-top:13px!important}
}

/* Bir modal veya mobil menü açıkken destek widget'ı onların üzerine çıkmamalı. */
body:has(.popup-backdrop.open) .em-ai-v51,
body:has(.mobile-menu.open) .em-ai-v51{z-index:1090!important}
