/* ==========================================================================
   BT Notify — Bizim Topraklar merkezi bildirim sistemi (v1)
   Toast (başarılı / hata / uyarı / bilgi / yükleniyor) + onay penceresi
   ========================================================================== */

:root {
  --btn-success: #22c55e;
  --btn-error:   #ef4444;
  --btn-warning: #f59e0b;
  --btn-info:    #3b82f6;
  --btn-loading: #8b5cf6;

  --btn-bg:      rgba(22, 24, 33, .90);
  --btn-bg-solid:#161821;
  --btn-fg:      #f4f5f8;
  --btn-muted:   rgba(244, 245, 248, .68);
  --btn-border:  rgba(255, 255, 255, .10);
  --btn-shadow:  0 18px 44px -12px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .25);
  --btn-track:   rgba(255, 255, 255, .08);
  --btn-close-h: rgba(255, 255, 255, .12);
}

html.light, html[data-bs-theme="light"], html[data-theme="light"] {
  --btn-bg:      rgba(255, 255, 255, .94);
  --btn-bg-solid:#ffffff;
  --btn-fg:      #1b1d27;
  --btn-muted:   rgba(27, 29, 39, .66);
  --btn-border:  rgba(20, 24, 40, .09);
  --btn-shadow:  0 18px 44px -14px rgba(25, 30, 60, .30), 0 2px 8px rgba(25, 30, 60, .10);
  --btn-track:   rgba(20, 24, 40, .07);
  --btn-close-h: rgba(20, 24, 40, .08);
}
html.dark, html[data-bs-theme="dark"], html[data-theme="dark"] {
  --btn-bg:      rgba(22, 24, 33, .90);
  --btn-bg-solid:#161821;
  --btn-fg:      #f4f5f8;
  --btn-muted:   rgba(244, 245, 248, .68);
  --btn-border:  rgba(255, 255, 255, .10);
  --btn-shadow:  0 18px 44px -12px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .25);
  --btn-track:   rgba(255, 255, 255, .08);
  --btn-close-h: rgba(255, 255, 255, .12);
}

/* ------------------------------------------------------------------ KAP */
.bt-nf-wrap {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  right: 16px;
  width: min(392px, calc(100vw - 24px));
  z-index: 2147483000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  font-family: inherit;
}
.bt-nf-wrap.bt-pos-bottom { top: auto; bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); flex-direction: column-reverse; }

/* ------------------------------------------------------------------ KART */
.bt-nf {
  --c: var(--btn-info);
  position: relative;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: start;
  gap: 12px;
  padding: 14px 12px 17px 14px;
  border-radius: 16px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-border);
  box-shadow: var(--btn-shadow);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  overflow: hidden;
  pointer-events: auto;
  touch-action: pan-y;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  opacity: 0;
  transform: translateX(28px) scale(.96);
  transition: opacity .28s ease, transform .34s cubic-bezier(.2, .9, .25, 1.15), margin .3s ease, max-height .3s ease;
  will-change: transform, opacity;
}
.bt-nf.bt-in  { opacity: 1; transform: none; }
.bt-nf.bt-out { opacity: 0; transform: translateX(34px) scale(.95); }
.bt-nf.bt-dragging { transition: none; }

/* sol vurgu şeridi + hafif renkli parıltı */
.bt-nf::before {
  content: "";
  position: absolute; inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--c), color-mix(in srgb, var(--c) 55%, #fff));
}
.bt-nf::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--c) 16%, transparent), transparent 62%);
  pointer-events: none;
}

.bt-nf-success { --c: var(--btn-success); }
.bt-nf-error   { --c: var(--btn-error); }
.bt-nf-warning { --c: var(--btn-warning); }
.bt-nf-info    { --c: var(--btn-info); }
.bt-nf-loading { --c: var(--btn-loading); }

