/* ============================================
   UTILITIES - Toast, Loading, Animations, Helpers
   Finanzberatung CRM
   ============================================ */

/* Text Utilities */
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-light); }
.text-primary { color: var(--primary); }

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 420px;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  font-family: var(--font-body);
  backdrop-filter: blur(8px);
}

.toast.toast-success {
  background: linear-gradient(135deg, var(--success-bg) 0%, #dcfce7 100%);
  border-left: 4px solid var(--success);
  color: #166534;
}

.toast.toast-error {
  background: linear-gradient(135deg, var(--danger-bg) 0%, #fee2e2 100%);
  border-left: 4px solid var(--danger);
  color: #991b1b;
}

.toast.toast-warning {
  background: linear-gradient(135deg, var(--warning-bg) 0%, #fef3c7 100%);
  border-left: 4px solid var(--warning);
  color: #92400e;
}

.toast.toast-info {
  background: linear-gradient(135deg, var(--primary-subtle) 0%, #dcfce7 100%);
  border-left: 4px solid var(--primary);
  color: var(--primary-dark);
}

.toast-icon {
  font-size: 18px;
  font-weight: bold;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.toast.hiding {
  animation: slideOut 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideIn {
  from {
    transform: translateX(100%) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
  to {
    transform: translateX(100%) scale(0.95);
    opacity: 0;
  }
}

/* Loading spinner */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
}

.loading-overlay.active {
  display: flex;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive Utilities */
@media (max-width: 600px) {
  .header {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 16px;
  }

  .toast-container {
    left: 16px;
    right: 16px;
  }

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

/* Animation utilities */
.fade-in {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.slide-up {
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
