/* shadcn-inspired SweetAlert2 + Lobibox + iziToast skins.
   Uses haze tokens so light/dark stay aligned with the app chrome. */

:root,
html.light-theme,
html.semi-dark,
html.minimal-theme,
html.dark-theme {
  --mogav-swal-radius: 10px;
  --mogav-toast-radius: 10px;
  --mogav-toast-width: 340px;
  --mogav-overlay-shadow: 0 10px 38px rgb(15 23 42 / 12%);
}

html.dark-theme {
  --mogav-overlay-shadow: 0 16px 40px rgb(0 0 0 / 45%);
}

/* ========================= SweetAlert2 ========================= */

.swal2-container {
  z-index: 20050 !important;
}

.swal2-backdrop-show,
.swal2-container.swal2-backdrop-show {
  background: rgb(15 23 42 / 45%) !important;
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
}

html.dark-theme .swal2-backdrop-show,
html.dark-theme .swal2-container.swal2-backdrop-show {
  background: rgb(0 0 0 / 55%) !important;
}

html:is(.light-theme, .dark-theme, .semi-dark, .minimal-theme) .swal2-popup,
html:is(.light-theme, .dark-theme, .semi-dark, .minimal-theme) .swal2-popup.mogav-swal,
.swal2-popup,
.swal2-popup.mogav-swal {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  width: min(26rem, calc(100vw - 2rem)) !important;
  padding: 1.35rem 1.35rem 1.2rem !important;
  border: 1px solid var(--haze-border-strong) !important;
  border-radius: var(--mogav-swal-radius) !important;
  background: var(--haze-surface) !important;
  color: var(--haze-text) !important;
  box-shadow: var(--mogav-overlay-shadow) !important;
  font-family: var(--bs-body-font-family) !important;
}

.swal2-title,
.mogav-swal-title {
  width: 100% !important;
  margin: 0 0 .45rem !important;
  padding: 0 !important;
  color: var(--haze-heading) !important;
  font-size: 1.05rem !important;
  font-weight: 650 !important;
  line-height: 1.35 !important;
  text-align: center !important;
}

.swal2-html-container,
.mogav-swal-html {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--haze-muted) !important;
  font-size: .9rem !important;
  font-weight: 500 !important;
  line-height: 1.55 !important;
  text-align: center !important;
}

.swal2-icon {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: .1rem auto 1rem !important;
  width: 3rem !important;
  height: 3rem !important;
  border-width: 2px !important;
  box-shadow: none !important;
  position: relative !important;
}

.swal2-icon .swal2-icon-content {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.55rem !important;
  line-height: 1 !important;
}

/* Keep the success checkmark geometry centered in the smaller icon. */
.swal2-icon.swal2-success {
  width: 3.15rem !important;
  height: 3.15rem !important;
}
.swal2-icon.swal2-success .swal2-success-circular-line-left,
.swal2-icon.swal2-success .swal2-success-circular-line-right,
.swal2-icon.swal2-success .swal2-success-fix-tip {
  display: none !important;
}
.swal2-icon.swal2-success .swal2-success-ring {
  width: 100% !important;
  height: 100% !important;
  top: 0 !important;
  left: 0 !important;
}
.swal2-icon.swal2-success [class^=swal2-success-line] {
  position: absolute !important;
}
.swal2-icon.swal2-success .swal2-success-line-tip {
  top: 1.55rem !important;
  left: .55rem !important;
  width: 1rem !important;
  height: .2rem !important;
}
.swal2-icon.swal2-success .swal2-success-line-long {
  top: 1.3rem !important;
  right: .45rem !important;
  width: 1.55rem !important;
  height: .2rem !important;
}

.swal2-icon.swal2-success {
  border-color: color-mix(in srgb, var(--haze-success) 45%, var(--haze-border)) !important;
  color: var(--haze-success) !important;
}
.swal2-icon.swal2-success .swal2-success-ring {
  background: transparent !important;
  border-color: color-mix(in srgb, var(--haze-success) 40%, transparent) !important;
}
.swal2-icon.swal2-success [class^=swal2-success-line] {
  background-color: var(--haze-success) !important;
}

