/**
 * Toast-Benachrichtigungssystem (Frontend).
 *
 * Styling für Toast-Nachrichten mit Progress-Bar und Hover-Pause.
 */

#toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 99999999;
  pointer-events: none;
}

#toast .toast {
  position: relative;
  background-color: var(--success-color, #4CAF50);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--border-radius, 8px);
  margin-top: 10px;
  box-shadow: var(--box-shadow, 0 4px 12px rgba(0, 0, 0, 0.15));
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 250px;
  max-width: 400px;
  font-family: var(--font-body, 'Open Sans', sans-serif);
  font-size: 14px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease-in-out;
  overflow: hidden;
  pointer-events: auto;
}

#toast .toast.warning {
  background-color: var(--warning-color, #ff9800);
}

#toast .toast.error {
  background-color: var(--danger-color, #f44336);
}

#toast .progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  background-color: rgba(255, 255, 255, 0.8);
  width: 100%;
  transform: scaleX(1);
  transform-origin: left;
  transition: transform linear;
}

#toast .toast span:last-child {
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  padding: 0 0 0 10px;
  margin-left: 10px;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s;
}

#toast .toast span:last-child:hover {
  opacity: 1;
}

@media (max-width: 768px) {
  #toast {
    bottom: 10px;
    right: 10px;
    left: 10px;
  }

  #toast .toast {
    min-width: auto;
    max-width: none;
    width: 100%;
    margin-top: 8px;
    padding: 14px 20px;
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  #toast .toast {
    padding: 16px 18px;
    border-radius: 6px;
  }

  #toast .toast span:last-child {
    font-size: 20px;
    padding-left: 12px;
    margin-left: 12px;
  }
}

#toast .toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-color-scheme: dark) {
  #toast .toast {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }
}


