/* Admin toast notifications — markup and behaviour in public/js/blogToast.js. */
.hk-toast-container {
  --hk-toast-bg: #ffffff;
  --hk-toast-text: #1f2937;
  --hk-toast-muted: #4b5563;
  --hk-toast-shadow: 0 10px 30px rgba(15, 23, 42, 0.16), 0 2px 6px rgba(15, 23, 42, 0.08);

  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: min(380px, calc(100vw - 2rem));
  pointer-events: none;
}

[data-theme="dark"] .hk-toast-container,
[data-bs-theme="dark"] .hk-toast-container {
  --hk-toast-bg: #1f2937;
  --hk-toast-text: #f3f4f6;
  --hk-toast-muted: #d1d5db;
  --hk-toast-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.hk-toast {
  --hk-accent: #16a34a;
  --hk-accent-soft: rgba(22, 163, 74, 0.14);

  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 0.875rem 1rem 1rem;
  overflow: hidden;
  color: var(--hk-toast-text);
  background: var(--hk-toast-bg);
  border-radius: 0.75rem;
  border-left: 4px solid var(--hk-accent);
  box-shadow: var(--hk-toast-shadow);
  pointer-events: auto;
  animation: hk-toast-in 0.28s cubic-bezier(0.21, 1.02, 0.73, 1) both;
}

.hk-toast--error {
  --hk-accent: #dc2626;
  --hk-accent-soft: rgba(220, 38, 38, 0.14);
}
.hk-toast--warning {
  --hk-accent: #d97706;
  --hk-accent-soft: rgba(217, 119, 6, 0.16);
}
.hk-toast--info {
  --hk-accent: #2563eb;
  --hk-accent-soft: rgba(37, 99, 235, 0.14);
}

.hk-toast__icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  color: var(--hk-accent);
  background: var(--hk-accent-soft);
  border-radius: 50%;
}

.hk-toast__content {
  flex: 1;
  min-width: 0;
  padding-top: 0.05rem;
}

.hk-toast__title {
  margin: 0 0 0.125rem;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--hk-toast-text);
}

.hk-toast__message {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--hk-toast-muted);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.hk-toast__close {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  color: var(--hk-toast-muted);
  background: transparent;
  border: 0;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.hk-toast__close:hover {
  color: var(--hk-toast-text);
  background: rgba(107, 114, 128, 0.16);
}
.hk-toast__close:focus-visible {
  outline: 2px solid var(--hk-accent);
  outline-offset: 1px;
}

.hk-toast__progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--hk-accent);
  opacity: 0.55;
  transform-origin: left center;
  animation: hk-toast-progress var(--hk-toast-duration, 5000ms) linear forwards;
}
.hk-toast--paused .hk-toast__progress {
  animation-play-state: paused;
}

.hk-toast--leaving {
  animation: hk-toast-out 0.22s ease-in forwards;
}

