/* Toast-Benachrichtigungssystem für Azubi-App */

/* Container für alle Toasts (oben rechts) */
#toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  pointer-events: none;
}

/* Einzelner Toast */
.toast {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 300px;
  max-width: 400px;
  pointer-events: auto;
  animation: toast-slide-in 0.3s ease-out;
  transition: all 0.3s ease;
}

/* Toast-Typen */
.toast.success {
  border-left: 4px solid #22c55e;
}

.toast.error {
  border-left: 4px solid #ef4444;
}

.toast.warning {
  border-left: 4px solid #f59e0b;
}

.toast.info {
  border-left: 4px solid #3b82f6;
}

/* Toast-Icon */
.toast-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 14px;
  font-weight: bold;
}

.toast.success .toast-icon {
  background: #dcfce7;
  color: #16a34a;
}

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

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

.toast.info .toast-icon {
  background: #dbeafe;
  color: #2563eb;
}

/* Toast-Content */
.toast-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toast-title {
  font-size: 14px;
  font-weight: 600;
  color: #14161B;
  line-height: 1.4;
}

.toast-message {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
}

/* Toast-Close-Button */
.toast-close {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
  font-size: 18px;
  line-height: 1;
  padding: 0;
}

.toast-close:hover {
  background: #f3f4f6;
  color: #4b5563;
}

/* Progress-Bar (Auto-Dismiss) */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}

.toast-progress-bar {
  height: 100%;
  background: currentColor;
  animation: toast-progress 5s linear;
  transform-origin: left;
}

.toast.success .toast-progress-bar {
  background: #22c55e;
}

.toast.error .toast-progress-bar {
  background: #ef4444;
}

.toast.warning .toast-progress-bar {
  background: #f59e0b;
}

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

/* Animationen */
@keyframes toast-slide-in {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toast-slide-out {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

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

/* Toast wird entfernt */
.toast.removing {
  animation: toast-slide-out 0.3s ease-in forwards;
}

/* Mobile Anpassungen */
@media (max-width: 768px) {
  #toast-container {
    top: 70px;
    right: 10px;
    left: 10px;
    max-width: none;
  }

  .toast {
    min-width: auto;
    max-width: none;
  }
}

/* Dark Mode Support (optional) */
@media (prefers-color-scheme: dark) {
  .toast {
    background: #1f2937;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
  }

  .toast-title {
    color: #f9fafb;
  }

  .toast-message {
    color: #d1d5db;
  }

  .toast-close {
    color: #9ca3af;
  }

  .toast-close:hover {
    background: #374151;
    color: #e5e7eb;
  }
}
