/* Toast Container */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  width: calc(100% - 40px);
}

/* Toast Item */
.toast-item {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12),
              0 2px 8px rgba(0, 0, 0, 0.08);
  border-left: 4px solid;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  position: relative;
  overflow: hidden;
}

.toast-item::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  animation: toast-progress 3s linear forwards;
  transform-origin: left;
}

/* Toast Show Animation */
.toast-item.toast-show {
  opacity: 1;
  transform: translateX(0);
}

/* Toast Types */
.toast-success {
  border-left-color: #10b981;
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
}

.toast-success::before {
  background: #10b981;
}

.toast-success .toast-icon {
  color: #10b981;
  background: #d1fae5;
}

.toast-error {
  border-left-color: #ef4444;
  background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
}

.toast-error::before {
  background: #ef4444;
}

.toast-error .toast-icon {
  color: #ef4444;
  background: #fee2e2;
}

.toast-warning {
  border-left-color: #f59e0b;
  background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%);
}

.toast-warning::before {
  background: #f59e0b;
}

.toast-warning .toast-icon {
  color: #f59e0b;
  background: #fef3c7;
}

.toast-info {
  border-left-color: #3b82f6;
  background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
}

.toast-info::before {
  background: #3b82f6;
}

.toast-info .toast-icon {
  color: #3b82f6;
  background: #dbeafe;
}

/* Toast Icon */
.toast-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  animation: toast-icon-bounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast-icon svg {
  width: 20px;
  height: 20px;
}

/* Toast Content */
.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-message {
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
  line-height: 1.5;
  word-break: break-word;
}

/* Toast Close Button */
.toast-close {
  width: 24px;
  height: 24px;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  color: #6b7280;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  transition: all 0.2s ease;
  font-family: Arial, sans-serif;
  padding: 0;
}

.toast-close:hover {
  background: rgba(0, 0, 0, 0.1);
  transform: rotate(90deg);
}

.toast-close:active {
  transform: rotate(90deg) scale(0.9);
}

/* Animations */
@keyframes toast-progress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

@keyframes toast-icon-bounce {
  0% {
    transform: scale(0) rotate(-45deg);
  }
  50% {
    transform: scale(1.2) rotate(10deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .toast-container {
    top: 10px;
    right: 10px;
    width: calc(100% - 20px);
  }

  .toast-item {
    padding: 14px 16px;
    gap: 10px;
  }

  .toast-icon {
    width: 36px;
    height: 36px;
  }

  .toast-icon svg {
    width: 18px;
    height: 18px;
  }

  .toast-message {
    font-size: 13px;
  }

  .toast-close {
    width: 22px;
    height: 22px;
    font-size: 18px;
  }
}

/* Multiple Toasts Animation */
.toast-item:nth-child(n+4) {
  display: none;
}