.swal2-icon.swal2-error {
  border-color: color-mix(in srgb, var(--haze-danger) 45%, var(--haze-border)) !important;
  color: var(--haze-danger) !important;
}
.swal2-icon.swal2-error [class^=swal2-x-mark-line] {
  background-color: var(--haze-danger) !important;
}

.swal2-icon.swal2-warning {
  border-color: color-mix(in srgb, var(--haze-warning) 45%, var(--haze-border)) !important;
  color: var(--haze-warning) !important;
}

.swal2-icon.swal2-info {
  border-color: color-mix(in srgb, var(--haze-info) 45%, var(--haze-border)) !important;
  color: var(--haze-info) !important;
}

.swal2-icon.swal2-question {
  border-color: color-mix(in srgb, var(--haze-primary) 40%, var(--haze-border)) !important;
  color: var(--haze-primary) !important;
}

.swal2-actions,
.mogav-swal-actions {
  width: 100% !important;
  margin: 1.15rem 0 0 !important;
  padding: 0 !important;
  gap: .55rem !important;
  justify-content: center !important;
}

.swal2-styled,
.mogav-swal-confirm,
.mogav-swal-cancel,
.mogav-swal-deny {
  margin: 0 !important;
  min-height: 2.25rem !important;
  padding: .45rem .95rem !important;
  border-radius: 8px !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
  font-size: .84rem !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  transition: background .15s ease, color .15s ease, border-color .15s ease, opacity .15s ease !important;
}

.swal2-styled:focus,
.mogav-swal-confirm:focus-visible,
.mogav-swal-cancel:focus-visible,
.mogav-swal-deny:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--haze-primary) 45%, transparent) !important;
  outline-offset: 2px !important;
  box-shadow: none !important;
}

.swal2-confirm,
.mogav-swal-confirm {
  background: var(--haze-primary) !important;
  border-color: var(--haze-primary) !important;
  color: #fff !important;
}
.swal2-confirm:hover,
.mogav-swal-confirm:hover {
  background: var(--haze-primary-hover) !important;
  border-color: var(--haze-primary-hover) !important;
}

.swal2-cancel,
.mogav-swal-cancel {
  background: var(--haze-surface) !important;
  border-color: var(--haze-border-strong) !important;
  color: var(--haze-heading) !important;
}
.swal2-cancel:hover,
.mogav-swal-cancel:hover {
  background: var(--haze-surface-2) !important;
  border-color: var(--haze-border-strong) !important;
  color: var(--haze-heading) !important;
}

.swal2-deny,
.mogav-swal-deny {
  background: var(--haze-danger) !important;
  border-color: var(--haze-danger) !important;
  color: #fff !important;
}

.swal2-popup.mogav-swal-destructive .swal2-confirm,
.swal2-popup.mogav-swal-destructive .mogav-swal-confirm {
  background: var(--haze-danger) !important;
  border-color: var(--haze-danger) !important;
}
.swal2-popup.mogav-swal-destructive .swal2-confirm:hover,
.swal2-popup.mogav-swal-destructive .mogav-swal-confirm:hover {
  filter: brightness(.94);
}

.swal2-input,
.swal2-textarea,
.mogav-swal-input {
  width: 100% !important;
  margin: .85rem 0 0 !important;
  padding: .55rem .75rem !important;
  border: 1px solid var(--haze-border-strong) !important;
  border-radius: 8px !important;
  background: var(--haze-surface) !important;
  color: var(--haze-heading) !important;
  box-shadow: none !important;
  font-size: .875rem !important;
}
.swal2-input:focus,
.swal2-textarea:focus,
.mogav-swal-input:focus {
  border-color: var(--haze-primary) !important;
  box-shadow: 0 0 0 3px var(--haze-primary-soft) !important;
}

