/* =========================================================
   Educar Cursos — Toast notifications (global)
   Tipos: success | error | warning | info
   ========================================================= */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
  width: calc(100% - 40px);
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.14);
  border-left: 4px solid #6b7280;
  animation: toast-in 0.3s ease forwards;
  position: relative;
  overflow: hidden;
}

.toast.is-leaving {
  animation: toast-out 0.25s ease forwards;
}

.toast-success { border-left-color: #27ae60; }
.toast-error   { border-left-color: #e74c3c; }
.toast-warning { border-left-color: #f39c12; }
.toast-info    { border-left-color: #3498db; }

.toast-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
  color: #fff;
  margin-top: 1px;
}

.toast-success .toast-icon { background: #27ae60; }
.toast-error   .toast-icon { background: #e74c3c; }
.toast-warning .toast-icon { background: #f39c12; }
.toast-info    .toast-icon { background: #3498db; }

.toast-body {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 2px;
  line-height: 1.3;
}

.toast-message {
  font-size: 13px;
  color: #4b5563;
  line-height: 1.45;
  margin: 0;
}

.toast-close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  color: #9aa0a6;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.toast-close:hover {
  color: #374151;
  background: #f4f5f7;
}

/* Barra de progresso (tempo restante) */
.toast-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  transform-origin: left center;
  animation: toast-progress linear forwards;
}

.toast-success .toast-progress { background: #27ae60; }
.toast-error   .toast-progress { background: #e74c3c; }
.toast-warning .toast-progress { background: #f39c12; }
.toast-info    .toast-progress { background: #3498db; }

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(24px);
  }
}

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

@media (max-width: 480px) {
  .toast-container {
    top: auto;
    bottom: 16px;
    right: 12px;
    left: 12px;
    max-width: none;
    width: auto;
  }

  @keyframes toast-in {
    from {
      opacity: 0;
      transform: translateY(16px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes toast-out {
    from {
      opacity: 1;
      transform: translateY(0);
    }
    to {
      opacity: 0;
      transform: translateY(16px);
    }
  }
}