@keyframes hk-toast-in {
  from {
    opacity: 0;
    transform: translateX(24px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes hk-toast-out {
  to {
    opacity: 0;
    transform: translateX(24px) scale(0.98);
  }
}
@keyframes hk-toast-progress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

@media (max-width: 575.98px) {
  .hk-toast-container {
    top: 0.5rem;
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hk-toast,
  .hk-toast--leaving {
    animation-duration: 0.01ms;
  }
}

/*
 * Confirm dialog (js/blogConfirm.js) — same visual language as the toast.
 *
 * Colours come off the admin theme's own variables (--white, --neutral-*, ...),
 * which the dark theme redefines, so it follows the theme without a rule of its
 * own. Only the three tone accents are fixed. Nothing here leans on Bootstrap's
 * .btn or on the theme's utility classes: the theme resets every element with
 * `all: unset`, and a dialog that opens on top of any page should not depend on
 * what that page happens to load.
 */
.hk-confirm {
  --hk-confirm-accent: #2563eb;
  --hk-confirm-soft: rgba(37, 99, 235, 0.12);
  --hk-confirm-halo: rgba(37, 99, 235, 0.06);
  --hk-confirm-solid: #2563eb;
  --hk-confirm-solid-hover: #1d4ed8;
  --hk-confirm-bg: var(--white, #ffffff);
  --hk-confirm-text: var(--text-primary-light, #111827);
  --hk-confirm-muted: var(--text-secondary-light, #4b5563);
  --hk-confirm-footer-bg: var(--neutral-50, #f5f6fa);
  --hk-confirm-border: var(--border-color, rgba(209, 213, 219, 0.5));
}
.hk-confirm[data-tone="danger"] {
  --hk-confirm-accent: #dc2626;
  --hk-confirm-soft: rgba(220, 38, 38, 0.12);
  --hk-confirm-halo: rgba(220, 38, 38, 0.06);
  --hk-confirm-solid: #dc2626;
  --hk-confirm-solid-hover: #b91c1c;
}
/* The solid is a shade darker than the accent: white on #d97706 misses contrast. */
.hk-confirm[data-tone="warning"] {
  --hk-confirm-accent: #d97706;
  --hk-confirm-soft: rgba(217, 119, 6, 0.14);
  --hk-confirm-halo: rgba(217, 119, 6, 0.07);
  --hk-confirm-solid: #b45309;
  --hk-confirm-solid-hover: #92400e;
}

.hk-confirm .modal-dialog {
  max-width: 28rem;
}
.hk-confirm .modal-content {
  position: relative;
  overflow: hidden;
  color: var(--hk-confirm-text);
  background: var(--hk-confirm-bg);
  border: 1px solid var(--hk-confirm-border);
  border-radius: 1rem;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28), 0 4px 12px rgba(15, 23, 42, 0.1);
}

/* Rises and settles in, instead of Bootstrap's drop from above. */
.hk-confirm.fade .modal-dialog {
  transform: translateY(14px) scale(0.96);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.hk-confirm.show .modal-dialog {
  transform: none;
}
.hk-confirm.show .hk-confirm__icon {
  animation: hk-confirm-pop 0.38s cubic-bezier(0.2, 1.2, 0.4, 1) 0.08s both;
}
@keyframes hk-confirm-pop {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hk-confirm__body {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  /* The right edge leaves room for the close button, so a long line never runs under it. */
  padding: 1.5rem 3rem 1.5rem 1.5rem;
}
.hk-confirm__icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  color: var(--hk-confirm-accent);
  background: var(--hk-confirm-soft);
  border-radius: 50%;
  box-shadow: 0 0 0 0.4rem var(--hk-confirm-halo);
}
.hk-confirm__text {
  flex: 1;
  min-width: 0;
  padding-top: 0.15rem;
}
.hk-confirm__title {
  margin: 0 0 0.25rem;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--hk-confirm-text);
}
.hk-confirm__message {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--hk-confirm-muted);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.hk-confirm__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  color: var(--hk-confirm-muted);
  background: transparent;
  border: 0;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.hk-confirm__close:hover {
  color: var(--hk-confirm-text);
  background: var(--neutral-100, rgba(107, 114, 128, 0.16));
}
.hk-confirm__close:focus-visible {
  outline: 2px solid var(--neutral-400, #9ca3af);
  outline-offset: 1px;
}

.hk-confirm__footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: var(--hk-confirm-footer-bg);
  border-top: 1px solid var(--hk-confirm-border);
}
.hk-confirm__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0.5rem 1.25rem;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  border: 1px solid transparent;
  border-radius: 0.625rem;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.hk-confirm__btn:active {
  transform: translateY(1px);
}
.hk-confirm__btn--cancel {
  color: var(--neutral-700, #374151);
  background: var(--hk-confirm-bg);
  border-color: var(--neutral-300, #d1d5db);
}
.hk-confirm__btn--cancel:hover {
  background: var(--neutral-100, #f3f4f6);
}
.hk-confirm__btn--cancel:focus-visible {
  outline: 2px solid var(--neutral-400, #9ca3af);
  outline-offset: 2px;
}
.hk-confirm__btn--ok {
  color: #ffffff;
  background: var(--hk-confirm-solid);
  border-color: var(--hk-confirm-solid);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.18);
}
.hk-confirm__btn--ok:hover {
  background: var(--hk-confirm-solid-hover);
  border-color: var(--hk-confirm-solid-hover);
}
.hk-confirm__btn--ok:focus-visible {
  outline: 2px solid var(--hk-confirm-solid);
  outline-offset: 2px;
}

@media (max-width: 575.98px) {
  .hk-confirm__body {
    gap: 0.875rem;
    padding: 1.25rem 2.75rem 1.25rem 1.25rem;
  }
  .hk-confirm__footer {
    flex-direction: column-reverse;
    padding: 1rem 1.25rem;
  }
  .hk-confirm__btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hk-confirm.fade .modal-dialog {
    transform: none;
    transition: none;
  }
  .hk-confirm.show .hk-confirm__icon {
    animation: none;
  }
}

