/* =========================================================
   EN BABA ORGANİZASYON — BİLDİRİM / GECE MODU KORUMA KATMANI
   - Samsung Internet, Android Chrome ve iPhone Safari
   - Sistem gece modu / manuel gece modu
   - Toast, fiyat güncelliği, rezervasyon ve PWA kartları
========================================================= */

:root{
  --enb-notify-neutral-bg: rgba(15,23,42,.97);
  --enb-notify-neutral-ink: #f8fafc;
  --enb-notify-muted: #cbd5e1;
  --enb-notify-border: rgba(255,255,255,.20);
  --enb-notify-shadow: 0 20px 56px rgba(2,6,23,.30), 0 1px 0 rgba(255,255,255,.12) inset;
  --enb-notify-error-bg: #991b1b;
  --enb-notify-success-bg: #166534;
  --enb-notify-warning-bg: #92400e;
  --enb-notify-info-bg: #1e3a8a;
}

/*
 * Telefonun "zorunlu karartma" algoritmasının özel bildirimleri
 * ikinci kez ters çevirmesini engeller. Bu alanlar renklerini
 * kendileri yönettiği için renk şeması bilinçli olarak sabitlenir.
 */
html body :where(
  .enb-toast,
  .baba-toast,
  .corn-toast,
  .bh-toast,
  .enb-center-alert,
  .enb-hizmetler-toast,
  .enb-price-smart__pill,
  .enb-res-policy-float__btn,
  .enb-pwa-card,
  .enb-inline-alert,
  .kd-mail-feedback,
  .gate-error
){
  forced-color-adjust: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  text-shadow: none;
  isolation: isolate;
}

/* Koyu zeminli kısa bildirimler her temada yüksek kontrastlıdır. */
html body :where(
  .enb-toast,
  .baba-toast,
  .corn-toast,
  .bh-toast,
  .enb-center-alert,
  .enb-hizmetler-toast
){
  color-scheme: dark;
  color: var(--enb-notify-neutral-ink) !important;
  border: 1px solid var(--enb-notify-border) !important;
  box-shadow: var(--enb-notify-shadow) !important;
}

html body :where(
  .enb-toast:not(.enb-toast--error):not(.enb-toast--success):not(.enb-toast--warning),
  .baba-toast:not(.baba-toast-error):not(.baba-toast-success),
  .corn-toast,
  .bh-toast:not(.bh-toast--error):not(.bh-toast--success),
  .enb-hizmetler-toast
){
  background-color: var(--enb-notify-neutral-bg) !important;
  background-image: none !important;
}

html body :where(
  .enb-toast--error,
  .baba-toast-error,
  .bh-toast--error,
  .enb-center-alert,
  [class*="toast--danger"],
  [class*="toast-error"]
){
  background-color: var(--enb-notify-error-bg) !important;
  background-image: none !important;
  color: #fff !important;
}

html body :where(
  .enb-toast--success,
  .baba-toast-success,
  .bh-toast--success,
  [class*="toast-success"]
){
  background-color: var(--enb-notify-success-bg) !important;
  background-image: none !important;
  color: #fff !important;
}

html body :where(
  .enb-toast--warning,
  [class*="toast--warn"],
  [class*="toast-warning"]
){
  background-color: var(--enb-notify-warning-bg) !important;
  background-image: none !important;
  color: #fff !important;
}

html body :where(
  .enb-toast--info,
  [class*="toast--info"]
){
  background-color: var(--enb-notify-info-bg) !important;
  background-image: none !important;
  color: #fff !important;
}

/* Kapatma düğmesi telefonun gece modu tarafından görünmez yapılmasın. */
html body :where(.enb-toast__close, .enb-pwa-card__close){
  color-scheme: dark;
  color: #f8fafc !important;
  background: rgba(255,255,255,.12) !important;
  border: 1px solid rgba(255,255,255,.16) !important;
}