.swal2-validation-message,
.mogav-swal-validation {
  margin: .75rem 0 0 !important;
  padding: .55rem .7rem !important;
  border: 1px solid color-mix(in srgb, var(--haze-danger) 30%, var(--haze-border)) !important;
  border-radius: 8px !important;
  background: var(--haze-danger-soft) !important;
  color: var(--haze-danger) !important;
  box-shadow: none !important;
  font-size: .8rem !important;
  font-weight: 600 !important;
}

.swal2-loader {
  border-color: var(--haze-border-strong) transparent var(--haze-primary) transparent !important;
}

.swal2-timer-progress-bar {
  background: color-mix(in srgb, var(--haze-primary) 70%, transparent) !important;
}

/* When title is empty, keep text/html readable without awkward icon gap. */
.swal2-popup:not(:has(.swal2-title:not(:empty))) .swal2-html-container {
  margin-top: .15rem !important;
}

/* ========================= Lobibox toasts ========================= */

.lobibox-notify-wrapper {
  z-index: 20040 !important;
}
.lobibox-notify-wrapper.top.right {
  top: 16px !important;
  right: 16px !important;
}
.lobibox-notify-wrapper.bottom.right {
  bottom: 16px !important;
  right: 16px !important;
}

.lobibox-notify,
.lobibox-notify.notify-mini,
.lobibox-notify.notify-normal,
.lobibox-notify.notify-large {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  width: min(340px, calc(100vw - 2rem)) !important;
  min-height: 0 !important;
  height: auto !important;
  margin: 0 0 .55rem !important;
  padding: .7rem 2rem .7rem .7rem !important;
  border: 1px solid var(--haze-border) !important;
  border-radius: 10px !important;
  background: var(--haze-surface) !important;
  color: var(--haze-heading) !important;
  box-shadow: 0 8px 24px rgb(15 23 42 / 10%), 0 1px 2px rgb(15 23 42 / 5%) !important;
  font-family: var(--bs-body-font-family) !important;
  font-size: 13.5px !important;
  overflow: hidden !important;
  -webkit-box-shadow: 0 8px 24px rgb(15 23 42 / 10%), 0 1px 2px rgb(15 23 42 / 5%) !important;
}

html.dark-theme .lobibox-notify {
  box-shadow: 0 12px 28px rgb(0 0 0 / 40%), 0 1px 0 rgb(255 255 255 / 4%) !important;
  -webkit-box-shadow: 0 12px 28px rgb(0 0 0 / 40%), 0 1px 0 rgb(255 255 255 / 4%) !important;
}

.lobibox-notify.rounded {
  border-radius: 10px !important;
}

.lobibox-notify:hover {
  cursor: default !important;
  border-color: var(--haze-border-strong) !important;
}

.lobibox-notify::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--haze-border-strong);
}

/* Icon rail — override Lobibox 32–55px defaults */
.lobibox-notify .lobibox-notify-icon-wrapper,
.lobibox-notify.notify-mini .lobibox-notify-icon-wrapper,
.lobibox-notify.notify-normal .lobibox-notify-icon-wrapper,
.lobibox-notify.notify-large .lobibox-notify-icon-wrapper {
  position: static !important;
  left: auto !important;
  float: none !important;
  flex: 0 0 28px !important;
  width: 28px !important;
  min-width: 28px !important;
  max-width: 28px !important;
  height: 28px !important;
  margin: 0 .65rem 0 0 !important;
  padding: 0 !important;
  align-self: center !important;
}

.lobibox-notify .lobibox-notify-icon,
.lobibox-notify .lobibox-notify-icon > div,
.lobibox-notify.notify-mini .lobibox-notify-icon > div,
.lobibox-notify.notify-normal .lobibox-notify-icon > div {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  height: 28px !important;
  margin: 0 !important;
  padding: 0 !important;
}

.lobibox-notify .lobibox-notify-icon > div .icon-el,
.lobibox-notify.notify-mini .lobibox-notify-icon > div .icon-el,
.lobibox-notify.notify-normal .lobibox-notify-icon > div .icon-el,
.lobibox-notify.notify-large .lobibox-notify-icon > div .icon-el {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  min-height: 28px !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 999px !important;
  background: var(--haze-surface-2) !important;
  color: var(--haze-heading) !important;
  font-size: 14px !important;
  line-height: 1 !important;
}

