/**
 * @file
 * Styles pour les toasts de messages système Drupal.
 */

/* Masquer les messages originaux par défaut (ils seront convertis en toasts) */
[data-drupal-messages] .messages,
[data-drupal-messages] > div[role="contentinfo"] {
  display: none !important;
}

/* Conteneur des toasts */
.drupal-toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  pointer-events: none;
}

/* Toast individuel */
.drupal-toast {
  position: relative;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 16px 48px 16px 16px;
  min-width: 300px;
  max-width: 100%;
  opacity: 0;
  transform: translateX(100%);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: auto;
  border-left: 4px solid;
}

/* Toast visible */
.drupal-toast--visible {
  opacity: 1;
  transform: translateX(0);
}

/* Toast en cours de suppression */
.drupal-toast--removing {
  opacity: 0;
  transform: translateX(100%);
}

/* Types de messages */
.drupal-toast--status {
  border-left-color: #28a745;
  background-color: #f0f9f4;
}

.drupal-toast--warning {
  border-left-color: #ffc107;
  background-color: #fffbf0;
}

.drupal-toast--error {
  border-left-color: #dc3545;
  background-color: #fff5f5;
}

/* Contenu du toast */
.drupal-toast__content {
  color: #333;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.drupal-toast--status .drupal-toast__content {
  color: #155724;
}

.drupal-toast--warning .drupal-toast__content {
  color: #856404;
}

.drupal-toast--error .drupal-toast__content {
  color: #721c24;
}

/* Bouton de fermeture */
.drupal-toast__close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: #666;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.2s ease, color 0.2s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drupal-toast__close:hover,
.drupal-toast__close:focus {
  background-color: rgba(0, 0, 0, 0.1);
  color: #000;
  outline: none;
}

.drupal-toast--status .drupal-toast__close {
  color: #28a745;
}

.drupal-toast--status .drupal-toast__close:hover,
.drupal-toast--status .drupal-toast__close:focus {
  background-color: rgba(40, 167, 69, 0.1);
  color: #155724;
}

.drupal-toast--warning .drupal-toast__close {
  color: #ffc107;
}

.drupal-toast--warning .drupal-toast__close:hover,
.drupal-toast--warning .drupal-toast__close:focus {
  background-color: rgba(255, 193, 7, 0.1);
  color: #856404;
}

.drupal-toast--error .drupal-toast__close {
  color: #dc3545;
}

.drupal-toast--error .drupal-toast__close:hover,
.drupal-toast--error .drupal-toast__close:focus {
  background-color: rgba(220, 53, 69, 0.1);
  color: #721c24;
}

/* Responsive */
@media screen and (max-width: 768px) {
  .drupal-toast-container {
    bottom: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }

  .drupal-toast {
    min-width: auto;
    width: 100%;
  }
}

