/* ============================================================
   RICH TOAST NOTIFICATION STYLES — World Class
   ============================================================ */

/* ══════════════════════════════════════════════════════════
   1. CONTAINER POSITIONS
   ══════════════════════════════════════════════════════════ */

.toast-container {
  position: fixed;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: 420px;
  width: 100%;
}

.toast-container.top-right {
  top: 20px;
  right: 20px;
}

.toast-container.top-left {
  top: 20px;
  left: 20px;
}

.toast-container.bottom-right {
  bottom: 20px;
  right: 20px;
}

.toast-container.bottom-left {
  bottom: 20px;
  left: 20px;
}

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

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

/* ══════════════════════════════════════════════════════════
   2. RICH TOAST CARD
   ══════════════════════════════════════════════════════════ */

.rich-toast {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--toast-bg, rgba(255,255,255,0.08));
  backdrop-filter: blur(20px) saturate(1.8);
  border: 1px solid var(--toast-border, rgba(255,255,255,0.12));
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6),
              0 0 0 1px rgba(255, 255, 255, 0.05);
  pointer-events: auto;
  overflow: hidden;
  opacity: 0;
  transform: translateX(100%) scale(0.95);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform, opacity;
}

.rich-toast.show {
  opacity: 1;
  transform: translateX(0) translateY(var(--stack-offset, 0)) scale(1);
}

.rich-toast.removing {
  opacity: 0;
  transform: translateX(120%) scale(0.9);
  transition: all 0.3s cubic-bezier(0.4, 0, 1, 1);
}

/* ══════════════════════════════════════════════════════════
   3. TOAST ICON
   ══════════════════════════════════════════════════════════ */

.toast-icon-wrap {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--toast-bg, rgba(255,255,255,0.05));
  border: 1px solid var(--toast-border, rgba(255,255,255,0.1));
  border-radius: 10px;
  font-size: 1.3rem;
  animation: icon-bounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes icon-bounce {
  0% {
    transform: scale(0) rotate(-180deg);
  }
  50% {
    transform: scale(1.2) rotate(10deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

.toast-icon {
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

/* ══════════════════════════════════════════════════════════
   4. TOAST CONTENT
   ══════════════════════════════════════════════════════════ */

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--toast-color, var(--t1));
  margin-bottom: 4px;
  line-height: 1.3;
}

.toast-message {
  font-size: 0.85rem;
  color: var(--t2);
  line-height: 1.5;
  word-wrap: break-word;
}

/* ══════════════════════════════════════════════════════════
   5. ACTION BUTTON
   ══════════════════════════════════════════════════════════ */

.toast-action-btn {
  flex-shrink: 0;
  padding: 6px 14px;
  background: var(--toast-color, var(--blue));
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.toast-action-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.toast-action-btn:active {
  transform: scale(0.98);
}

/* ══════════════════════════════════════════════════════════
   6. CLOSE BUTTON
   ══════════════════════════════════════════════════════════ */

.toast-close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--t3);
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
}

.rich-toast:hover .toast-close-btn {
  opacity: 1;
}

.toast-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--t1);
  transform: scale(1.1);
}

.toast-close-btn:active {
  transform: scale(0.95);
}

/* ══════════════════════════════════════════════════════════
   7. PROGRESS BAR
   ══════════════════════════════════════════════════════════ */

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--toast-color, var(--blue));
  border-radius: 0 0 14px 14px;
  transform-origin: left;
  animation: toast-progress 4500ms linear;
  opacity: 0.6;
  box-shadow: 0 0 8px var(--toast-color, var(--blue));
}

@keyframes toast-progress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

/* ══════════════════════════════════════════════════════════
   8. TYPE-SPECIFIC GLOW EFFECTS
   ══════════════════════════════════════════════════════════ */

.rich-toast.success {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6),
              0 0 0 1px rgba(6, 214, 160, 0.2),
              0 0 20px rgba(6, 214, 160, 0.1);
}

.rich-toast.error {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6),
              0 0 0 1px rgba(232, 52, 74, 0.2),
              0 0 20px rgba(232, 52, 74, 0.1);
}

.rich-toast.warning {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6),
              0 0 0 1px rgba(240, 180, 41, 0.2),
              0 0 20px rgba(240, 180, 41, 0.1);
}

.rich-toast.payment,
.rich-toast.info {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6),
              0 0 0 1px rgba(79, 142, 247, 0.2),
              0 0 20px rgba(79, 142, 247, 0.1);
}

/* ══════════════════════════════════════════════════════════
   9. MOBILE RESPONSIVENESS
   ══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .toast-container {
    max-width: calc(100% - 32px);
    left: 16px !important;
    right: 16px !important;
    transform: none !important;
  }

  .rich-toast {
    padding: 14px;
    gap: 10px;
  }

  .toast-icon-wrap {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }

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

  .toast-message {
    font-size: 0.8rem;
  }

  .toast-action-btn {
    padding: 5px 12px;
    font-size: 0.75rem;
  }
}

/* ══════════════════════════════════════════════════════════
   10. LOADING STATE
   ══════════════════════════════════════════════════════════ */

.rich-toast .toast-icon-wrap.loading {
  animation: icon-bounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
             loading-spin 2s linear infinite;
}

@keyframes loading-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ══════════════════════════════════════════════════════════
   11. HOVER EFFECTS
   ══════════════════════════════════════════════════════════ */

.rich-toast:hover {
  transform: translateX(-4px) translateY(var(--stack-offset, 0)) scale(1);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7),
              0 0 0 1px var(--toast-border);
}

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

/* ══════════════════════════════════════════════════════════
   12. ACCESSIBILITY
   ══════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .rich-toast,
  .toast-icon-wrap,
  .toast-action-btn,
  .toast-close-btn {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }

  .rich-toast.show {
    transform: translateX(0) translateY(var(--stack-offset, 0));
  }
}

/* ══════════════════════════════════════════════════════════
   13. DARK MODE ADJUSTMENTS (if applicable)
   ══════════════════════════════════════════════════════════ */

@media (prefers-color-scheme: light) {
  .rich-toast {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  }

  .toast-message {
    color: #4a5568;
  }
}

/* ══════════════════════════════════════════════════════════
   14. PRINT STYLES (hide toasts when printing)
   ══════════════════════════════════════════════════════════ */

@media print {
  .toast-container {
    display: none !important;
  }
}

/* ══════════════════════════════════════════════════════════
   15. STACKING EFFECT
   ══════════════════════════════════════════════════════════ */

.rich-toast {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Older toasts slightly fade and scale down */
.toast-container .rich-toast:not(:last-child) {
  opacity: 0.9;
  transform: scale(0.98) translateY(var(--stack-offset, 0));
}

.toast-container .rich-toast:nth-last-child(2) {
  opacity: 0.8;
}

.toast-container .rich-toast:nth-last-child(3) {
  opacity: 0.7;
}
