/* ------------------------------------------------------------------- */
/* مكون الإشعار العائم (Toast Notification) */
/* ------------------------------------------------------------------- */
.toast-notification {
  position: fixed;
  top: 100px; /* التموضع في أعلى الشاشة */
  left: 50%; /* دفع نقطة البداية للمنتصف */
  z-index: 9999;
  background: rgba(242, 253, 245, 0.97); /* خلفية برائحة اللون الأخضر الفاتح */
  backdrop-filter: saturate(180%) blur(6px);
  border: 1px solid #d1fae5; /* إطار أخضر باهت */
  border-radius: 12px;
  /* ظل هندسي مشبع بدرجة خفيفة جداً من اللون الأخضر */
  box-shadow: 0 15px 35px -5px rgba(16, 185, 129, 0.12), 0 8px 10px -6px rgba(16, 185, 129, 0.08);
  overflow: hidden; 
  min-width: 450px; /* تكبير حجم الإشعار */
  max-width: 90vw; /* منع تجاوز حدود الشاشة في الجوال */
  
  /* الهندسة الابتدائية: التمركز أفقياً (-50%) ومُزاح للأعلى خارج الشاشة (-150%) */
  transform: translate(-50%, -150%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), 
              opacity 0.4s ease, 
              visibility 0.5s;
}

.toast-notification.show {
  /* استقرار في المنتصف أفقياً مع الإسقاط العمودي */
  transform: translate(-50%, 0);
  opacity: 1;
  visibility: visible;
}

.toast-content { 
  display: flex; 
  align-items: center; 
  gap: 16px; 
  padding: 20px 24px; /* زيادة الحشو الداخلي لتكبير الكتلة */
}

.toast-text { 
  color: #1a4d33; /* تغميق لون النص ليتناسق مع الخلفية الخضراء */
  font-size: 16px; /* تكبير الخط */
  font-weight: 700; 
  flex-grow: 1; 
  line-height: 1.5; 
}

.toast-icon {
  color: #10b981; 
  flex-shrink: 0;
}

.toast-close {
  background: transparent;
  border: none;
  font-size: 22px;
  color: #9ca3af;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-close:hover {
  color: #ef4444; 
}

/* ========================================= */
/* المحرك الفيزيائي لشريط التقدم الزمني */
/* ========================================= */
.toast-progress {
  height: 3px;
  width: 100%;
  background: #0056b3;
  transform-origin: right; 
  transform: scaleX(0);
}

.toast-notification.show .toast-progress {
  animation: progressShrink 10s linear forwards;
}

@keyframes progressShrink {
  0% { transform: scaleX(1); }
  100% { transform: scaleX(0); }
}

/* الهوية البصرية لإشعار الخطأ (يُضاف أسفل كود الإشعار السابق) */
.toast-error {
  background: rgba(254, 242, 242, 0.97); /* أحمر باهت */
  border-color: #fecaca;
  box-shadow: 0 15px 35px -5px rgba(239, 68, 68, 0.12), 0 8px 10px -6px rgba(239, 68, 68, 0.08);
}

.toast-error .toast-text { color: #7f1d1d; }
.toast-error .toast-icon { color: #ef4444; }
.toast-error .toast-progress { background: #ef4444; }

/* تحديث طفيف لإشعار النجاح لضمان فصل الألوان في HTML الجديد */
.toast-success .toast-icon { color: #10b981; }
.toast-success .toast-progress { background: #10b981; }