/* Check / cancel / warning icons must stay compact */
.lobibox-notify .lobibox-notify-icon > div .icon-el i,
.lobibox-notify .lobibox-notify-icon > div .icon-el .bx,
.lobibox-notify .lobibox-notify-icon > div .icon-el [class^="bx"],
.lobibox-notify .lobibox-notify-icon > div .icon-el::before,
.lobibox-notify .lobibox-notify-icon > div .icon-el i::before {
  display: block !important;
  width: 14px !important;
  height: 14px !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 14px !important;
  line-height: 14px !important;
  speak: never;
}

.lobibox-notify .lobibox-notify-body,
.lobibox-notify.notify-mini .lobibox-notify-body,
.lobibox-notify.notify-normal .lobibox-notify-body {
  flex: 1 1 auto !important;
  margin: 0 !important;
  min-width: 0 !important;
  padding: 0 !important;
}

.lobibox-notify .lobibox-notify-title,
.lobibox-notify .lobibox-notify-title:empty,
.lobibox-notify.notify-mini .lobibox-notify-title {
  display: none !important;
}

.lobibox-notify .lobibox-notify-msg {
  color: var(--haze-text) !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  line-height: 1.45 !important;
  max-height: none !important;
  overflow: visible !important;
}

.lobibox-notify .lobibox-close {
  top: 50% !important;
  right: .55rem !important;
  transform: translateY(-50%) !important;
  width: 22px !important;
  height: 22px !important;
  line-height: 20px !important;
  border-radius: 6px !important;
  color: var(--haze-muted) !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  opacity: .75;
  background: transparent !important;
  text-align: center !important;
}
.lobibox-notify .lobibox-close:hover {
  background: var(--haze-surface-2) !important;
  color: var(--haze-heading) !important;
  opacity: 1;
}

.lobibox-notify .lobibox-delay-indicator {
  display: none !important;
}

.lobibox-notify.without-icon .lobibox-notify-body {
  margin-left: 0 !important;
}

.lobibox-notify.lobibox-notify-default,
.lobibox-notify.lobibox-notify-success,
.lobibox-notify.lobibox-notify-error,
.lobibox-notify.lobibox-notify-warning,
.lobibox-notify.lobibox-notify-info {
  background: var(--haze-surface) !important;
  color: var(--haze-heading) !important;
}

.lobibox-notify.lobibox-notify-default {
  border-color: var(--haze-border-strong) !important;
}
.lobibox-notify.lobibox-notify-default::before {
  background: var(--haze-muted);
}
.lobibox-notify.lobibox-notify-default .icon-el {
  background: var(--haze-surface-3) !important;
  color: var(--haze-heading) !important;
}

.lobibox-notify.lobibox-notify-success {
  border-color: color-mix(in srgb, var(--haze-success) 28%, var(--haze-border)) !important;
}
.lobibox-notify.lobibox-notify-success::before {
  background: var(--haze-success);
}
.lobibox-notify.lobibox-notify-success .icon-el {
  background: var(--haze-success-soft) !important;
  color: var(--haze-success) !important;
}

.lobibox-notify.lobibox-notify-error {
  border-color: color-mix(in srgb, var(--haze-danger) 28%, var(--haze-border)) !important;
}
.lobibox-notify.lobibox-notify-error::before {
  background: var(--haze-danger);
}
.lobibox-notify.lobibox-notify-error .icon-el {
  background: var(--haze-danger-soft) !important;
  color: var(--haze-danger) !important;
}

.lobibox-notify.lobibox-notify-warning {
  border-color: color-mix(in srgb, var(--haze-warning) 32%, var(--haze-border)) !important;
}
.lobibox-notify.lobibox-notify-warning::before {
  background: var(--haze-warning);
}
.lobibox-notify.lobibox-notify-warning .icon-el {
  background: var(--haze-warning-soft) !important;
  color: var(--haze-warning) !important;
}

