/*
 * Toasts for both the React app (ToastProvider.jsx) and the Blade admin panel
 * (notify.js). They render the same markup, so every change here lands in both.
 *
 * Each type sets an accent, a soft tint and a glyph. The glyph is an SVG mask
 * painted in the accent colour, which keeps the icons out of both scripts.
 */
.bdgigs-toast-root {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: grid;
  width: min(380px, calc(100vw - 32px));
  gap: 10px;
  pointer-events: none;
}

.bdgigs-toast {
  --toast-accent: #2563eb;
  --toast-soft: #dbeafe;
  --toast-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5M12 7.6h.01'/%3E%3C/svg%3E");
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 28px;
  align-items: start;
  gap: 12px;
  overflow: hidden;
  padding: 14px 12px 16px 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: #ffffff;
  color: #0f172a;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 14px 34px -10px rgba(15, 23, 42, 0.22);
  pointer-events: auto;
  opacity: 0;
  transform: translateX(24px) scale(0.98);
  animation: bdgigs-toast-in 280ms cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
}

.bdgigs-toast.is-hiding {
  animation: bdgigs-toast-out 180ms ease-in forwards;
}

.bdgigs-toast[data-type="success"] {
  --toast-accent: #16a34a;
  --toast-soft: #dcfce7;
  --toast-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}

.bdgigs-toast[data-type="error"] {
  --toast-accent: #dc2626;
  --toast-soft: #fee2e2;
  --toast-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5M12 16.4h.01'/%3E%3C/svg%3E");
}

.bdgigs-toast[data-type="warning"] {
  --toast-accent: #d97706;
  --toast-soft: #fef3c7;
  --toast-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z'/%3E%3Cpath d='M12 9v4M12 17h.01'/%3E%3C/svg%3E");
}

.bdgigs-toast-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  background: var(--toast-soft);
}

.bdgigs-toast-icon::before {
  width: 20px;
  height: 20px;
  background: var(--toast-accent);
  content: "";
  -webkit-mask: var(--toast-icon) center / contain no-repeat;
  mask: var(--toast-icon) center / contain no-repeat;
}

.bdgigs-toast-body {
  min-width: 0;
  padding-top: 1px;
}

.bdgigs-toast-title {
  margin: 0;
  color: #0f172a;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.3;
}

.bdgigs-toast-message {
  margin: 3px 0 0;
  color: #475569;
  font-size: 0.83rem;
  font-weight: 500;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.bdgigs-toast-action {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  margin-top: 10px;
  padding: 0 0.75rem;
  border-radius: 8px;
  background: var(--toast-soft);
  color: var(--toast-accent);
  font-size: 0.78rem;
  font-weight: 650;
  text-decoration: none;
  transition: box-shadow 150ms ease;
}

.bdgigs-toast-action:hover,
.bdgigs-toast-action:focus-visible {
  box-shadow: inset 0 0 0 1px var(--toast-accent);
}

.bdgigs-toast-close {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  margin: -2px -2px 0 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  transition:
    background-color 150ms ease,
    color 150ms ease;
}

.bdgigs-toast-close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2.2;
}

.bdgigs-toast-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.bdgigs-toast-close:focus-visible {
  outline: 2px solid var(--toast-accent);
  outline-offset: 1px;
}

.bdgigs-toast-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--toast-accent);
  opacity: 0.85;
  transform-origin: left;
  animation: bdgigs-toast-progress var(--toast-duration, 4500ms) linear forwards;
}

.bdgigs-toast.is-paused .bdgigs-toast-progress {
  animation-play-state: paused;
}

@keyframes bdgigs-toast-in {
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* Starts from the shown state explicitly: the base style is the hidden one. */
@keyframes bdgigs-toast-out {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateX(24px) scale(0.98);
  }
}

@keyframes bdgigs-toast-progress {
  from {
    transform: scaleX(1);
  }

  to {
    transform: scaleX(0);
  }
}

@media (max-width: 560px) {
  .bdgigs-toast-root {
    top: 12px;
    right: 12px;
    left: 12px;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bdgigs-toast,
  .bdgigs-toast.is-hiding {
    animation-duration: 1ms;
  }
}
