/* =========================================================
   QuietAsk Toasts (HK) – Title only + Dark Mode (Bootstrap)
   Dark mode triggers when any parent has: data-bs-theme="dark"
========================================================= */

/* Root container */
#hk-toast-root{
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

/* Position containers */
.hk-toast-container{
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  pointer-events: none;
  max-width: min(420px, calc(100vw - 24px));
}

.hk-top-right{ top: 0; right: 0; align-items: flex-end; }
.hk-top-left{ top: 0; left: 0; align-items: flex-start; }
.hk-bottom-right{ bottom: 0; right: 0; align-items: flex-end; }
.hk-bottom-left{ bottom: 0; left: 0; align-items: flex-start; }
.hk-bottom-center{ bottom: 0; left: 50%; transform: translateX(-50%); align-items: center; }
.hk-top-center{ top: 0; left: 50%; transform: translateX(-50%); align-items: center; }

/* Toast */
.hk-toast{
  pointer-events: auto;
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(17,24,39,.12);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(17,24,39,.10);
  padding: 12px 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  position: relative;
  overflow: hidden;

  opacity: 0;
  transform: translateY(-6px) scale(.98);
  transition: opacity .18s ease, transform .18s ease;
}

.hk-toast.is-in{
  opacity: 1;
  transform: translateY(0) scale(1);
}

.hk-toast.is-out{
  opacity: 0;
  transform: translateY(-6px) scale(.98);
}

/* Icon */
.hk-toast-ico{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(17,24,39,.10);
}
.hk-toast-ico i{ font-size: 18px; }

/* Body */
.hk-toast-body{ flex: 1; min-width: 0; }

/* Title only */
.hk-toast-title{
  font-weight: 700;
  font-size: .92rem;
  line-height: 1.25;
  margin: 0;
  color: #0f172a;
  word-break: break-word;
}

/* message disabled */
.hk-toast-msg{ display:none !important; }

/* Close button */
.hk-toast-close{
  border: 0;
  background: transparent;
  padding: 4px;
  margin-left: 4px;
  border-radius: 10px;
  cursor: pointer;
  color: #64748b;
}
.hk-toast-close:hover{
  background: rgba(15,23,42,.06);
}

/* Progress */
.hk-toast-progress{
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  opacity: .85;
  transform-origin: left;
  animation: hkToastProgress var(--hk-toast-duration, 3500ms) linear forwards;
}

@keyframes hkToastProgress{
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* Types (light) */
.hk-success .hk-toast-ico{ background: rgba(16,185,129,.12); }
.hk-success .hk-toast-progress{ background: rgba(16,185,129,.75); }

.hk-error .hk-toast-ico{ background: rgba(239,68,68,.12); }
.hk-error .hk-toast-progress{ background: rgba(239,68,68,.75); }

.hk-warning .hk-toast-ico{ background: rgba(245,158,11,.14); }
.hk-warning .hk-toast-progress{ background: rgba(245,158,11,.78); }

.hk-info .hk-toast-ico{ background: rgba(59,130,246,.12); }
.hk-info .hk-toast-progress{ background: rgba(59,130,246,.75); }

.hk-default .hk-toast-ico{ background: rgba(100,116,139,.12); }
.hk-default .hk-toast-progress{ background: rgba(100,116,139,.70); }

/* Mobile spacing */
@media (max-width: 480px){
  .hk-toast-container{ padding: 10px; }
  .hk-toast{ border-radius: 12px; }
}

/* =========================================================
   Dark mode (Bootstrap 5.3): data-bs-theme="dark"
========================================================= */
[data-bs-theme="dark"] .hk-toast{
  border: 1px solid rgba(148,163,184,.18);
  background: rgba(15,23,42,.78); /* slate-900-ish */
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}

[data-bs-theme="dark"] .hk-toast-title{
  color: rgba(248,250,252,.92);
}

[data-bs-theme="dark"] .hk-toast-close{
  color: rgba(203,213,225,.9);
}
[data-bs-theme="dark"] .hk-toast-close:hover{
  background: rgba(148,163,184,.12);
}

[data-bs-theme="dark"] .hk-toast-ico{
  border: 1px solid rgba(148,163,184,.18);
}

/* Types (dark) */
[data-bs-theme="dark"] .hk-success .hk-toast-ico{ background: rgba(16,185,129,.18); }
[data-bs-theme="dark"] .hk-success .hk-toast-progress{ background: rgba(16,185,129,.80); }

[data-bs-theme="dark"] .hk-error .hk-toast-ico{ background: rgba(239,68,68,.18); }
[data-bs-theme="dark"] .hk-error .hk-toast-progress{ background: rgba(239,68,68,.80); }

[data-bs-theme="dark"] .hk-warning .hk-toast-ico{ background: rgba(245,158,11,.20); }
[data-bs-theme="dark"] .hk-warning .hk-toast-progress{ background: rgba(245,158,11,.82); }

[data-bs-theme="dark"] .hk-info .hk-toast-ico{ background: rgba(59,130,246,.18); }
[data-bs-theme="dark"] .hk-info .hk-toast-progress{ background: rgba(59,130,246,.80); }

[data-bs-theme="dark"] .hk-default .hk-toast-ico{ background: rgba(148,163,184,.14); }
[data-bs-theme="dark"] .hk-default .hk-toast-progress{ background: rgba(148,163,184,.70); }
