/* ─────────── Toast / Notification Box ─────────── */
#toastContainer {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-item {
    pointer-events: auto;
    min-width: 300px;
    max-width: 420px;
    padding: 14px 20px;
    border-radius: 14px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: toastIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    direction: rtl;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

.toast-item::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.5;
    animation: toastTimer 4s linear forwards;
}

.toast-item.removing {
    animation: toastOut 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.toast-item .toast-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
}

.toast-item .toast-message {
    flex: 1;
    line-height: 1.6;
}

.toast-item .toast-close {
    flex-shrink: 0;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    font-size: 18px;
    line-height: 1;
}

.toast-item .toast-close:hover {
    opacity: 1;
}

/* ── رنگ‌بندی ── */
.toast-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.toast-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.toast-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fcd34d;
}

.toast-info {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

/* ── انیمیشن‌ها ── */
@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
}

@keyframes toastTimer {
    from { width: 100%; }
    to { width: 0%; }
}
