/* Premium toast + alert dialog (global) */

.app-toast-stack {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 11050;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: min(420px, calc(100vw - 2rem));
  pointer-events: none;
}

.app-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  background: #fff;
  border-radius: 16px;
  padding: 1rem 1.1rem;
  box-shadow: 0 20px 40px -12px rgba(15, 23, 42, 0.28);
  border: 1px solid rgba(148, 163, 184, 0.18);
  animation: appToastIn 0.35s ease;
  position: relative;
  overflow: hidden;
}

.app-toast.is-leaving {
  animation: appToastOut 0.25s ease forwards;
}

@keyframes appToastIn {
  from { transform: translateX(110%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes appToastOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(110%); opacity: 0; }
}

.app-toast__icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  font-size: 1rem;
}

.app-toast--success .app-toast__icon {
  background: var(--ds-success-dot);
}

.app-toast--error .app-toast__icon,
.app-toast--danger .app-toast__icon {
  background: var(--ds-danger-solid);
}

.app-toast--warning .app-toast__icon {
  background: var(--ds-warning-dot);
}

.app-toast--info .app-toast__icon {
  background: var(--ds-accent);
}

.app-toast__body { flex: 1; min-width: 0; }

.app-toast__title {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.app-toast__message {
  color: #64748b;
  font-size: 0.85rem;
  line-height: 1.45;
}

.app-toast__close {
  border: none;
  background: transparent;
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
}

.app-toast__close:hover {
  background: #f1f5f9;
  color: #475569;
}

.app-toast__progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  transform-origin: left;
  animation: appToastProgress linear forwards;
}

.app-toast--success .app-toast__progress { background: #10b981; }
.app-toast--error .app-toast__progress,
.app-toast--danger .app-toast__progress { background: #ef4444; }
.app-toast--warning .app-toast__progress { background: #f59e0b; }
.app-toast--info .app-toast__progress { background: #6366f1; }

@keyframes appToastProgress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* Premium alert modal */
.app-alert-modal {
  z-index: 12050;
}

.app-alert-modal .modal-dialog {
  max-width: 440px;
}

.app-alert-modal .modal-content {
  border: none;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 60px -20px rgba(15, 23, 42, 0.35);
}

.app-alert-modal__body {
  text-align: center;
  padding: 2rem 1.75rem 1.25rem;
}

.app-alert-modal__icon-wrap {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.app-alert-modal__icon-wrap--success {
  background: var(--ds-success-dot);
  color: #fff;
  box-shadow: 0 12px 30px -8px rgba(16, 185, 129, 0.55);
}

.app-alert-modal__icon-wrap--error,
.app-alert-modal__icon-wrap--danger {
  background: var(--ds-danger-solid);
  color: #fff;
  box-shadow: 0 12px 30px -8px rgba(239, 68, 68, 0.5);
}

.app-alert-modal__icon-wrap--warning {
  background: var(--ds-warning-dot);
  color: #fff;
  box-shadow: 0 12px 30px -8px rgba(245, 158, 11, 0.5);
}

.app-alert-modal__icon-wrap--info {
  background: var(--ds-accent);
  color: #fff;
  box-shadow: 0 12px 30px -8px rgba(99, 102, 241, 0.5);
}

.app-alert-modal__icon-wrap i {
  font-size: 1.75rem;
}

.app-alert-modal__title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.5rem;
}

.app-alert-modal__message {
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 0;
}

.app-alert-modal__detail {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: var(--ds-surface-2);
  color: #475569;
  font-size: 0.875rem;
  text-align: left;
}

.app-alert-modal .modal-footer {
  border-top: none;
  padding: 0 1.75rem 1.5rem;
  gap: 0.5rem;
  justify-content: center;
}

.app-alert-modal .btn-primary {
  background: var(--ds-accent);
  border: none;
  border-radius: 10px;
  padding: 0.55rem 1.25rem;
  font-weight: 600;
}

.app-alert-modal .btn-primary:hover {
  background: var(--ds-accent);
}

.app-alert-modal .btn-outline-secondary {
  border-radius: 10px;
  padding: 0.55rem 1.25rem;
}

/* Dark theme */
[data-theme="dark"] .app-toast {
  background: #1e293b;
  border-color: rgba(148, 163, 184, 0.12);
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .app-toast__title {
  color: #f1f5f9;
}

[data-theme="dark"] .app-toast__message {
  color: #94a3b8;
}

[data-theme="dark"] .app-toast__close:hover {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
}

[data-theme="dark"] .app-alert-modal .modal-content {
  background: #1e293b;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] .app-alert-modal__title {
  color: #f1f5f9;
}

[data-theme="dark"] .app-alert-modal__message {
  color: #94a3b8;
}

[data-theme="dark"] .app-alert-modal__detail {
  background: var(--ds-surface-2);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.1);
}

[data-theme="dark"] .app-alert-modal .modal-footer {
  background: transparent;
}