/* ------------------------------------------------------------------ İKON */
.bt-nf-ico {
  position: relative; z-index: 1;
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid; place-items: center;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 17%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 28%, transparent);
}
.bt-nf-ico svg { width: 22px; height: 22px; display: block; overflow: visible; }
.bt-nf-ico svg * { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.bt-nf-success .bt-ck   { stroke-dasharray: 26; stroke-dashoffset: 26; animation: btnf-draw .5s .12s ease forwards; }
.bt-nf-success .bt-ring { stroke-dasharray: 64; stroke-dashoffset: 64; animation: btnf-draw .6s ease forwards; }
.bt-nf-error   .bt-ico-svg { animation: btnf-shake .5s .1s ease both; }
.bt-nf-warning .bt-ico-svg { animation: btnf-pulse 1.6s .2s ease-in-out 2; transform-origin: 50% 60%; }
.bt-nf-info    .bt-ico-svg { animation: btnf-pop .45s .05s cubic-bezier(.2, 1.4, .4, 1) both; }
.bt-nf-loading .bt-ico-svg { animation: btnf-spin .9s linear infinite; }

@keyframes btnf-draw  { to { stroke-dashoffset: 0; } }
@keyframes btnf-shake { 0%,100% { transform: none; } 20% { transform: translateX(-3px) rotate(-6deg); } 40% { transform: translateX(3px) rotate(6deg); } 60% { transform: translateX(-2px); } 80% { transform: translateX(2px); } }
@keyframes btnf-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.14); } }
@keyframes btnf-pop   { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes btnf-spin  { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ METİN */
.bt-nf-body { position: relative; z-index: 1; min-width: 0; padding-top: 1px; }
.bt-nf-title {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 14.5px; line-height: 1.25; letter-spacing: .1px;
  margin: 0 0 2px;
}
.bt-nf-count {
  font-size: 11px; font-weight: 700; line-height: 1;
  padding: 3px 7px; border-radius: 999px;
  background: color-mix(in srgb, var(--c) 22%, transparent); color: var(--c);
}
.bt-nf-msg {
  font-size: 13.5px; line-height: 1.45; color: var(--btn-muted);
  word-break: break-word; overflow-wrap: anywhere;
  user-select: text; -webkit-user-select: text;
}
.bt-nf-msg ul, .bt-nf-msg ol { margin: 4px 0 0; padding-left: 18px; }
.bt-nf-msg li { margin: 1px 0; }
.bt-nf-msg a { color: var(--c); text-decoration: underline; text-underline-offset: 2px; }
.bt-nf-msg code { font-size: 12px; padding: 1px 5px; border-radius: 5px; background: var(--btn-track); color: var(--btn-fg); }
.bt-nf-act { margin-top: 9px; display: flex; gap: 8px; flex-wrap: wrap; }
.bt-nf-act button {
  appearance: none; border: 0; cursor: pointer;
  font: inherit; font-size: 12.5px; font-weight: 700;
  padding: 6px 12px; border-radius: 9px;
  color: #fff; background: var(--c);
  transition: transform .15s ease, filter .15s ease;
}
.bt-nf-act button:hover  { filter: brightness(1.08); transform: translateY(-1px); }
.bt-nf-act button.bt-ghost { color: var(--btn-fg); background: var(--btn-track); }

.bt-nf-x {
  position: relative; z-index: 1;
  appearance: none; border: 0; background: transparent; cursor: pointer;
  width: 28px; height: 28px; border-radius: 9px;
  display: grid; place-items: center;
  color: var(--btn-muted);
  transition: background .15s ease, color .15s ease;
}
.bt-nf-x:hover { background: var(--btn-close-h); color: var(--btn-fg); }
.bt-nf-x svg { width: 14px; height: 14px; }
.bt-nf-x svg * { stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; fill: none; }

/* ------------------------------------------------------------------ SÜRE ÇUBUĞU */
.bt-nf-bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px; z-index: 2;
  background: var(--btn-track);
}
.bt-nf-bar i {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 60%, #fff));
  transform-origin: left center;
  animation: btnf-bar var(--d, 5000ms) linear forwards;
}
.bt-nf.bt-paused .bt-nf-bar i { animation-play-state: paused; }
.bt-nf.bt-sticky .bt-nf-bar { display: none; }
@keyframes btnf-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ------------------------------------------------------------------ ONAY PENCERESİ */
.bt-cf-back {
  position: fixed; inset: 0; z-index: 2147483100;
  display: grid; place-items: center; padding: 18px;
  background: rgba(8, 10, 18, .55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .2s ease;
}
.bt-cf-back.bt-in { opacity: 1; }
.bt-cf {
  --c: var(--btn-info);
  width: min(420px, 100%);
  padding: 26px 24px 20px;
  border-radius: 22px;
  background: var(--btn-bg-solid);
  color: var(--btn-fg);
  border: 1px solid var(--btn-border);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .65);
  text-align: center;
  transform: translateY(14px) scale(.94);
  transition: transform .3s cubic-bezier(.2, 1.1, .3, 1.1);
  font-family: inherit;
}
.bt-cf-back.bt-in .bt-cf { transform: none; }
.bt-cf.bt-danger  { --c: var(--btn-error); }
.bt-cf.bt-warning { --c: var(--btn-warning); }
.bt-cf.bt-success { --c: var(--btn-success); }
.bt-cf-ico {
  width: 62px; height: 62px; margin: 0 auto 14px; border-radius: 20px;
  display: grid; place-items: center; color: var(--c);
  background: color-mix(in srgb, var(--c) 16%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent);
}
.bt-cf-ico svg { width: 30px; height: 30px; }
.bt-cf-ico svg * { fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.bt-cf h3 { margin: 0 0 6px; font-size: 18px; font-weight: 800; color: var(--btn-fg); }
.bt-cf p  { margin: 0 0 20px; font-size: 14px; line-height: 1.5; color: var(--btn-muted); white-space: pre-line; }
.bt-cf-btns { display: flex; gap: 10px; }
.bt-cf-btns button {
  flex: 1; appearance: none; border: 0; cursor: pointer; font: inherit;
  font-size: 14px; font-weight: 700; padding: 11px 14px; border-radius: 12px;
  transition: transform .15s ease, filter .15s ease;
}
.bt-cf-btns button:hover { transform: translateY(-1px); filter: brightness(1.06); }
.bt-cf-btns button:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.bt-cf-no  { background: var(--btn-track); color: var(--btn-fg); }
.bt-cf-yes { background: var(--c); color: #fff; box-shadow: 0 8px 20px -8px var(--c); }

/* ------------------------------------------------------------------ MOBİL */
@media (max-width: 575.98px) {
  .bt-nf-wrap { left: 12px; right: 12px; width: auto; top: calc(env(safe-area-inset-top, 0px) + 10px); }
  .bt-nf { transform: translateY(-22px) scale(.97); padding: 12px 10px 15px 12px; grid-template-columns: 36px 1fr auto; gap: 10px; }
  .bt-nf.bt-out { transform: translateY(-22px) scale(.96); }
  .bt-nf-ico { width: 36px; height: 36px; border-radius: 11px; }
  .bt-nf-ico svg { width: 20px; height: 20px; }
  .bt-cf { padding: 22px 18px 16px; }
}

/* eski admin toastr kapsayıcısını gizle (yerine BT Notify kullanılıyor) */
#toast-container { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .bt-nf, .bt-cf, .bt-cf-back { transition: opacity .15s ease !important; transform: none !important; }
  .bt-nf-ico svg, .bt-nf-ico svg * { animation: none !important; stroke-dashoffset: 0 !important; }
}
