/* Toast notifications — bottom-right */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: 6px;
  background: var(--ff-black);
  border: 1px solid var(--ff-gray-6);
  color: var(--ff-white);
  font-family: var(--ff-font-body);
  font-size: 0.92em;
  font-weight: 500;
  box-shadow: 0 6px 24px var(--ff-black-a25);
  pointer-events: auto;
  animation: toast-in 0.3s ease-out;
  min-width: 280px;
  max-width: 420px;
}

.toast i {
  font-size: 1.1em;
  flex-shrink: 0;
}

/* Purpose colour: a solid background per type (the validated success and error
   look), warning and info follow the same pattern. */
.toast-success {
  background-color: var(--ff-success);
  border: 1px solid var(--ff-success);
}

.toast-error {
  background-color: var(--ff-danger);
  border: 1px solid var(--ff-danger);
}

/* Dark amber keeps white text readable. */
.toast-warning {
  background-color: var(--ff-warning);
  border: 1px solid var(--ff-warning);
}

.toast-info {
  background-color: var(--ff-info);
  border: 1px solid var(--ff-info);
}

.toast-message {
  flex: 1;
  line-height: 1.4;
}

/* Stable error reference (FFA-XXX-NNN) under the message. Present so a user can
   quote it to support, discreet so it never competes with the message itself. */
.toast-code {
  display: block;
  margin-top: 3px;
  font-size: 0.78em;
  opacity: 0.65;
  letter-spacing: 0.04em;
}

.toast-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--ff-white-a85);
  font-size: 1.1em;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.toast-close:hover { color: var(--ff-white); }

.toast-out {
  animation: toast-out 0.25s ease-in forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}

/* ── Friend request toast ── */
.toast-friend-request {
  background: var(--ff-black) !important;
  border: 1px solid var(--ff-gray-6) !important;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 14px 18px;
  max-width: 380px;
}

.toast-friend-request .toast-fr-header {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.toast-friend-request .toast-fr-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.toast-friend-request .toast-fr-text {
  flex: 1;
  font-size: 0.9em;
  line-height: 1.4;
}

.toast-friend-request .toast-fr-actions {
  display: flex;
  gap: 8px;
  width: 100%;
}

.toast-friend-request .toast-fr-accept {
  padding: 6px 16px;
  background: var(--ff-white);
  color: var(--ff-black);
  border: none;
  border-radius: 4px;
  font-family: var(--ff-font-body);
  font-size: 0.85em;
  font-weight: 600;
  cursor: pointer;
}

.toast-friend-request .toast-fr-accept:hover {
  background: var(--ff-gray-2);
}

.toast-friend-request .toast-fr-decline {
  padding: 6px 16px;
  background: transparent;
  color: var(--ff-white);
  border: 1px solid var(--ff-white-a40);
  border-radius: 4px;
  font-family: var(--ff-font-body);
  font-size: 0.85em;
  cursor: pointer;
}

.toast-friend-request .toast-fr-decline:hover {
  border-color: var(--ff-white);
}

.toast-friend-request .toast-fr-result {
  font-size: 0.85em;
  padding: 4px 0;
}
.toast-friend-request .toast-fr-result.is-ok { color: var(--ff-success); }
.toast-friend-request .toast-fr-result.is-err { color: var(--ff-danger); }

@media (max-width: 480px) {
  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }
  .toast {
    min-width: 0;
    max-width: none;
  }
}
