/* ============================================
   Toast Notification Component
   ============================================ */

.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-2);
  pointer-events: none;
}

@media (max-width: 768px) {
  .toast-container {
    left: var(--space-4);
    right: var(--space-4);
    bottom: var(--space-4);
    align-items: stretch;
  }
}

/* ---- Toast ---- */
.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  min-width: 300px;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: slideUp var(--transition-spring) forwards;
  position: relative;
  overflow: hidden;
}

@media (max-width: 768px) {
  .toast {
    min-width: unset;
    max-width: unset;
  }
}

.toast.is-exiting {
  animation: fadeOut var(--transition-fast) forwards;
}

/* Left accent border */
.toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
}

/* ---- Variants ---- */
.toast--success::before { background: var(--color-green); }
.toast--error::before { background: var(--color-red); }
.toast--info::before { background: var(--color-cyan); }
.toast--reward::before { background: var(--color-gold); }

.toast--success .toast__icon { color: var(--color-green); }
.toast--error .toast__icon { color: var(--color-red); }
.toast--info .toast__icon { color: var(--color-cyan); }
.toast--reward .toast__icon { color: var(--color-gold); }

/* ---- Icon ---- */
.toast__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ---- Content ---- */
.toast__content {
  flex: 1;
  min-width: 0;
}

.toast__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: 2px;
}

.toast__message {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

/* ---- Close ---- */
.toast__close {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  background: none;
  border: none;
}

.toast__close:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.toast__close .icon {
  width: 14px;
  height: 14px;
}

/* ---- Progress Bar ---- */
.toast__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--text-muted);
  opacity: 0.3;
  animation: progressFill 4s linear forwards;
  animation-direction: reverse;
}

.toast--success .toast__progress { background: var(--color-green); }
.toast--error .toast__progress { background: var(--color-red); }
.toast--info .toast__progress { background: var(--color-cyan); }
.toast--reward .toast__progress { background: var(--color-gold); }
