/* =========================================
   MODULE: Professional Toast System
   STYLE: Glassmorphism & Animations
   ========================================= */

#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none; /* کلیک‌های پشت نوار رد شود */
}

/* در موبایل پیام‌ها به وسط و پایین منتقل می‌شوند */
@media (max-width: 576px) {
  #toast-container {
    top: auto;
    bottom: 24px;
    right: 20px;
    left: 20px;
    align-items: center;
  }
}

.toast-box {
  pointer-events: auto; /* خود پیام قابل کلیک باشد */
  min-width: 280px;
  max-width: 400px;
  background: rgba(20, 20, 25, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  cursor: pointer;
  
  /* انیمیشن اولیه */
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast-box.show {
  opacity: 1;
  transform: translateX(0);
}

.toast-box.hide {
  opacity: 0;
  transform: scale(0.9);
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.toast-icon {
  font-size: 1.25rem;
}

.toast-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.5;
}

/* نوار زمان‌سنج (Progress Bar) */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
}

.toast-progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: currentColor; /* همرنگ با نوع پیام */
  animation: toastProgress linear forwards;
}

@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}

/* رنگ‌بندی انواع پیام‌ها */
.toast-success { border-left: 4px solid #2ecc71; color: #2ecc71; }
.toast-error   { border-left: 4px solid #e74c3c; color: #e74c3c; }
.toast-info    { border-left: 4px solid #c9a84c; color: #c9a84c; } /* رنگ طلایی برند شما */
.toast-warning { border-left: 4px solid #f1c40f; color: #f1c40f; }

/* هماهنگی با زبان‌های چپ‌چین (LTR) */
html[dir="ltr"] .toast-box {
  transform: translateX(-50px);
  border-left: none;
}
html[dir="ltr"] .toast-box.show { transform: translateX(0); }
html[dir="ltr"] .toast-success { border-right: 4px solid #2ecc71; }
html[dir="ltr"] .toast-error   { border-right: 4px solid #e74c3c; }
html[dir="ltr"] .toast-info    { border-right: 4px solid #c9a84c; }
html[dir="ltr"] .toast-warning { border-right: 4px solid #f1c40f; }