/* Giana design system — Toastr overrides
 * Aligns stock Toastr with .giana-toast / status tokens in feedback.css
 */

#toast-container {
  z-index: 1300;
}

#toast-container.toast-top-center {
  top: var(--space-4, 16px);
  padding: 0 var(--space-4, 16px);
  box-sizing: border-box;
}

#toast-container.toast-bottom-center {
  bottom: var(--space-6, 24px);
  padding: 0 var(--space-4, 16px);
  box-sizing: border-box;
}

#toast-container.toast-top-right,
#toast-container.toast-bottom-right {
  right: var(--space-6, 24px);
}

#toast-container.toast-top-left,
#toast-container.toast-bottom-left {
  left: var(--space-6, 24px);
}

#toast-container.toast-top-right {
  top: var(--space-4, 16px);
}

#toast-container.toast-bottom-right,
#toast-container.toast-bottom-left {
  bottom: var(--space-6, 24px);
}

#toast-container.toast-top-left {
  top: var(--space-4, 16px);
}

#toast-container > div.toast,
#toast-container > .toast-success,
#toast-container > .toast-error,
#toast-container > .toast-info,
#toast-container > .toast-warning {
  position: relative;
  pointer-events: auto;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 10px;
  width: auto;
  min-width: 280px;
  max-width: min(420px, calc(100vw - 32px));
  margin: 0 0 10px;
  padding: 12px 20px 12px 44px;
  border-radius: var(--radius-control, 12px);
  background: var(--primary, #2d1b4e) !important;
  background-color: var(--primary, #2d1b4e) !important;
  background-image: none !important;
  color: var(--on-primary, #ffffff);
  font-family: var(--font-ui, 'Open Sans', sans-serif);
  font-size: var(--text-base, 14px);
  font-weight: var(--weight-regular, 400);
  line-height: var(--leading-body, 1.6);
  box-shadow: var(--shadow-overlay, 0 24px 60px rgba(45, 27, 78, 0.18));
  opacity: 1;
  -ms-filter: none;
  filter: none;
  cursor: default;
  transition: box-shadow var(--transition, 0.15s ease), transform var(--transition, 0.15s ease);
}

#toast-container > div:hover {
  box-shadow: var(--shadow-overlay, 0 24px 60px rgba(45, 27, 78, 0.18));
  cursor: default;
  opacity: 1;
  -ms-filter: none;
  filter: none;
}

#toast-container.toast-top-center > div,
#toast-container.toast-bottom-center > div {
  width: auto;
  min-width: 280px;
  max-width: min(420px, calc(100vw - 32px));
  margin-left: auto;
  margin-right: auto;
}

/* Status icon via design-system SVGs */
#toast-container > div::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  background-color: currentColor;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

#toast-container > .toast-success::before {
  color: var(--success-dot, #22a06b);
  -webkit-mask-image: url('/images/icons/check-circle-2.svg');
  mask-image: url('/images/icons/check-circle-2.svg');
}

#toast-container > .toast-error::before {
  color: #ff8f8f;
  -webkit-mask-image: url('/images/icons/alert-circle.svg');
  mask-image: url('/images/icons/alert-circle.svg');
}

#toast-container > .toast-warning::before {
  color: #ffc76b;
  -webkit-mask-image: url('/images/icons/alert-triangle.svg');
  mask-image: url('/images/icons/alert-triangle.svg');
}

#toast-container > .toast-info::before {
  color: #a9bcf5;
  -webkit-mask-image: url('/images/icons/info.svg');
  mask-image: url('/images/icons/info.svg');
}

.toast-title {
  font-family: var(--font-display, 'Poppins', sans-serif);
  font-size: var(--text-base, 14px);
  font-weight: var(--weight-semibold, 600);
  color: inherit;
}

.toast-message {
  flex: 1;
  min-width: 0;
  color: inherit;
  word-wrap: break-word;
  -ms-word-wrap: break-word;
}

.toast-message a,
.toast-message label {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.toast-message a:hover {
  color: inherit;
  opacity: 0.85;
  text-decoration: underline;
}

.toast-close-button {
  position: static;
  float: none;
  order: 2; /* toastr puts the button before the message: keep it at the end */
  flex-shrink: 0;
  align-self: flex-start;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 0;
  font-weight: normal;
  line-height: 1;
  opacity: 0.55;
  text-shadow: none;
  -webkit-text-shadow: none;
  -ms-filter: none;
  filter: none;
  cursor: pointer;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--transition, 0.15s ease);
}

.toast-close-button::before {
  content: '';
  display: block;
  width: 14px;
  height: 14px;
  background-color: currentColor;
  -webkit-mask-image: url('/images/icons/x.svg');
  mask-image: url('/images/icons/x.svg');
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.toast-close-button:hover,
.toast-close-button:focus {
  color: inherit;
  opacity: 1;
  text-decoration: none;
  -ms-filter: none;
  filter: none;
}

button.toast-close-button {
  padding: 0;
  cursor: pointer;
  background: transparent;
  border: 0;
  -webkit-appearance: none;
}

.toast-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  background-color: var(--on-primary, #ffffff);
  opacity: 0.28;
  -ms-filter: none;
  filter: none;
  border-radius: 0 0 var(--radius-control, 12px) var(--radius-control, 12px);
}

#toast-container > .toast-success .toast-progress {
  background-color: var(--success-dot, #22a06b);
  opacity: 0.7;
}

#toast-container > .toast-error .toast-progress {
  background-color: #ff8f8f;
  opacity: 0.7;
}

#toast-container > .toast-warning .toast-progress {
  background-color: #ffc76b;
  opacity: 0.7;
}

#toast-container > .toast-info .toast-progress {
  background-color: #a9bcf5;
  opacity: 0.7;
}

@media all and (max-width: 480px) {
  #toast-container > div {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    padding: 12px 16px 12px 42px;
  }

  #toast-container.toast-top-center > div,
  #toast-container.toast-bottom-center > div {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
}
