/* ═══════════════════════════════════════════
   HIGHPEX — Liquid Glass Toast System
   Apple-style animated notifications
   ═══════════════════════════════════════════ */

/* ── Toast Container ── */
.toast-container {
  position: fixed;
  top: 90px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: 400px;
  width: 100%;
}

/* ── Base Toast ── */
.toast {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 20px;
  position: relative;
  pointer-events: auto;
  cursor: default;

  /* Liquid glass */
  background: rgba(20, 20, 35, 0.85);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.4),
    0 4px 12px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(255, 255, 255, 0.03);

  /* Animation */
  opacity: 0;
  transform: translateX(120%) scale(0.85);
  animation: toastSlideIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Top shimmer */
.toast::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20px;
  right: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25) 50%, transparent);
  pointer-events: none;
  z-index: 1;
}

/* Inner glow */
.toast::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), transparent);
  pointer-events: none;
}

/* ── Icon ── */
.toast-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 5;
}

.toast-icon svg {
  display: block;
}

/* ── Content ── */
.toast-content {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 5;
  padding-top: 2px;
}

.toast-title {
  font-family: 'Sora', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
  line-height: 1.3;
}

.toast-message {
  font-size: 0.83rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.55;
}

/* ── Close ── */
.toast-close {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  position: relative;
  z-index: 5;
  margin-top: 1px;
}

.toast-close svg {
  display: block;
}

.toast-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
}

/* ── Progress ── */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 0 20px 20px;
  z-index: 6;
  opacity: 0.7;
}

/* ═══════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════ */

@keyframes toastSlideIn {
  0% {
    opacity: 0;
    transform: translateX(120%) scale(0.85);
  }
  40% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastSlideOut {
  0% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(120%) scale(0.85);
  }
}

@keyframes progressShrink {
  from { width: 100%; }
  to { width: 0%; }
}

.toast.toast-exit {
  animation: toastSlideOut 0.4s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

.toast:hover .toast-progress {
  animation-play-state: paused;
}

/* ── Confirm / Prompt side alerts — stay open until the user acts, no timer ── */
.toast.toast-confirm {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.toast-confirm-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.toast-confirm-input {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  font-family: 'Inter', sans-serif;
  font-size: 0.86rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.toast-confirm-input:focus {
  border-color: rgba(99, 102, 241, 0.5);
}
.toast-confirm-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}
.toast-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  position: relative;
  z-index: 5;
}
.toast-confirm-btn {
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  border-radius: 9px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast-confirm-btn:active { transform: scale(0.96); }
.toast-confirm-btn.primary {
  color: #fff;
  background: linear-gradient(135deg, rgba(99,102,241,0.55), rgba(168,85,247,0.55));
}
.toast-confirm-btn.primary:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(99,102,241,0.3); }
.toast-confirm-btn.danger {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.4);
}
.toast-confirm-btn.danger:hover { background: rgba(239, 68, 68, 0.32); }
.toast-confirm-btn.secondary {
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.05);
}
.toast-confirm-btn.secondary:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */

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

  .toast {
    padding: 14px 16px;
    border-radius: 16px;
    gap: 12px;
  }

  .toast-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }

  .toast-title { font-size: 0.85rem; }
  .toast-message { font-size: 0.78rem; }
}