.lobibox-notify.lobibox-notify-info {
  border-color: color-mix(in srgb, var(--haze-info) 28%, var(--haze-border)) !important;
}
.lobibox-notify.lobibox-notify-info::before {
  background: var(--haze-info);
}
.lobibox-notify.lobibox-notify-info .icon-el {
  background: var(--haze-info-soft) !important;
  color: var(--haze-info) !important;
}

/* ========================= iziToast ========================= */

.iziToast {
  max-width: min(var(--mogav-toast-width), calc(100vw - 2rem)) !important;
  padding: .85rem 1rem .85rem 1rem !important;
  border: 1px solid var(--haze-border) !important;
  border-radius: 12px !important;
  background: var(--haze-surface) !important;
  color: var(--haze-heading) !important;
  box-shadow: 0 10px 30px rgb(15 23 42 / 10%), 0 1px 2px rgb(15 23 42 / 6%) !important;
  font-family: var(--bs-body-font-family) !important;
  overflow: hidden !important;
}

.iziToast::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--haze-border-strong);
}

.iziToast::after {
  box-shadow: none !important;
}

.iziToast > .iziToast-body {
  padding-left: .35rem !important;
  margin: 0 !important;
}

.iziToast > .iziToast-body .iziToast-icon {
  margin-top: .1rem !important;
}

.iziToast > .iziToast-body .iziToast-texts {
  margin: 0 !important;
}

.iziToast > .iziToast-body .iziToast-title {
  color: var(--haze-heading) !important;
  font-size: .82rem !important;
  font-weight: 650 !important;
  margin-bottom: .1rem !important;
}

.iziToast > .iziToast-body .iziToast-message {
  color: var(--haze-text) !important;
  font-size: .84rem !important;
  font-weight: 500 !important;
  line-height: 1.45 !important;
}

.iziToast > .iziToast-close {
  background: transparent !important;
  opacity: .7;
  border-radius: 7px !important;
}
.iziToast > .iziToast-close:hover {
  opacity: 1;
  background: var(--haze-surface-2) !important;
}

.iziToast.iziToast-color-green,
.iziToast.iziToast-color-red,
.iziToast.iziToast-color-yellow,
.iziToast.iziToast-color-blue,
.iziToast.iziToast-color-dark {
  background: var(--haze-surface) !important;
}

.iziToast.iziToast-color-green {
  border-color: color-mix(in srgb, var(--haze-success) 28%, var(--haze-border)) !important;
}
.iziToast.iziToast-color-green::before {
  background: var(--haze-success);
}
.iziToast.iziToast-color-red {
  border-color: color-mix(in srgb, var(--haze-danger) 28%, var(--haze-border)) !important;
}
.iziToast.iziToast-color-red::before {
  background: var(--haze-danger);
}
.iziToast.iziToast-color-yellow {
  border-color: color-mix(in srgb, var(--haze-warning) 32%, var(--haze-border)) !important;
}
.iziToast.iziToast-color-yellow::before {
  background: var(--haze-warning);
}
.iziToast.iziToast-color-blue {
  border-color: color-mix(in srgb, var(--haze-info) 28%, var(--haze-border)) !important;
}
.iziToast.iziToast-color-blue::before {
  background: var(--haze-info);
}

.iziToast > .iziToast-progressbar > div {
  background: color-mix(in srgb, var(--haze-primary) 55%, transparent) !important;
}
.iziToast.iziToast-color-green > .iziToast-progressbar > div {
  background: color-mix(in srgb, var(--haze-success) 70%, transparent) !important;
}
.iziToast.iziToast-color-red > .iziToast-progressbar > div {
  background: color-mix(in srgb, var(--haze-danger) 70%, transparent) !important;
}
.iziToast.iziToast-color-yellow > .iziToast-progressbar > div {
  background: color-mix(in srgb, var(--haze-warning) 70%, transparent) !important;
}
.iziToast.iziToast-color-blue > .iziToast-progressbar > div {
  background: color-mix(in srgb, var(--haze-info) 70%, transparent) !important;
}
