/* --------------------------------------------------------------------------
   Toast bildirimleri — beyaz zemin, siyah metin, ikon + metin dikey ortalı
   -------------------------------------------------------------------------- */

.toast-container {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.625rem;
  max-width: min(420px, calc(100vw - 2rem));
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.toast-container.top-right {
  top: 1.25rem;
  right: 1.25rem;
}

.toast-container.top-left {
  top: 1.25rem;
  left: 1.25rem;
}

.toast-container.top-center {
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
}

.toast-container.bottom-right {
  bottom: 1.25rem;
  right: 1.25rem;
}

.toast-container.bottom-left {
  bottom: 1.25rem;
  left: 1.25rem;
}

.toast-container.bottom-center {
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
}

/* Kart gövdesi */
.toasts {
  --toast-accent: #64748b;
  --toast-icon-bg: rgba(100, 116, 139, 0.12);
  --toast-icon-fg: #475569;

  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 1rem 0.75rem 0.75rem;
  margin: 0;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-inline-start: 3px solid var(--toast-accent);
  background: #fff;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.06),
    0 8px 24px rgba(0, 0, 0, 0.1);
  color: #000;
  font-family:
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    sans-serif;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.01em;
  min-width: min(300px, 100%);
  max-width: 100%;
  user-select: none;
}

.toasts .message {
  flex: 1;
  margin: 0;
  padding: 0;
  word-break: break-word;
}

/* İkon alanı — yuvarlatılmış “squircle” */
.toasts .icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0;
  border-radius: 12px;
  font-size: 1.35rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--toast-icon-bg);
  color: var(--toast-icon-fg);
  transition: transform 0.2s ease;
}

.toasts.success {
  --toast-accent: #22c55e;
  --toast-icon-bg: linear-gradient(145deg, #dcfce7 0%, #bbf7d0 100%);
  --toast-icon-fg: #15803d;
}

.toasts.success .icon {
  background: var(--toast-icon-bg);
}

.toasts.error {
  --toast-accent: #ef4444;
  --toast-icon-bg: linear-gradient(145deg, #fee2e2 0%, #fecaca 100%);
  --toast-icon-fg: #b91c1c;
}

.toasts.info {
  --toast-accent: #3b82f6;
  --toast-icon-bg: linear-gradient(145deg, #dbeafe 0%, #bfdbfe 100%);
  --toast-icon-fg: #1d4ed8;
}

.toasts.couponSuccess {
  --toast-accent: #6366f1;
  --toast-icon-bg: linear-gradient(145deg, #e0e7ff 0%, #c7d2fe 100%);
  --toast-icon-fg: #4338ca;
  background: #fff;
  color: #000;
}

.toasts.couponSuccess .icon {
  background: var(--toast-icon-bg);
}

.toasts.couponError {
  --toast-accent: #dc2626;
  --toast-icon-bg: linear-gradient(145deg, #fee2e2 0%, #fca5a5 100%);
  --toast-icon-fg: #991b1b;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-inline-start: 3px solid var(--toast-accent);
  background: #fff;
  color: #000;
}

.toasts.couponError .icon {
  background: var(--toast-icon-bg);
}

/* Remix icon — font metriklerinden kaynaklı dikey kaymayı azalt */
.toasts .icon i {
  font-size: inherit;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

/* Giriş / çıkış animasyonları */
@keyframes toast-in-right {
  from {
    opacity: 0;
    transform: translate3d(1.25rem, 0, 0) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes toast-out-right {
  from {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    opacity: 0;
    transform: translate3d(1.25rem, 0, 0) scale(0.96);
  }
}

@keyframes toast-in-left {
  from {
    opacity: 0;
    transform: translate3d(-1.25rem, 0, 0) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes toast-out-left {
  from {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    opacity: 0;
    transform: translate3d(-1.25rem, 0, 0) scale(0.96);
  }
}

@keyframes toast-in-top {
  from {
    opacity: 0;
    transform: translateY(-0.75rem) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-out-top {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-0.75rem) scale(0.96);
  }
}

@keyframes toast-in-bottom {
  from {
    opacity: 0;
    transform: translateY(0.75rem) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-out-bottom {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(0.75rem) scale(0.96);
  }
}

.slide-in-right {
  animation: toast-in-right 0.42s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.slide-out-right {
  animation: toast-out-right 0.32s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.slide-in-left {
  animation: toast-in-left 0.42s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.slide-out-left {
  animation: toast-out-left 0.32s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.slide-in-top {
  animation: toast-in-top 0.42s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.slide-out-top {
  animation: toast-out-top 0.32s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.slide-in-bottom {
  animation: toast-in-bottom 0.42s cubic-bezier(0.16,  1, 0.3, 1) forwards;
}

.slide-out-bottom {
  animation: toast-out-bottom 0.32s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@media (prefers-reduced-motion: reduce) {
  .slide-in-right,
  .slide-in-left,
  .slide-in-top,
  .slide-in-bottom,
  .slide-out-right,
  .slide-out-left,
  .slide-out-top,
  .slide-out-bottom {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
