/**
 * Système de Notifications Toast — Congrès SEP 2027
 * Charte & Tokens Éducation Populaire Engagée
 * Accessible WCAG 2.2 AA
 */

.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
  width: calc(100vw - 32px);
  pointer-events: none;
}

@media (max-width: 640px) {
  .toast-container {
    top: auto;
    bottom: 84px; /* Au-dessus de la barre de navigation mobile */
    right: 16px;
    left: 16px;
    width: auto;
  }
}

.toast-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.98);
  color: #0e1c30;
  border-radius: 10px;
  border-left: 5px solid #00668a;
  box-shadow: 0 10px 25px -5px rgba(14, 28, 48, 0.18), 0 8px 10px -6px rgba(14, 28, 48, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(-12px) scale(0.96);
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.toast-item.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast-item.is-hiding {
  opacity: 0;
  transform: translateX(30px) scale(0.95);
}

/* Variantes thématiques */
.toast-item--success {
  border-left-color: #00875a;
  background: #f0fbf6;
}
.toast-item--success .toast-icon {
  color: #006c49;
  background: #d4f4e2;
}

.toast-item--error {
  border-left-color: #ba1a1a;
  background: #fff5f5;
}
.toast-item--error .toast-icon {
  color: #ba1a1a;
  background: #ffdad6;
}

.toast-item--warning {
  border-left-color: #b5005c;
  background: #fff0f5;
}
.toast-item--warning .toast-icon {
  color: #b5005c;
  background: #ffd9e1;
}

.toast-item--info {
  border-left-color: #00668a;
  background: #f0f7fb;
}
.toast-item--info .toast-icon {
  color: #00668a;
  background: #c4e7ff;
}

/* Icône de statut */
.toast-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
}

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

.toast-title {
  font-family: var(--font-display, 'Clash Display', sans-serif);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
  color: #0e1c30;
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}

.toast-message {
  font-family: var(--font-body, 'Geist', sans-serif);
  font-size: 0.875rem;
  line-height: 1.35;
  color: #3e484f;
}

/* Bouton Fermer */
.toast-close {
  background: transparent;
  border: none;
  color: #6e7880;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}

.toast-close:hover,
.toast-close:focus-visible {
  color: #0e1c30;
  background: rgba(0, 0, 0, 0.06);
  outline: none;
}

/* Barre de progression */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: rgba(0, 102, 138, 0.25);
  transform-origin: left;
  animation: toast-progress-bar linear forwards;
}

.toast-item--success .toast-progress {
  background: #00875a;
}
.toast-item--error .toast-progress {
  background: #ba1a1a;
}
.toast-item--warning .toast-progress {
  background: #b5005c;
}
.toast-item--info .toast-progress {
  background: #00668a;
}

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