/* Toastr Modern Toast & Confirmation Dialog System for LeadPilot AI */

#toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 24rem;
  width: calc(100vw - 2.5rem);
  pointer-events: none;
}

@media (max-width: 640px) {
  #toast-container {
    top: 1rem;
    right: 1rem;
    left: 1rem;
    width: auto;
    max-width: none;
  }
}

.toastr-toast {
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  padding: 0.875rem 1rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.35;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translateX(100%);
  opacity: 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid;
}

.toastr-toast.toastr-visible {
  transform: translateX(0);
  opacity: 1;
}

.toastr-toast.toastr-hiding {
  transform: translateX(100%);
  opacity: 0;
}

/* Toast Themes */
.toastr-toast.toastr-success {
  background-color: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #059669;
}
.dark .toastr-toast.toastr-success {
  background-color: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.toastr-toast.toastr-error {
  background-color: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #dc2626;
}
.dark .toastr-toast.toastr-error {
  background-color: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.toastr-toast.toastr-warning {
  background-color: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #d97706;
}
.dark .toastr-toast.toastr-warning {
  background-color: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.toastr-toast.toastr-info {
  background-color: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.35);
  color: #4f46e5;
}
.dark .toastr-toast.toastr-info {
  background-color: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.4);
  color: #818cf8;
}

/* Icon & Content */
.toastr-icon {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 0.05rem;
}

.toastr-content {
  flex: 1;
  min-width: 0;
}

.toastr-title {
  font-weight: 700;
  font-size: 0.8125rem;
  margin-bottom: 0.15rem;
  color: inherit;
}

.toastr-message {
  color: #374151;
  word-break: break-word;
}
.dark .toastr-message {
  color: #e5e7eb;
}

.toastr-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: currentColor;
  opacity: 0.6;
  font-size: 1rem;
  padding: 0;
  margin-left: 0.5rem;
  line-height: 1;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}
.toastr-close:hover {
  opacity: 1;
}

/* Progress Bar */
.toastr-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background-color: currentColor;
  opacity: 0.35;
  width: 100%;
  transition: width linear;
}

/* Custom Confirmation Modal (Replaces browser alert/confirm) */
.toastr-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.toastr-modal-overlay.toastr-modal-visible {
  opacity: 1;
  pointer-events: auto;
}

.toastr-modal-box {
  width: 100%;
  max-width: 26rem;
  border-radius: 1.25rem;
  padding: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  transform: scale(0.95);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  color: #111827;
}
.dark .toastr-modal-box {
  background-color: #181920;
  border-color: #272832;
  color: #f9fafb;
}

.toastr-modal-overlay.toastr-modal-visible .toastr-modal-box {
  transform: scale(1);
}

.toastr-modal-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.toastr-modal-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.toastr-modal-icon.danger {
  background-color: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.toastr-modal-icon.warning {
  background-color: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.toastr-modal-icon.primary {
  background-color: rgba(99, 102, 241, 0.15);
  color: #6366f1;
}

.toastr-modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
}

.toastr-modal-body {
  font-size: 0.875rem;
  line-height: 1.45;
  color: #4b5563;
  margin-bottom: 1.5rem;
}
.dark .toastr-modal-body {
  color: #9ca3af;
}

.toastr-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.toastr-modal-btn {
  padding: 0.625rem 1.125rem;
  border-radius: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.toastr-modal-btn.cancel {
  background-color: transparent;
  border-color: #e5e7eb;
  color: #6b7280;
}
.toastr-modal-btn.cancel:hover {
  background-color: #f3f4f6;
  color: #111827;
}
.dark .toastr-modal-btn.cancel {
  border-color: #2e303d;
  color: #9ca3af;
}
.dark .toastr-modal-btn.cancel:hover {
  background-color: #232530;
  color: #f9fafb;
}

.toastr-modal-btn.confirm-danger {
  background-color: #ef4444;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}
.toastr-modal-btn.confirm-danger:hover {
  background-color: #dc2626;
}

.toastr-modal-btn.confirm-primary {
  background-color: #6366f1;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}
.toastr-modal-btn.confirm-primary:hover {
  background-color: #4f46e5;
}
