/* ──────────────────────────────────────────
   Toast Notification System
   نظام الإشعارات الاحترافي
   ────────────────────────────────────────── */

#toast-container {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
    width: 100%;
    max-width: 440px;
    padding: 0 16px;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 16px 20px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    font-family: 'Tajawal', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #2c3e50;
    direction: rtl;
    animation: toastSlideIn 0.35s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
    border-right: 4px solid transparent;
    position: relative;
    overflow: hidden;
}

.toast.toast-exit {
    animation: toastSlideOut 0.3s cubic-bezier(0.06, 0.71, 0.55, 1) forwards;
}

/* أنواع التوست */

.toast.toast-success {
    border-right-color: #27ae60;
    background: linear-gradient(135deg, #f0faf4 0%, #ffffff 100%);
}

.toast.toast-error {
    border-right-color: #e74c3c;
    background: linear-gradient(135deg, #fdf2f2 0%, #ffffff 100%);
}

.toast.toast-warning {
    border-right-color: #f39c12;
    background: linear-gradient(135deg, #fef9ee 0%, #ffffff 100%);
}

.toast.toast-info {
    border-right-color: #3498db;
    background: linear-gradient(135deg, #f0f7fd 0%, #ffffff 100%);
}

/* أيقونة التوست */

.toast-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: #fff;
}

.toast-success .toast-icon {
    background: #27ae60;
}

.toast-error .toast-icon {
    background: #e74c3c;
}

.toast-warning .toast-icon {
    background: #f39c12;
}

.toast-info .toast-icon {
    background: #3498db;
}

/* محتوى التوست */

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

.toast-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 13px;
    color: #555;
    word-wrap: break-word;
}

/* زر الإغلاق */

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #aaa;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

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

/* شريط التقدم */

.toast-progress {
    position: absolute;
    bottom: 0;
    right: 0;
    height: 3px;
    border-radius: 0 0 12px 0;
    animation: toastProgress linear forwards;
}

.toast-success .toast-progress {
    background: #27ae60;
}

.toast-error .toast-progress {
    background: #e74c3c;
}

.toast-warning .toast-progress {
    background: #f39c12;
}

.toast-info .toast-progress {
    background: #3498db;
}

/* الحركات */

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
}

@keyframes toastProgress {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}