/**
 * UI COMPONENTS
 * Styles pour les composants UI dynamiques (loader, toast, empty state, etc.)
 */

/* ============================================
   LOADER / SPINNER
   ============================================ */

.loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 20px;
}

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

.loader-message {
  color: var(--color-text-primary);
  font-weight: 600;
  font-size: var(--text-base);
}

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

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
  text-align: center;
  padding: 80px 20px;
}

.empty-state__icon {
  font-size: 80px !important;
  color: var(--slate-300);
  display: block;
  margin-bottom: 20px;
}

.empty-state__message {
  font-size: 18px;
  font-weight: 500;
  color: var(--color-text-primary);
}

/* ============================================
   ERROR STATE
   ============================================ */

.error-state {
  text-align: center;
  padding: 80px 20px;
}

.error-state__icon {
  font-size: 80px !important;
  color: var(--red-400);
  display: block;
  margin-bottom: 20px;
}

.error-state__message {
  font-size: 18px;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: 30px;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  pointer-events: none;
}

@media (max-width: 768px) {
  #toast-container {
    left: 20px;
    right: 20px;
    max-width: none;
  }
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: slideInRight 0.3s ease-out;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.2s ease;
}

.toast:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.toast--success {
  border-left: 4px solid #16a34a;
}

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

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

.toast--info {
  border-left: 4px solid #0284c7;
}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

/* ============================================
   FADE ANIMATIONS
   ============================================ */

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* ============================================
   STATS
   ============================================ */

.stat__icon {
  font-size: 48px !important;
  color: var(--color-primary);
  margin-bottom: 12px;
}
