/* ============================================
   KELIBATMU V2 - GLOBAL TOAST NOTIFICATIONS
   Fixed cinematic message layer. No layout shift.
   Namespace: kv2-toast
   ============================================ */

.kv2-toast {
  position: fixed;
  top: calc(var(--navbar-height-desktop, 72px) + 18px);
  right: max(18px, env(safe-area-inset-right));
  z-index: var(--z-toast, 900);
  width: min(360px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

body.kv2-mv-overlay-open .kv2-toast {
  z-index: 5100;
}

.kv2-toast__item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 12px 10px 12px 15px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(19, 19, 23, 0.84), rgba(7, 7, 10, 0.92));
  color: rgba(255, 255, 255, 0.92);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transition:
    opacity var(--transition-smooth, 0.3s) var(--ease-soft, ease),
    transform var(--transition-smooth, 0.3s) var(--ease-soft, ease);
}

.kv2-toast__item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 999px;
  background: rgba(200, 200, 200, 0.44);
}

.kv2-toast__item--visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.kv2-toast__item--leaving {
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
}

.kv2-toast__glow {
  position: absolute;
  inset: -30% auto auto -20%;
  width: 170px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.035);
  filter: blur(24px);
  pointer-events: none;
}

.kv2-toast__body {
  position: relative;
  min-width: 0;
}

.kv2-toast__message {
  margin: 0;
  color: inherit;
  font-size: var(--kv2-font-small, 0.9rem);
  font-weight: 560;
  line-height: 1.42;
  letter-spacing: 0;
}

.kv2-toast__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.kv2-toast__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
  font-size: var(--kv2-font-caption, 0.78rem);
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.kv2-toast__cta--primary {
  border-color: rgba(141, 245, 143, 0.18);
  background: rgba(141, 245, 143, 0.09);
}

.kv2-toast__close {
  position: relative;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.055);
  color: rgba(255, 255, 255, 0.62);
  cursor: pointer;
}

.kv2-toast__close:hover,
.kv2-toast__close:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.94);
  outline: none;
}

.kv2-toast__close-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.kv2-toast__item--success::before {
  background: rgba(141, 245, 143, 0.78);
  box-shadow: 0 0 16px rgba(141, 245, 143, 0.18);
}

.kv2-toast__item--error::before {
  background: rgba(220, 88, 88, 0.86);
  box-shadow: 0 0 16px rgba(220, 88, 88, 0.2);
}

.kv2-toast__item--warning::before {
  background: rgba(220, 174, 88, 0.86);
  box-shadow: 0 0 16px rgba(220, 174, 88, 0.16);
}

.kv2-toast__item--info::before,
.kv2-toast__item--debug::before {
  background: rgba(165, 185, 220, 0.72);
}

.kv2-toast__item--guest-preview {
  position: fixed;
  top: calc(var(--navbar-height-desktop, 72px) + 16px);
  left: 50%;
  width: min(430px, calc(100vw - 32px));
  transform: translateX(-50%) translateY(-8px) scale(0.98);
}

.kv2-toast__item--guest-preview.kv2-toast__item--visible {
  transform: translateX(-50%) translateY(0) scale(1);
}

.kv2-toast__item--guest-preview.kv2-toast__item--leaving {
  transform: translateX(-50%) translateY(-6px) scale(0.98);
}

.kv2-toast__item--guest-preview .kv2-toast__actions {
  gap: 10px;
}

.kv2-toast__item--guest-preview .kv2-toast__cta {
  min-height: 32px;
}

@media (max-width: 768px) {
  .kv2-toast {
    top: calc(58px + env(safe-area-inset-top) + 10px);
    left: 12px;
    right: 12px;
    width: auto;
  }

  .kv2-toast__item {
    min-height: 54px;
    border-radius: 16px;
    padding: 11px 9px 11px 14px;
  }

  .kv2-toast__item--guest-preview {
    top: calc(58px + env(safe-area-inset-top) + 10px);
    width: calc(100vw - 24px);
  }
}

@media (max-width: 480px) {
  .kv2-toast {
    top: calc(54px + env(safe-area-inset-top) + 8px);
  }

  .kv2-toast__item--guest-preview {
    top: calc(54px + env(safe-area-inset-top) + 8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .kv2-toast__item {
    transition: none !important;
  }
}