html body :where(.enb-toast__close, .enb-pwa-card__close):focus-visible{
  outline: 3px solid rgba(165,180,252,.72) !important;
  outline-offset: 2px;
}

/* Açık temadaki büyük bilgi kartları açık renk şemasını korur. */
html[data-theme="light"] body :where(
  .enb-price-smart__pill,
  .enb-res-policy-float__btn,
  .enb-pwa-card
){
  color-scheme: light;
}

/* Gece modunda bilgi kartları zemine karışmadan koyu yüzeye geçer. */
html[data-theme="dark"] body :where(
  .enb-price-smart__pill,
  .enb-res-policy-float__btn,
  .enb-pwa-card
){
  color-scheme: dark;
  color: #f8fafc !important;
  background-color: rgba(17,24,39,.97) !important;
  border-color: rgba(148,163,184,.34) !important;
  box-shadow: 0 22px 60px rgba(0,0,0,.52), 0 1px 0 rgba(255,255,255,.08) inset !important;
}

html[data-theme="dark"] body .enb-price-smart__pill{
  background-image:
    radial-gradient(circle at 12% 0%, rgba(16,185,129,.18), transparent 36%),
    linear-gradient(135deg, rgba(6,78,59,.34), rgba(17,24,39,.98) 56%, rgba(15,23,42,.98)) !important;
}

html[data-theme="dark"] body .enb-res-policy-float__btn{
  background-image:
    radial-gradient(circle at 15% 0%, rgba(251,113,133,.18), transparent 36%),
    linear-gradient(135deg, rgba(76,5,25,.42), rgba(17,24,39,.98) 58%, rgba(15,23,42,.98)) !important;
}

html[data-theme="dark"] body .enb-pwa-card{
  background-image: linear-gradient(145deg, rgba(17,24,39,.98), rgba(15,23,42,.98)) !important;
}

html[data-theme="dark"] body :where(
  .enb-price-smart__pill,
  .enb-res-policy-float__btn,
  .enb-pwa-card
) :where(p, small, span:not([class*="icon"]), .enb-pwa-card__text, .enb-pwa-card__steps){
  color: #cbd5e1;
}

html[data-theme="dark"] body :where(
  .enb-price-smart__pill,
  .enb-res-policy-float__btn,
  .enb-pwa-card
) :where(strong, b, .enb-pwa-card__title){
  color: #f8fafc !important;
}

/* Sistem karanlık olup JS henüz temayı yazmadan önce oluşabilecek ilk kare. */
@media (prefers-color-scheme: dark){
  html:not([data-theme="light"]) body :where(
    .enb-price-smart__pill,
    .enb-res-policy-float__btn,
    .enb-pwa-card
  ){
    color-scheme: dark;
  }
}

/* Küçük ekran: alt navigasyon ve safe-area ile çakışma önlenir. */
@media (max-width: 767.98px){
  html body :where(.bh-toast, #eboToast.enb-hizmetler-toast){
    bottom: calc(var(--eb-mobile-nav-h, 56px) + env(safe-area-inset-bottom, 0px) + 14px) !important;
  }

  html body :where(.enb-toast, .baba-toast, .corn-toast, .bh-toast, .enb-center-alert, .enb-hizmetler-toast){
    max-width: min(340px, calc(100vw - 28px)) !important;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  html body :where(.enb-toast, .baba-toast){
    white-space: normal !important;
    text-overflow: clip !important;
    text-align: center;
    line-height: 1.4;
  }
}

@media (forced-colors: active){
  html body :where(
    .enb-toast,
    .baba-toast,
    .corn-toast,
    .bh-toast,
    .enb-center-alert,
    .enb-hizmetler-toast,
    .enb-price-smart__pill,
    .enb-res-policy-float__btn,
    .enb-pwa-card
  ){
    forced-color-adjust: auto;
    border: 2px solid CanvasText !important;
  }
}
