/**
 * Système de Notifications Toast - Styles
 */

/* Conteneur principal */
.toast-container {
  position: fixed !important;
  top: 20px !important;
  right: 20px !important;
  bottom: auto !important;
  left: auto !important;
  z-index: 9999 !important;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  pointer-events: none;
}

/* Toast de base */
.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: rgba(26, 31, 58, 0.95);
  backdrop-filter: blur(16px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 
              0 1px 8px rgba(0, 0, 0, 0.2);
  min-width: 320px;
  max-width: 400px;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: all;
  position: relative;
  overflow: hidden;
}

/* Animation d'entrée */
.toast-show {
  opacity: 1;
  transform: translateX(0);
}

/* Animation de sortie */
.toast-hide {
  opacity: 0;
  transform: translateX(400px) scale(0.8);
}

/* Icône */
.toast-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

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

.toast-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
  color: white;
}

.toast-message {
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  word-wrap: break-word;
}

/* Bouton de fermeture */
.toast-close {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.6);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}

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

/* Progress bar */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
  transform-origin: left;
  animation: toast-progress 4s linear forwards;
}

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

/* === TYPES DE TOASTS === */

/* Success */
.toast-success {
  border-left: 4px solid #10b981;
}

.toast-success .toast-icon {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

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

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

.toast-error .toast-icon {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

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

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

.toast-warning .toast-icon {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

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

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

.toast-info .toast-icon {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

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

/* === RESPONSIVE === */

@media (max-width: 768px) {
  .toast-container {
    top: 10px !important;
    right: 10px !important;
    left: 10px !important;
    bottom: auto !important;
    max-width: none;
  }

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

/* === ANIMATIONS HOVER === */

.toast:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4), 
              0 2px 10px rgba(0, 0, 0, 0.3);
}

.toast:hover .toast-progress {
  animation-play-state: paused;
}

/* === ACCESSIBILITÉ === */

@media (prefers-reduced-motion: reduce) {
  .toast {
    transition: opacity 0.3s ease;
    transform: none;
  }

  .toast-show {
    transform: none;
  }

  .toast-hide {
    transform: none;
  }

  .toast-close:hover {
    transform: none;
  }
}
